Contract Overview
Balance:
0 MATIC
MATIC Value:
$0.00
My Name Tag:
Not Available, login to update
Txn Hash |
Method
|
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0xbd6f98dc013e18aa657bcbc2a1c634f5163c498011cf8ba9c0083fc0066cc120 | 0x60806040 | 16875076 | 565 days 18 hrs ago | 0xb0dd96118594903bacb2746eb228550c10b2b1da | IN | Create: TransferLogic | 0 MATIC | 0.000385301038 |
[ Download CSV Export ]
Contract Name:
TransferLogic
Compiler Version
v0.8.4+commit.c7e474f2
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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); /** * @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); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title RegistryInterface Interface */ interface IRegistry { function logic(address logicAddr) external view returns (bool); function implementation(bytes32 key) external view returns (address); function notAllowed(address erc20) external view returns (bool); function deployWallet() external returns (address); function wallets(address user) external view returns (address); function getFee() external view returns (uint256); function feeRecipient() external view returns (address); function memoryAddr() external view returns (address); function distributionContract(address token) external view returns (address); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IWallet { event LogMint(address indexed erc20, uint256 tokenAmt); event LogRedeem(address indexed erc20, uint256 tokenAmt); event LogBorrow(address indexed erc20, uint256 tokenAmt); event LogPayback(address indexed erc20, uint256 tokenAmt); event LogDeposit(address indexed erc20, uint256 tokenAmt); event LogWithdraw(address indexed erc20, uint256 tokenAmt); event LogSwap(address indexed src, address indexed dest, uint256 amount); event LogLiquidityAdd( address indexed tokenA, address indexed tokenB, uint256 amountA, uint256 amountB ); event LogLiquidityRemove( address indexed tokenA, address indexed tokenB, uint256 amountA, uint256 amountB ); event VaultDeposit(address indexed erc20, uint256 tokenAmt); event VaultWithdraw(address indexed erc20, uint256 tokenAmt); event VaultClaim(address indexed erc20, uint256 tokenAmt); event DelegateAdded(address delegate); event DelegateRemoved(address delegate); function executeMetaTransaction(bytes memory sign, bytes memory data) external; function execute(address[] calldata targets, bytes[] calldata datas) external payable; function owner() external view returns (address); function registry() external view returns (address); function DELEGATE_ROLE() external view returns (bytes32); function hasRole(bytes32, address) external view returns (bool); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/IRegistry.sol"; import "../interfaces/IWallet.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract TransferLogic { event LogDeposit(address indexed erc20, uint256 tokenAmt); event LogWithdraw(address indexed erc20, uint256 tokenAmt); /** * @dev get ethereum address */ function getAddressETH() public pure returns (address eth) { eth = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; } /** * @dev Deposit ERC20 from user * @dev user must approve token transfer first */ function deposit(address erc20, uint256 amount) external payable { require(amount > 0, "ZERO-AMOUNT"); if (erc20 != getAddressETH()) { IERC20(erc20).transferFrom(msg.sender, address(this), amount); } emit LogDeposit(erc20, amount); } /** * @dev Withdraw ETH/ERC20 to user */ function withdraw(address erc20, uint256 amount) external { address registry = IWallet(address(this)).registry(); require( !IRegistry(registry).notAllowed(erc20), "Token withdraw not allowed" ); if (erc20 == getAddressETH()) { payable(msg.sender).transfer(amount); } else { IERC20(erc20).transfer(msg.sender, amount); } emit LogWithdraw(erc20, amount); } /** * @dev Remove ERC20 approval to certain target */ function removeApproval(address erc20, address target) external { if (erc20 != getAddressETH()) { IERC20(erc20).approve(target, 0); } } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc20","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmt","type":"uint256"}],"name":"LogDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"erc20","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmt","type":"uint256"}],"name":"LogWithdraw","type":"event"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getAddressETH","outputs":[{"internalType":"address","name":"eth","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"},{"internalType":"address","name":"target","type":"address"}],"name":"removeApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"erc20","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50610602806100206000396000f3fe60806040526004361061003f5760003560e01c80633eda43701461004457806347e7ef2414610066578063ab1be68614610079578063f3fef3a3146100ad575b600080fd5b34801561005057600080fd5b5061006461005f366004610531565b6100cd565b005b610064610074366004610569565b610179565b34801561008557600080fd5b506040805173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee815290519081900360200190f35b3480156100b957600080fd5b506100646100c8366004610569565b6102af565b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146101755760405163095ea7b360e01b81526001600160a01b0382811660048301526000602483015283169063095ea7b390604401602060405180830381600087803b15801561013b57600080fd5b505af115801561014f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101739190610594565b505b5050565b600081116101bc5760405162461bcd60e51b815260206004820152600b60248201526a16915493cb505353d5539560aa1b60448201526064015b60405180910390fd5b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610268576040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038316906323b872dd90606401602060405180830381600087803b15801561022e57600080fd5b505af1158015610242573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102669190610594565b505b816001600160a01b03167f1b851e1031ef35a238e6c67d0c7991162390df915f70eaf9098dbf0b175a6198826040516102a391815260200190565b60405180910390a25050565b6000306001600160a01b0316637b1039996040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ea57600080fd5b505afa1580156102fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610322919061050e565b604051630ca8c2b560e21b81526001600160a01b038581166004830152919250908216906332a30ad49060240160206040518083038186803b15801561036757600080fd5b505afa15801561037b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061039f9190610594565b156103ec5760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e207769746864726177206e6f7420616c6c6f77656400000000000060448201526064016101b3565b6001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561044457604051339083156108fc029084906000818181858888f1935050505015801561043e573d6000803e3d6000fd5b506104c6565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb90604401602060405180830381600087803b15801561048c57600080fd5b505af11580156104a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c49190610594565b505b826001600160a01b03167f4ce7033d118120e254016dccf195288400b28fc8936425acd5f17ce2df3ab7088360405161050191815260200190565b60405180910390a2505050565b60006020828403121561051f578081fd5b815161052a816105b4565b9392505050565b60008060408385031215610543578081fd5b823561054e816105b4565b9150602083013561055e816105b4565b809150509250929050565b6000806040838503121561057b578182fd5b8235610586816105b4565b946020939093013593505050565b6000602082840312156105a5578081fd5b8151801515811461052a578182fd5b6001600160a01b03811681146105c957600080fd5b5056fea2646970667358221220a066f255d1b2fb66b8b756b00c1fb193d9dcf54f2268b58015d2f7d6675f78df64736f6c63430008040033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.