Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
DepositToken
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import "./interfaces/IERC20.sol"; import "./interfaces/INFTHolder.sol"; contract DepositToken is IERC20 { string public name; string public symbol; uint8 public constant decimals = 18; mapping(address => mapping(address => uint256)) public override allowance; ILpDepositor public depositor; address public pool; constructor() { // set to prevent the implementation contract from being initialized pool = address(0xdead); } /** @dev Initializes the contract after deployment via a minimal proxy */ function initialize(address _pool) external returns (bool) { require(pool == address(0)); pool = _pool; depositor = ILpDepositor(msg.sender); string memory _symbol = IERC20(pool).symbol(); name = string(abi.encodePacked("Monolith ", _symbol, " Deposit")); symbol = string(abi.encodePacked("mo-", _symbol)); return true; } function balanceOf(address account) external view returns (uint256) { return depositor.userBalances(account, pool); } function totalSupply() external view returns (uint256) { return depositor.totalBalances(pool); } function approve(address _spender, uint256 _value) external override returns (bool) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** shared logic for transfer and transferFrom */ function _transfer(address _from, address _to, uint256 _value) internal { if (_value > 0) { depositor.transferDeposit(pool, _from, _to, _value); } emit Transfer(_from, _to, _value); } /** @notice Transfer tokens to a specified address @param _to The address to transfer to @param _value The amount to be transferred @return Success boolean */ function transfer(address _to, uint256 _value) public override returns (bool) { _transfer(msg.sender, _to, _value); return true; } /** @notice Transfer tokens from one address to another @param _from The address which you want to send tokens from @param _to The address which you want to transfer to @param _value The amount of tokens to be transferred @return Success boolean */ function transferFrom( address _from, address _to, uint256 _value ) public override returns (bool) { require(allowance[_from][msg.sender] >= _value, "Insufficient allowance"); if (allowance[_from][msg.sender] != type(uint).max) { allowance[_from][msg.sender] -= _value; } _transfer(_from, _to, _value); return true; } /** @dev Only callable ty `LpDepositor`. Used to trigger a `Transfer` event upon deposit of LP tokens, to aid accounting in block explorers. */ function mint(address _to, uint256 _value) external returns (bool) { require(msg.sender == address(depositor)); emit Transfer(address(0), _to, _value); return true; } /** @dev Only callable ty `LpDepositor`. Used to trigger a `Transfer` event upon withdrawal of LP tokens, to aid accounting in block explorers. */ function burn(address _from, uint256 _value) external returns (bool) { require(msg.sender == address(depositor)); emit Transfer(_from, address(0), _value); return true; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; /** * Based on the OpenZeppelin IER20 interface: * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol * * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval( address indexed owner, address indexed spender, uint256 value ); function mint(address _to, uint256 _value) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; interface ILpDepositor { function tokenID() external view returns (uint256); function setTokenID(uint256 tokenID) external returns (bool); function userBalances(address user, address pool) external view returns (uint256); function totalBalances(address pool) external view returns (uint256); function transferDeposit( address pool, address from, address to, uint256 amount ) external returns (bool); function votingWindow() external returns (uint256); function enterSplitMode(uint256 workTimeLimit) external; function detachGauges(address[] memory gaugeAddresses) external; function reattachGauges(address[] memory gaugeAddresses) external; }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"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":"value","type":"uint256"}],"name":"Approval","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":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","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":"_from","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"burn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositor","outputs":[{"internalType":"contract ILpDepositor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"initialize","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600480546001600160a01b03191661dead179055610bf1806100346000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101df578063c4d66de8146101f2578063c7c4ff4614610205578063dd62ed3e1461021857600080fd5b806370a08231146101b157806395d89b41146101c45780639dc29fac146101cc57600080fd5b806318160ddd116100c857806318160ddd1461015b57806323b872dd14610171578063313ce5671461018457806340c10f191461019e57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806316f0115b14610130575b600080fd5b6100f7610243565b6040516101049190610804565b60405180910390f35b61012061011b366004610853565b6102d1565b6040519015158152602001610104565b600454610143906001600160a01b031681565b6040516001600160a01b039091168152602001610104565b61016361033e565b604051908152602001610104565b61012061017f36600461087d565b6103b8565b61018c601281565b60405160ff9091168152602001610104565b6101206101ac366004610853565b6104a2565b6101636101bf3660046108b9565b6104fa565b6100f761057a565b6101206101da366004610853565b610587565b6101206101ed366004610853565b6105df565b6101206102003660046108b9565b6105f5565b600354610143906001600160a01b031681565b6101636102263660046108db565b600260209081526000928352604080842090915290825290205481565b600080546102509061090e565b80601f016020809104026020016040519081016040528092919081815260200182805461027c9061090e565b80156102c95780601f1061029e576101008083540402835291602001916102c9565b820191906000526020600020905b8154815290600101906020018083116102ac57829003601f168201915b505050505081565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061032c9086815260200190565b60405180910390a35060015b92915050565b60035460048054604051635774e43960e11b81526001600160a01b0391821692810192909252600092169063aee9c87290602401602060405180830381865afa15801561038f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b39190610948565b905090565b6001600160a01b03831660009081526002602090815260408083203384529091528120548211156104285760405162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b604482015260640160405180910390fd5b6001600160a01b03841660009081526002602090815260408083203384529091529020546000191461048d576001600160a01b038416600090815260026020908152604080832033845290915281208054849290610487908490610961565b90915550505b6104988484846106f9565b5060019392505050565b6003546000906001600160a01b031633146104bc57600080fd5b6040518281526001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161032c565b6003546004805460405163015b6a3360e71b81526001600160a01b03858116938201939093529082166024820152600092919091169063adb5198090604401602060405180830381865afa158015610556573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610948565b600180546102509061090e565b6003546000906001600160a01b031633146105a157600080fd5b6040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161032c565b60006105ec3384846106f9565b50600192915050565b6004546000906001600160a01b03161561060e57600080fd5b600480546001600160a01b0384166001600160a01b031991821681178355600380549092163317909155604080516395d89b4160e01b815290516000936395d89b419280820192869290918290030181865afa158015610672573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261069a9190810190610998565b9050806040516020016106ad9190610a45565b604051602081830303815290604052600090816106ca9190610ad7565b50806040516020016106dc9190610b97565b604051602081830303815290604052600190816104989190610ad7565b801561078e576003546004805460405163bd88035760e01b81526001600160a01b039182169281019290925285811660248301528481166044830152606482018490529091169063bd880357906084016020604051808303816000875af1158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c9190610bc2565b505b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d391815260200190565b60405180910390a3505050565b60005b838110156107fb5781810151838201526020016107e3565b50506000910152565b60208152600082518060208401526108238160408501602087016107e0565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461084e57600080fd5b919050565b6000806040838503121561086657600080fd5b61086f83610837565b946020939093013593505050565b60008060006060848603121561089257600080fd5b61089b84610837565b92506108a960208501610837565b9150604084013590509250925092565b6000602082840312156108cb57600080fd5b6108d482610837565b9392505050565b600080604083850312156108ee57600080fd5b6108f783610837565b915061090560208401610837565b90509250929050565b600181811c9082168061092257607f821691505b60208210810361094257634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561095a57600080fd5b5051919050565b8181038181111561033857634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6000602082840312156109aa57600080fd5b815167ffffffffffffffff808211156109c257600080fd5b818401915084601f8301126109d657600080fd5b8151818111156109e8576109e8610982565b604051601f8201601f19908116603f01168101908382118183101715610a1057610a10610982565b81604052828152876020848701011115610a2957600080fd5b610a3a8360208301602088016107e0565b979650505050505050565b68026b7b737b634ba34160bd1b815260008251610a698160098501602087016107e0565b670811195c1bdcda5d60c21b6009939091019283015250601101919050565b601f821115610ad257600081815260208120601f850160051c81016020861015610aaf5750805b601f850160051c820191505b81811015610ace57828155600101610abb565b5050505b505050565b815167ffffffffffffffff811115610af157610af1610982565b610b0581610aff845461090e565b84610a88565b602080601f831160018114610b3a5760008415610b225750858301515b600019600386901b1c1916600185901b178555610ace565b600085815260208120601f198616915b82811015610b6957888601518255948401946001909101908401610b4a565b5085821015610b875787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b626d6f2d60e81b815260008251610bb58160038501602087016107e0565b9190910160030192915050565b600060208284031215610bd457600080fd5b815180151581146108d457600080fdfea164736f6c6343000810000a
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101df578063c4d66de8146101f2578063c7c4ff4614610205578063dd62ed3e1461021857600080fd5b806370a08231146101b157806395d89b41146101c45780639dc29fac146101cc57600080fd5b806318160ddd116100c857806318160ddd1461015b57806323b872dd14610171578063313ce5671461018457806340c10f191461019e57600080fd5b806306fdde03146100ef578063095ea7b31461010d57806316f0115b14610130575b600080fd5b6100f7610243565b6040516101049190610804565b60405180910390f35b61012061011b366004610853565b6102d1565b6040519015158152602001610104565b600454610143906001600160a01b031681565b6040516001600160a01b039091168152602001610104565b61016361033e565b604051908152602001610104565b61012061017f36600461087d565b6103b8565b61018c601281565b60405160ff9091168152602001610104565b6101206101ac366004610853565b6104a2565b6101636101bf3660046108b9565b6104fa565b6100f761057a565b6101206101da366004610853565b610587565b6101206101ed366004610853565b6105df565b6101206102003660046108b9565b6105f5565b600354610143906001600160a01b031681565b6101636102263660046108db565b600260209081526000928352604080842090915290825290205481565b600080546102509061090e565b80601f016020809104026020016040519081016040528092919081815260200182805461027c9061090e565b80156102c95780601f1061029e576101008083540402835291602001916102c9565b820191906000526020600020905b8154815290600101906020018083116102ac57829003601f168201915b505050505081565b3360008181526002602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061032c9086815260200190565b60405180910390a35060015b92915050565b60035460048054604051635774e43960e11b81526001600160a01b0391821692810192909252600092169063aee9c87290602401602060405180830381865afa15801561038f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b39190610948565b905090565b6001600160a01b03831660009081526002602090815260408083203384529091528120548211156104285760405162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b604482015260640160405180910390fd5b6001600160a01b03841660009081526002602090815260408083203384529091529020546000191461048d576001600160a01b038416600090815260026020908152604080832033845290915281208054849290610487908490610961565b90915550505b6104988484846106f9565b5060019392505050565b6003546000906001600160a01b031633146104bc57600080fd5b6040518281526001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161032c565b6003546004805460405163015b6a3360e71b81526001600160a01b03858116938201939093529082166024820152600092919091169063adb5198090604401602060405180830381865afa158015610556573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103389190610948565b600180546102509061090e565b6003546000906001600160a01b031633146105a157600080fd5b6040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200161032c565b60006105ec3384846106f9565b50600192915050565b6004546000906001600160a01b03161561060e57600080fd5b600480546001600160a01b0384166001600160a01b031991821681178355600380549092163317909155604080516395d89b4160e01b815290516000936395d89b419280820192869290918290030181865afa158015610672573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261069a9190810190610998565b9050806040516020016106ad9190610a45565b604051602081830303815290604052600090816106ca9190610ad7565b50806040516020016106dc9190610b97565b604051602081830303815290604052600190816104989190610ad7565b801561078e576003546004805460405163bd88035760e01b81526001600160a01b039182169281019290925285811660248301528481166044830152606482018490529091169063bd880357906084016020604051808303816000875af1158015610768573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078c9190610bc2565b505b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d391815260200190565b60405180910390a3505050565b60005b838110156107fb5781810151838201526020016107e3565b50506000910152565b60208152600082518060208401526108238160408501602087016107e0565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461084e57600080fd5b919050565b6000806040838503121561086657600080fd5b61086f83610837565b946020939093013593505050565b60008060006060848603121561089257600080fd5b61089b84610837565b92506108a960208501610837565b9150604084013590509250925092565b6000602082840312156108cb57600080fd5b6108d482610837565b9392505050565b600080604083850312156108ee57600080fd5b6108f783610837565b915061090560208401610837565b90509250929050565b600181811c9082168061092257607f821691505b60208210810361094257634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561095a57600080fd5b5051919050565b8181038181111561033857634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6000602082840312156109aa57600080fd5b815167ffffffffffffffff808211156109c257600080fd5b818401915084601f8301126109d657600080fd5b8151818111156109e8576109e8610982565b604051601f8201601f19908116603f01168101908382118183101715610a1057610a10610982565b81604052828152876020848701011115610a2957600080fd5b610a3a8360208301602088016107e0565b979650505050505050565b68026b7b737b634ba34160bd1b815260008251610a698160098501602087016107e0565b670811195c1bdcda5d60c21b6009939091019283015250601101919050565b601f821115610ad257600081815260208120601f850160051c81016020861015610aaf5750805b601f850160051c820191505b81811015610ace57828155600101610abb565b5050505b505050565b815167ffffffffffffffff811115610af157610af1610982565b610b0581610aff845461090e565b84610a88565b602080601f831160018114610b3a5760008415610b225750858301515b600019600386901b1c1916600185901b178555610ace565b600085815260208120601f198616915b82811015610b6957888601518255948401946001909101908401610b4a565b5085821015610b875787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b626d6f2d60e81b815260008251610bb58160038501602087016107e0565b9190910160030192915050565b600060208284031215610bd457600080fd5b815180151581146108d457600080fdfea164736f6c6343000810000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.