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] | |||
---|---|---|---|---|---|---|---|---|---|
0xf1afd312f1e80bccbac7d6a6a9c0d3d4416240a09a53af892aa2c3fbff1d4b8a | 0x60a06040 | 23599148 | 501 days 14 hrs ago | 0x1d075f1f543bb09df4530f44ed21ca50303a65b2 | IN | Create: TokenFactory | 0 MATIC | 0.04027752 |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
TokenFactory
Compiler Version
v0.8.7+commit.e28d00a7
Contract Source Code (Solidity)
/** *Submitted for verification at polygonscan.com on 2022-01-11 */ pragma solidity 0.8.7; // SPDX-License-Identifier: MIT /** * @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 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) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @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); } /** * @dev Implementation of the {IERC20} interface. */ contract ERC20 is Context, IERC20 { mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowances; uint256 internal _totalSupply; string public name; string public symbol; uint8 public decimals; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } } contract ERC20Mintable is ERC20 { address internal owner; function mint(address to, uint256 amount) external { require(msg.sender == owner); _mint(to, amount); } function burn(address from, uint256 amount) external { require(msg.sender == owner); _burn(from, amount); } function init(address _owner, string calldata _name, string calldata _symbol, uint8 _decimals) external { require(owner == address(0)); owner = _owner; name = _name; symbol = _symbol; decimals = _decimals; } } contract TokenFactory { address immutable template; event NewTokenCreated(address owner, address token); function newToken(address _owner, string calldata _name, string calldata _symbol, uint8 _decimals) external returns (address token) { token = createClone(template); ERC20Mintable(token).init(_owner, _name, _symbol, _decimals); emit NewTokenCreated(_owner, token); } function createClone(address target) internal returns (address result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create(0, clone, 0x37) } } constructor() { ERC20Mintable instance = new ERC20Mintable(); template = address(instance); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"NewTokenCreated","type":"event"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"}],"name":"newToken","outputs":[{"internalType":"address","name":"token","type":"address"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b50600060405161001f90610052565b604051809103906000f08015801561003b573d6000803e3d6000fd5b5060601b6001600160601b0319166080525061005f565b610f218061043e83390190565b60805160601c6103c261007c6000396000607301526103c26000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063a68c79a114610030575b600080fd5b61004361003e366004610235565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b60006100977f0000000000000000000000000000000000000000000000000000000000000000610183565b6040517f3bf7379800000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff821690633bf73798906100f6908a908a908a908a908a908a90600401610332565b600060405180830381600087803b15801561011057600080fd5b505af1158015610124573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff808c168252851660208201527ff859fae2644f153745fbb42fe7fcdd7212ecb3cafdfb1a52e33cf8974e150dac935001905060405180910390a19695505050505050565b6000808260601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f0949350505050565b60008083601f8401126101fe57600080fd5b50813567ffffffffffffffff81111561021657600080fd5b60208301915083602082850101111561022e57600080fd5b9250929050565b6000806000806000806080878903121561024e57600080fd5b863573ffffffffffffffffffffffffffffffffffffffff8116811461027257600080fd5b9550602087013567ffffffffffffffff8082111561028f57600080fd5b61029b8a838b016101ec565b909750955060408901359150808211156102b457600080fd5b506102c189828a016101ec565b909450925050606087013560ff811681146102db57600080fd5b809150509295509295509295565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff871681526080602082015260006103626080830187896102e9565b82810360408401526103758186886102e9565b91505060ff8316606083015297965050505050505056fea264697066735822122008515460c1a52c0b27613cbb95171104b246d521c7a9bfefec6f11b12d09f19164736f6c63430008070033608060405234801561001057600080fd5b50610f01806100206000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f19116100815780639dc29fac1161005b5780639dc29fac146101c4578063a9059cbb146101d7578063dd62ed3e146101ea57600080fd5b806340c10f191461017357806370a082311461018657806395d89b41146101bc57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f5780633bf737981461015e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610230565b6040516100ee9190610da6565b60405180910390f35b61010a610105366004610d7c565b6102be565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a366004610ca7565b6102d4565b60055461014c9060ff1681565b60405160ff90911681526020016100ee565b61017161016c366004610ce3565b6103bf565b005b610171610181366004610d7c565b61047e565b61011e610194366004610c52565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6100e16104b5565b6101716101d2366004610d7c565b6104c2565b61010a6101e5366004610d7c565b6104f5565b61011e6101f8366004610c74565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6003805461023d90610e48565b80601f016020809104026020016040519081016040528092919081815260200182805461026990610e48565b80156102b65780601f1061028b576101008083540402835291602001916102b6565b820191906000526020600020905b81548152906001019060200180831161029957829003601f168201915b505050505081565b60006102cb338484610502565b50600192915050565b60006102e18484846106b6565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600160209081526040808320338452909152902054828110156103a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103b48533858403610502565b506001949350505050565b600554610100900473ffffffffffffffffffffffffffffffffffffffff16156103e757600080fd5b600580547fffffffffffffffffffffff0000000000000000000000000000000000000000ff1661010073ffffffffffffffffffffffffffffffffffffffff89160217905561043760038686610b29565b5061044460048484610b29565b50600580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff929092169190911790555050505050565b600554610100900473ffffffffffffffffffffffffffffffffffffffff1633146104a757600080fd5b6104b18282610824565b5050565b6004805461023d90610e48565b600554610100900473ffffffffffffffffffffffffffffffffffffffff1633146104eb57600080fd5b6104b18282610944565b60006102cb3384846106b6565b73ffffffffffffffffffffffffffffffffffffffff83166105a4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161039e565b73ffffffffffffffffffffffffffffffffffffffff8216610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161039e565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020548181101561076c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161039e565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152602081905260408082208585039055918516815290812080548492906107b0908490610e19565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161081691815260200190565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff82166108a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161039e565b80600260008282546108b39190610e19565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040812080548392906108ed908490610e19565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff82166109e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161039e565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015610a9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161039e565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260408120838303905560028054849290610ad9908490610e31565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016106a9565b828054610b3590610e48565b90600052602060002090601f016020900481019282610b575760008555610bbb565b82601f10610b8e578280017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00823516178555610bbb565b82800160010185558215610bbb579182015b82811115610bbb578235825591602001919060010190610ba0565b50610bc7929150610bcb565b5090565b5b80821115610bc75760008155600101610bcc565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c0457600080fd5b919050565b60008083601f840112610c1b57600080fd5b50813567ffffffffffffffff811115610c3357600080fd5b602083019150836020828501011115610c4b57600080fd5b9250929050565b600060208284031215610c6457600080fd5b610c6d82610be0565b9392505050565b60008060408385031215610c8757600080fd5b610c9083610be0565b9150610c9e60208401610be0565b90509250929050565b600080600060608486031215610cbc57600080fd5b610cc584610be0565b9250610cd360208501610be0565b9150604084013590509250925092565b60008060008060008060808789031215610cfc57600080fd5b610d0587610be0565b9550602087013567ffffffffffffffff80821115610d2257600080fd5b610d2e8a838b01610c09565b90975095506040890135915080821115610d4757600080fd5b50610d5489828a01610c09565b909450925050606087013560ff81168114610d6e57600080fd5b809150509295509295509295565b60008060408385031215610d8f57600080fd5b610d9883610be0565b946020939093013593505050565b600060208083528351808285015260005b81811015610dd357858101830151858201604001528201610db7565b81811115610de5576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60008219821115610e2c57610e2c610e9c565b500190565b600082821015610e4357610e43610e9c565b500390565b600181811c90821680610e5c57607f821691505b60208210811415610e96577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122038bd529e33f821b7049c0392a9d79ba386297fd932fa9a4d2d48929a30bd1f9a64736f6c63430008070033
Deployed ByteCode Sourcemap
9897:1050:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10021:297;;;;;;:::i;:::-;;:::i;:::-;;;1963:42:1;1951:55;;;1933:74;;1921:2;1906:18;10021:297:0;;;;;;;;10138:13;10172:21;10184:8;10172:11;:21::i;:::-;10204:60;;;;;10164:29;;-1:-1:-1;10204:25:0;;;;;;:60;;10230:6;;10238:5;;;;10245:7;;;;10254:9;;10204:60;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;10280:30:0;;;2202:42:1;2271:15;;;2253:34;;2323:15;;2318:2;2303:18;;2296:43;10280:30:0;;-1:-1:-1;2165:18:1;;-1:-1:-1;10280:30:0;;;;;;;10021:297;;;;;;;;:::o;10326:494::-;10381:14;10408:19;10438:6;10430:15;;10408:37;;10499:4;10493:11;10532:66;10525:5;10518:81;10638:11;10631:4;10624:5;10620:16;10613:37;10689:66;10682:4;10675:5;10671:16;10664:92;10797:4;10790:5;10787:1;10780:22;10770:32;10326:494;-1:-1:-1;;;;10326:494:0:o;14:348:1:-;66:8;76:6;130:3;123:4;115:6;111:17;107:27;97:55;;148:1;145;138:12;97:55;-1:-1:-1;171:20:1;;214:18;203:30;;200:50;;;246:1;243;236:12;200:50;283:4;275:6;271:17;259:29;;335:3;328:4;319:6;311;307:19;303:30;300:39;297:59;;;352:1;349;342:12;297:59;14:348;;;;;:::o;367:1084::-;475:6;483;491;499;507;515;568:3;556:9;547:7;543:23;539:33;536:53;;;585:1;582;575:12;536:53;624:9;611:23;674:42;667:5;663:54;656:5;653:65;643:93;;732:1;729;722:12;643:93;755:5;-1:-1:-1;811:2:1;796:18;;783:32;834:18;864:14;;;861:34;;;891:1;888;881:12;861:34;930:59;981:7;972:6;961:9;957:22;930:59;:::i;:::-;1008:8;;-1:-1:-1;904:85:1;-1:-1:-1;1096:2:1;1081:18;;1068:32;;-1:-1:-1;1112:16:1;;;1109:36;;;1141:1;1138;1131:12;1109:36;;1180:61;1233:7;1222:8;1211:9;1207:24;1180:61;:::i;:::-;1260:8;;-1:-1:-1;1154:87:1;-1:-1:-1;;1347:2:1;1332:18;;1319:32;1395:4;1382:18;;1370:31;;1360:59;;1415:1;1412;1405:12;1360:59;1438:7;1428:17;;;367:1084;;;;;;;;:::o;1456:326::-;1545:6;1540:3;1533:19;1597:6;1590:5;1583:4;1578:3;1574:14;1561:43;;1649:1;1642:4;1633:6;1628:3;1624:16;1620:27;1613:38;1515:3;1771:4;1701:66;1696:2;1688:6;1684:15;1680:88;1675:3;1671:98;1667:109;1660:116;;1456:326;;;;:::o;2350:637::-;2631:42;2623:6;2619:55;2608:9;2601:74;2711:3;2706:2;2695:9;2691:18;2684:31;2582:4;2738:63;2796:3;2785:9;2781:19;2773:6;2765;2738:63;:::i;:::-;2849:9;2841:6;2837:22;2832:2;2821:9;2817:18;2810:50;2877;2920:6;2912;2904;2877:50;:::i;:::-;2869:58;;;2975:4;2967:6;2963:17;2958:2;2947:9;2943:18;2936:45;2350:637;;;;;;;;;:::o
Swarm Source
ipfs://38bd529e33f821b7049c0392a9d79ba386297fd932fa9a4d2d48929a30bd1f9a
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.