- Verified, Token, Router
- DAO
- Fungible Token
- Router
- ERC-20
The following smart contract is SingDao, a token contract that implements the ERC20 standard. It allows for minting of tokens, transferring tokens, and delegation of voting power. It also includes a locking mechanism through an external contract, ILocker. The contract uses SafeMath to prevent integer overflow and implements the EIP712 standard for signature verification.
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
address public nominatedOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event OwnerNominated(address indexed newOwner);
event OwnerChanged(address indexed oldOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}
function acceptOwnership() external {
require(msg.sender == nominatedOwner, 'You must be nominated before you can accept ownership');
emit OwnerChanged(_owner, nominatedOwner);
_owner = nominatedOwner;
nominatedOwner = address(0);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./Ownable.sol";
contract SingDao is Ownable {
/// @notice EIP-20 token name for this token
string public constant name = "Singularity Dao";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "SDAO";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint256 public totalSupply = 100_000_000e18;
ILocker public locker;
mapping(address => mapping(address => uint96)) internal allowances;
mapping(address => uint96) internal balances;
mapping(address => address) public delegates;
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;
mapping(address => uint32) public numCheckpoints;
bytes32 public constant DOMAIN_TYPEHASH = keccak256(
"EIP712Domain(string name,uint256 chainId,address verifyingContract)"
);
bytes32 public constant DELEGATION_TYPEHASH = keccak256(
"Delegation(address delegatee,uint256 nonce,uint256 expiry)"
);
mapping(address => uint256) public nonces;
event DelegateChanged(
address indexed delegator,
address indexed fromDelegate,
address indexed toDelegate
);
event DelegateVotesChanged(
address indexed delegate,
uint256 previousBalance,
uint256 newBalance
);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
function mint(address dst, uint rawAmount) external onlyOwner {
// mint the amount
require(
dst != address(0),
"Sdao::_transferTokens: cannot mint to the zero address"
);
uint96 amount = safe96(rawAmount, "Sdao::mint: amount exceeds 96 bits");
totalSupply = safe96(SafeMath.add(totalSupply, amount), "Sdao::mint: totalSupply exceeds 96 bits");
// transfer the amount to the recipient
balances[dst] = add96(balances[dst], amount, "Sdao::mint: transfer amount overflows");
emit Transfer(address(0), dst, amount);
// move delegates
_moveDelegates(address(0), delegates[dst], amount);
}
function allowance(address account, address spender)
external
view
returns (uint256)
{
return allowances[account][spender];
}
function approve(address spender, uint256 rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint256(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "SDAO::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function balanceOf(address account) external view returns (uint256) {
return balances[account];
}
function nonceOf(address account) external view returns (uint256) {
return nonces[account];
}
function transfer(address dst, uint256 rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "SDAO::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
function transferFrom(
address src,
address dst,
uint256 rawAmount
) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "SDAO::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(
spenderAllowance,
amount,
"SDAO::transferFrom: transfer amount exceeds spender allowance"
);
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public {
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name)),
getChainId(),
address(this)
)
);
bytes32 structHash = keccak256(
abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)
);
bytes32 digest = keccak256(
abi.encodePacked("\x19\x01", domainSeparator, structHash)
);
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "sdao::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "sdao::delegateBySig: invalid nonce");
require(now <= expiry, "sdao::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
function getPriorVotes(address account, uint256 blockNumber)
public
view
returns (uint96)
{
require(
blockNumber < block.number,
"sdao::getPriorVotes: not yet determined"
);
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2;
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(
address src,
address dst,
uint96 amount
) internal {
require(
src != address(0),
"sdao::_transferTokens: cannot transfer from the zero address"
);
require(
dst != address(0),
"sdao::_transferTokens: cannot transfer to the zero address"
);
if(address(locker) != address(0)){
locker.lockOrGetPenalty(src,dst);
}
balances[src] = sub96(
balances[src],
amount,
"sdao::_transferTokens: transfer amount exceeds balance"
);
balances[dst] = add96(
balances[dst],
amount,
"sdao::_transferTokens: transfer amount overflows"
);
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(
address srcRep,
address dstRep,
uint96 amount
) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0
? checkpoints[srcRep][srcRepNum - 1].votes
: 0;
uint96 srcRepNew = sub96(
srcRepOld,
amount,
"sdao::_moveVotes: vote amount underflows"
);
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0
? checkpoints[dstRep][dstRepNum - 1].votes
: 0;
uint96 dstRepNew = add96(
dstRepOld,
amount,
"sdao::_moveVotes: vote amount overflows"
);
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(
address delegatee,
uint32 nCheckpoints,
uint96 oldVotes,
uint96 newVotes
) internal {
uint32 blockNumber = safe32(
block.number,
"sdao::_writeCheckpoint: block number exceeds 32 bits"
);
if (
nCheckpoints > 0 &&
checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber
) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint256 n, string memory errorMessage)
internal
pure
returns (uint32)
{
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint256 n, string memory errorMessage)
internal
pure
returns (uint96)
{
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(
uint96 a,
uint96 b,
string memory errorMessage
) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(
uint96 a,
uint96 b,
string memory errorMessage
) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint256) {
uint256 chainId;
assembly {
chainId := chainid()
}
return chainId;
}
function setLocker(address _locker) external onlyOwner {
locker = ILocker(_locker);
}
}
interface ILocker {
function lockOrGetPenalty(address source, address dest)external returns(bool,uint256);
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
[{"inputs":[{"internalType":"address","name":"account","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint96","name":"votes","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locker","outputs":[{"internalType":"contract ILocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"nonceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_locker","type":"address"}],"name":"setLocker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"rawAmount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
60806040526a52b7d2dcc80cd2e40000006002553480156200002057600080fd5b50604051620020af380380620020af833981016040819052620000439162000125565b6000620000586001600160e01b036200012116565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600280546001600160a01b03831660008181526005602052604080822080546001600160601b0319166001600160601b0390951694909417909355925491519092917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9162000112919062000155565b60405180910390a3506200015e565b3390565b60006020828403121562000137578081fd5b81516001600160a01b03811681146200014e578182fd5b9392505050565b90815260200190565b611f41806200016e6000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c806370a08231116100f9578063b4b5ea5711610097578063dd62ed3e11610071578063dd62ed3e14610366578063e7a324dc14610379578063ed2a2d6414610381578063f1127ed814610394576101a9565b8063b4b5ea5714610338578063c3cda5201461034b578063d7b96d4e1461035e576101a9565b80637ecebe00116100d35780637ecebe00146103025780638da5cb5b1461031557806395d89b411461031d578063a9059cbb14610325576101a9565b806370a08231146102c7578063782d6fe1146102da57806379ba5097146102fa576101a9565b806323b872dd1161016657806353a47bb71161014057806353a47bb71461026c578063587cde1e146102815780635c19a95c146102945780636fcfff45146102a7576101a9565b806323b872dd14610231578063313ce5671461024457806340c10f1914610259576101a9565b806306fdde03146101ae578063095ea7b3146101cc5780631627540c146101ec578063171060ec1461020157806318160ddd1461021457806320606b7014610229575b600080fd5b6101b66103b5565b6040516101c391906119b2565b60405180910390f35b6101df6101da366004611701565b6103e0565b6040516101c39190611938565b6101ff6101fa366004611672565b61049f565b005b6101ff61020f366004611672565b610531565b61021c610592565b6040516101c39190611943565b61021c610598565b6101df61023f3660046116c1565b6105af565b61024c6106f6565b6040516101c39190611cdb565b6101ff610267366004611701565b6106fb565b6102746108ab565b6040516101c3919061190a565b61027461028f366004611672565b6108ba565b6101ff6102a2366004611672565b6108d5565b6102ba6102b5366004611672565b6108e2565b6040516101c39190611cab565b61021c6102d5366004611672565b6108fa565b6102ed6102e8366004611701565b61091e565b6040516101c39190611ce9565b6101ff610b2c565b61021c610310366004611672565b610bba565b610274610bcc565b6101b6610bdb565b6101df610333366004611701565b610bfb565b6102ed610346366004611672565b610c37565b6101ff61035936600461172b565b610ca8565b610274610e99565b61021c61037436600461168d565b610ea8565b61021c610edc565b61021c61038f366004611672565b610ee8565b6103a76103a236600461178a565b610f03565b6040516101c3929190611cbc565b6040518060400160405280600f81526020016e53696e67756c61726974792044616f60881b81525081565b6000806000198314156103f6575060001961041b565b61041883604051806060016040528060258152602001611de460259139610f38565b90505b3360008181526004602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061048b908590611ce9565b60405180910390a360019150505b92915050565b6104a7610f67565b6001600160a01b03166104b8610bcc565b6001600160a01b0316146104e75760405162461bcd60e51b81526004016104de90611b20565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290600090a250565b610539610f67565b6001600160a01b031661054a610bcc565b6001600160a01b0316146105705760405162461bcd60e51b81526004016104de90611b20565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60025481565b6040516105a490611860565b604051809103902081565b6001600160a01b03831660009081526004602090815260408083203380855290835281842054825160608101909352602580845291936001600160601b039091169285926106079288929190611de490830139610f38565b9050866001600160a01b0316836001600160a01b03161415801561063457506001600160601b0382811614155b156106de57600061065e83836040518060600160405280603d8152602001611e56603d9139610f6b565b6001600160a01b038981166000818152600460209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906106d4908590611ce9565b60405180910390a3505b6106e9878783610faa565b5060019695505050505050565b601281565b610703610f67565b6001600160a01b0316610714610bcc565b6001600160a01b03161461073a5760405162461bcd60e51b81526004016104de90611b20565b6001600160a01b0382166107605760405162461bcd60e51b81526004016104de90611bb2565b600061078482604051806060016040528060228152602001611ec360229139610f38565b90506107bc61079e600254836001600160601b03166111e7565b604051806060016040528060278152602001611ee560279139610f38565b6001600160601b039081166002556001600160a01b03841660009081526005602090815260409182902054825160608101909352602580845261080f9491909116928592909190611e319083013961120c565b6001600160a01b03841660008181526005602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610879908590611ce9565b60405180910390a36001600160a01b038084166000908152600660205260408120546108a6921683611248565b505050565b6001546001600160a01b031681565b6006602052600090815260409020546001600160a01b031681565b6108df33826113da565b50565b60086020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600560205260409020546001600160601b031690565b600043821061093f5760405162461bcd60e51b81526004016104de90611a93565b6001600160a01b03831660009081526008602052604090205463ffffffff168061096d576000915050610499565b6001600160a01b038416600090815260076020908152604080832063ffffffff6000198601811685529252909120541683106109e9576001600160a01b03841660009081526007602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050610499565b6001600160a01b038416600090815260076020908152604080832083805290915290205463ffffffff16831015610a24576000915050610499565b600060001982015b8163ffffffff168163ffffffff161115610ae757600282820363ffffffff16048103610a56611644565b506001600160a01b038716600090815260076020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610ac2576020015194506104999350505050565b805163ffffffff16871115610ad957819350610ae0565b6001820392505b5050610a2c565b506001600160a01b038516600090815260076020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b6001546001600160a01b03163314610b565760405162461bcd60e51b81526004016104de906119c5565b600154600080546040516001600160a01b0393841693909116917fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60096020526000908152604090205481565b6000546001600160a01b031690565b604051806040016040528060048152602001635344414f60e01b81525081565b600080610c2083604051806060016040528060268152602001611dbe60269139610f38565b9050610c2d338583610faa565b5060019392505050565b6001600160a01b03811660009081526008602052604081205463ffffffff1680610c62576000610ca1565b6001600160a01b0383166000908152600760209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b9392505050565b6000604051610cb690611860565b60408051918290038220828201909152600f82526e53696e67756c61726974792044616f60881b6020909201919091527f7c9d3f21e68ea39f1cc093a5190b31effd6eb2d11fdda1da452d0ff7f90320d0610d0f611464565b30604051602001610d239493929190611970565b6040516020818303038152906040528051906020012090506000604051610d49906118bb565b604051908190038120610d64918a908a908a9060200161194c565b60405160208183030381529060405280519060200120905060008282604051602001610d91929190611845565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610dce9493929190611994565b6020604051602081039080840390855afa158015610df0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e235760405162461bcd60e51b81526004016104de90611ada565b6001600160a01b03811660009081526009602052604090208054600181019091558914610e625760405162461bcd60e51b81526004016104de90611a1a565b87421115610e825760405162461bcd60e51b81526004016104de90611c65565b610e8c818b6113da565b505050505b505050505050565b6003546001600160a01b031681565b6001600160a01b0391821660009081526004602090815260408083209390941682529190915220546001600160601b031690565b6040516105a4906118bb565b6001600160a01b031660009081526009602052604090205490565b600760209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600081600160601b8410610f5f5760405162461bcd60e51b81526004016104de91906119b2565b509192915050565b3390565b6000836001600160601b0316836001600160601b031611158290610fa25760405162461bcd60e51b81526004016104de91906119b2565b505050900390565b6001600160a01b038316610fd05760405162461bcd60e51b81526004016104de90611c08565b6001600160a01b038216610ff65760405162461bcd60e51b81526004016104de90611b55565b6003546001600160a01b03161561108d5760035460405163aa61a9dd60e01b81526001600160a01b039091169063aa61a9dd90611039908690869060040161191e565b6040805180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061108a91908101906117c9565b50505b6001600160a01b0383166000908152600560209081526040918290205482516060810190935260368084526110d8936001600160601b039092169285929190611d2d90830139610f6b565b6001600160a01b03848116600090815260056020908152604080832080546001600160601b0319166001600160601b039687161790559286168252908290205482516060810190935260308084526111409491909116928592909190611e939083013961120c565b6001600160a01b038381166000818152600560205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111ad908590611ce9565b60405180910390a36001600160a01b038084166000908152600660205260408082205485841683529120546108a692918216911683611248565b600082820183811015610ca15760405162461bcd60e51b81526004016104de90611a5c565b6000838301826001600160601b03808716908316101561123f5760405162461bcd60e51b81526004016104de91906119b2565b50949350505050565b816001600160a01b0316836001600160a01b03161415801561127357506000816001600160601b0316115b156108a6576001600160a01b0383161561132b576001600160a01b03831660009081526008602052604081205463ffffffff1690816112b35760006112f2565b6001600160a01b0385166000908152600760209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006113198285604051806060016040528060288152602001611e0960289139610f6b565b905061132786848484611468565b5050505b6001600160a01b038216156108a6576001600160a01b03821660009081526008602052604081205463ffffffff1690816113665760006113a5565b6001600160a01b0384166000908152600760209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006113cc8285604051806060016040528060278152602001611d976027913961120c565b9050610e9185848484611468565b6001600160a01b03808316600081815260066020818152604080842080546005845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461145e828483611248565b50505050565b4690565b600061148c43604051806060016040528060348152602001611d636034913961161d565b905060008463ffffffff161180156114d557506001600160a01b038516600090815260076020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611534576001600160a01b0385166000908152600760209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b038516021790556115d3565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600783528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600890935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161160e929190611cfd565b60405180910390a25050505050565b600081600160201b8410610f5f5760405162461bcd60e51b81526004016104de91906119b2565b604080518082019091526000808252602082015290565b80356001600160a01b038116811461049957600080fd5b600060208284031215611683578081fd5b610ca1838361165b565b6000806040838503121561169f578081fd5b6116a9848461165b565b91506116b8846020850161165b565b90509250929050565b6000806000606084860312156116d5578081fd5b83356116e081611d17565b925060208401356116f081611d17565b929592945050506040919091013590565b60008060408385031215611713578182fd5b61171d848461165b565b946020939093013593505050565b60008060008060008060c08789031215611743578182fd5b61174d888861165b565b95506020870135945060408701359350606087013560ff81168114611770578283fd5b9598949750929560808101359460a0909101359350915050565b6000806040838503121561179c578182fd5b6117a6848461165b565b9150602083013563ffffffff811681146117be578182fd5b809150509250929050565b600080604083850312156117db578182fd5b825180151581146117ea578283fd5b6020939093015192949293505050565b60008151808452815b8181101561181f57602081850181015186830182015201611803565b818111156118305782602083870101525b50601f01601f19169290920160200192915050565b61190160f01b81526002810192909252602282015260420190565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430190565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0190565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b901515815260200190565b90815260200190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b600060208252610ca160208301846117fa565b60208082526035908201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560408201527402063616e20616363657074206f776e65727368697605c1b606082015260800190565b60208082526022908201527f7364616f3a3a64656c656761746542795369673a20696e76616c6964206e6f6e604082015261636560f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526027908201527f7364616f3a3a6765745072696f72566f7465733a206e6f742079657420646574604082015266195c9b5a5b995960ca1b606082015260800190565b60208082526026908201527f7364616f3a3a64656c656761746542795369673a20696e76616c6964207369676040820152656e617475726560d01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252603a908201527f7364616f3a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e7366657220746f20746865207a65726f2061646472657373000000000000606082015260800190565b60208082526036908201527f5364616f3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74206d696040820152756e7420746f20746865207a65726f206164647265737360501b606082015260800190565b6020808252603c908201527f7364616f3a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e736665722066726f6d20746865207a65726f206164647265737300000000606082015260800190565b60208082526026908201527f7364616f3a3a64656c656761746542795369673a207369676e617475726520656040820152651e1c1a5c995960d21b606082015260800190565b63ffffffff91909116815260200190565b63ffffffff9290921682526001600160601b0316602082015260400190565b60ff91909116815260200190565b6001600160601b0391909116815260200190565b6001600160601b0392831681529116602082015260400190565b6001600160a01b03811681146108df57600080fdfe7364616f3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63657364616f3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974737364616f3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77735344414f3a3a7472616e736665723a20616d6f756e74206578636565647320393620626974735344414f3a3a617070726f76653a20616d6f756e74206578636565647320393620626974737364616f3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77735364616f3a3a6d696e743a207472616e7366657220616d6f756e74206f766572666c6f77735344414f3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63657364616f3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77735364616f3a3a6d696e743a20616d6f756e74206578636565647320393620626974735364616f3a3a6d696e743a20746f74616c537570706c7920657863656564732039362062697473a2646970667358221220fe2de58331df68a98f816db8b68c25a6f23fa220f10cd3daa8ff76fb1defbb5864736f6c63430006020033000000000000000000000000a60598889a76c997d72c94402fa9c8ee6a33eb00
Checkout more smart contracts
- Lido
- Proposer Fee Recipient
- Router
- Verified
- Fungible Token
- ERC20
- Verified, Token
- LooksRare
- Fungible Token
- ERC-20
LidoExecutionLayerRewardsVault
The following smart contract is called LidoExecutionLayerRewardsVault. It is used to manage rewards for the Lido protocol. The contract allows Lido to withdraw rewards, recover ERC20 and ERC721 tokens, and receive ETH. The contract uses the SafeERC20 library to ensure safe transfers of ERC20 tokens. The purpose of this contract is to provide a secure and efficient way to manage rewards for the Lido protocol.
SHILAINU
The following smart contract is the SHILAINU token contract, which is an ERC20 token with a total supply of 1 trillion. It includes features such as transaction limits, fees, and automatic liquidity provision. The contract also has a blacklist mode and the ability to set fee and transaction exemptions for specific addresses. The purpose of the contract is to provide a decentralized currency for the Shiba Inu community.
LooksRareAirdrop
The following smart contract is a LooksRareAirdrop contract that allows users to claim airdrop rewards in the form of ERC20 tokens. Users must provide a valid merkle proof and meet certain requirements, including having a signed maker order and approval for the collection. The contract is pausable and has a maximum amount that can be claimed. The owner can set the merkle root, update the end timestamp, and withdraw token rewards.