From ad3ffd0de2259ad3c1f1498562d6904b8b6a34bf Mon Sep 17 00:00:00 2001 From: Shriya Tyagi Date: Thu, 20 Apr 2023 16:55:57 +0400 Subject: [PATCH] Remove delegateBySig --- .../arbitrum/connectors/arb-claim/events.sol | 6 ----- .../arbitrum/connectors/arb-claim/helpers.sol | 2 +- .../arbitrum/connectors/arb-claim/main.sol | 27 ++----------------- .../connectors/arb-claim/variables.sol | 7 ----- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/contracts/arbitrum/connectors/arb-claim/events.sol b/contracts/arbitrum/connectors/arb-claim/events.sol index ba1a1835..6d220d43 100644 --- a/contracts/arbitrum/connectors/arb-claim/events.sol +++ b/contracts/arbitrum/connectors/arb-claim/events.sol @@ -12,10 +12,4 @@ contract Events { address indexed account, address indexed delegatee ); - - event LogArbTokensDelegatedBySig( - address indexed account, - address indexed delegatee, - uint256 nonce - ); } diff --git a/contracts/arbitrum/connectors/arb-claim/helpers.sol b/contracts/arbitrum/connectors/arb-claim/helpers.sol index 0e91e30e..4eb872de 100644 --- a/contracts/arbitrum/connectors/arb-claim/helpers.sol +++ b/contracts/arbitrum/connectors/arb-claim/helpers.sol @@ -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); } } \ No newline at end of file diff --git a/contracts/arbitrum/connectors/arb-claim/main.sol b/contracts/arbitrum/connectors/arb-claim/main.sol index 27f0600f..f908b8b1 100644 --- a/contracts/arbitrum/connectors/arb-claim/main.sol +++ b/contracts/arbitrum/connectors/arb-claim/main.sol @@ -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 { diff --git a/contracts/arbitrum/connectors/arb-claim/variables.sol b/contracts/arbitrum/connectors/arb-claim/variables.sol index 4f08a35c..fb3e29d5 100644 --- a/contracts/arbitrum/connectors/arb-claim/variables.sol +++ b/contracts/arbitrum/connectors/arb-claim/variables.sol @@ -9,11 +9,4 @@ contract Variables { IArbTokenContract public constant ARB_TOKEN_CONTRACT = IArbTokenContract(0x912CE59144191C1204E64559FE8253a0e49E6548); - - struct SignedPermits { - uint8 v; - bytes32 r; - bytes32 s; - uint256 expiry; - } }