Skip to content

Commit

Permalink
gas optimization #409
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanrikulu committed Oct 17, 2023
1 parent 18b5b86 commit ef391c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/ERC20MultiDelegate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ import "@openzeppelin/contracts/utils/math/Math.sol";
* This is a proxy delegator contract to vote given delegate on behalf of original delegator
*/
contract ERC20ProxyDelegator {
constructor(ERC20Votes _token, address _delegate) {
constructor(ERC20Votes _token, address _delegate) payable {
_token.approve(msg.sender, type(uint256).max);
_token.delegate(_delegate);
/// @solidity memory-safe-assembly
assembly {
mstore8(0, 0xff)
return(0, 1)
}
}
}

Expand Down

0 comments on commit ef391c1

Please sign in to comment.