Created
July 8, 2020 00:12
-
-
Save ajb413/4c94089ec5a32059c1b410179f9137fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.16; | |
pragma experimental ABIEncoderV2; | |
interface Comp { | |
function delegateBySig( | |
address delegatee, | |
uint nonce, | |
uint expiry, | |
uint8 v, | |
bytes32 r, | |
bytes32 s | |
) external; | |
} | |
contract BatchDelegate { | |
struct Sig { | |
address delegatee; | |
uint nonce; | |
uint expiry; | |
uint8 v; | |
bytes32 r; | |
bytes32 s; | |
} | |
function delegateBySigs(Sig[] memory sigs) public { | |
Comp comp = Comp(0xc00e94Cb662C3520282E6f5717214004A7f26888); | |
for (uint i = 0; i < sigs.length; i++) { | |
Sig memory sig = sigs[i]; | |
comp.delegateBySig(sig.delegatee, sig.nonce, sig.expiry, sig.v, sig.r, sig.s); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment