mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Remove delegateBySig
This commit is contained in:
parent
374f450605
commit
ad3ffd0de2
|
@ -12,10 +12,4 @@ contract Events {
|
|||
address indexed account,
|
||||
address indexed delegatee
|
||||
);
|
||||
|
||||
event LogArbTokensDelegatedBySig(
|
||||
address indexed account,
|
||||
address indexed delegatee,
|
||||
uint256 nonce
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -9,11 +9,4 @@ contract Variables {
|
|||
|
||||
IArbTokenContract public constant ARB_TOKEN_CONTRACT =
|
||||
IArbTokenContract(0x912CE59144191C1204E64559FE8253a0e49E6548);
|
||||
|
||||
struct SignedPermits {
|
||||
uint8 v;
|
||||
bytes32 r;
|
||||
bytes32 s;
|
||||
uint256 expiry;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user