Remove delegateBySig

This commit is contained in:
Shriya Tyagi 2023-04-20 16:55:57 +04:00 committed by q1q0
parent a800c3b197
commit 2d2f9d01b0
4 changed files with 3 additions and 39 deletions

View File

@ -12,10 +12,4 @@ contract Events {
address indexed account,
address indexed delegatee
);
event LogArbTokensDelegatedBySig(
address indexed account,
address indexed delegatee,
uint256 nonce
);
}

View File

@ -5,7 +5,7 @@ import "./variables.sol";
import { Basic } from "../../common/basic.sol";
contract Helpers is Variables, Basic {
function claimableArbTokens(address user) internal view returns (uint256) {
function claimableArbTokens(address user) public view returns (uint256) {
return ARBITRUM_TOKEN_DISTRIBUTOR.claimableTokens(user);
}
}

View File

@ -17,7 +17,8 @@ abstract contract ArbitrumAirdrop is Events, Helpers {
returns (string memory eventName_, bytes memory eventParam_)
{
uint256 claimable = claimableArbTokens(address(this));
require(claimable > 0, "0-tokens-claimable");
// If claimable <= 0, ARB TokenDistributor will revert on claim.
ARBITRUM_TOKEN_DISTRIBUTOR.claim();
setUint(setId, claimable);
@ -38,30 +39,6 @@ abstract contract ArbitrumAirdrop is Events, Helpers {
eventName_ = "LogArbTokensDelegated(address,address)";
eventParam_ = abi.encode(address(this), delegatee);
}
/**
* @dev Delegates votes from signer to `delegatee`.
* @param delegatee The address to delegate the ARB tokens to.
* @param nonce The nonce number.
* @param permits The struct containing signed permit data like v,r,s,expiry.
*/
function delegateBySig(
address delegatee,
uint256 nonce,
SignedPermits calldata permits
) public returns (string memory eventName_, bytes memory eventParam_) {
ARB_TOKEN_CONTRACT.delegateBySig(
delegatee,
nonce,
permits.expiry,
permits.v,
permits.r,
permits.s
);
eventName_ = "LogArbTokensDelegatedBySig(address,address,uint256)";
eventParam_ = abi.encode(address(this), delegatee, nonce);
}
}
contract ConnectV2ArbitrumAirdrop is ArbitrumAirdrop {

View File

@ -9,11 +9,4 @@ contract Variables {
IArbTokenContract public constant ARB_TOKEN_CONTRACT =
IArbTokenContract(0x912CE59144191C1204E64559FE8253a0e49E6548);
struct SignedPermits {
uint8 v;
bytes32 r;
bytes32 s;
uint256 expiry;
}
}