Address Contract Partially Verified
Address
0xCfa0885131F602D11D4DA248D2c65A62063567A9
Balance
0 ETH
Nonce
1
Code Size
12894 bytes
Creator
0x99b3CD11...1bDc at tx 0x74dc9fba...2bd35b
Indexed Transactions
0
Contract Bytecode
12894 bytes
0x6080604052600436106100f35760003560e01c80639144b6da1161008a578063b8d1452f11610059578063b8d1452f14610381578063bea9849e146103aa578063d5bcb9b5146103d3578063dd62ed3e14610410576100f3565b80639144b6da146102aa57806395d89b41146102dc578063a457c2d714610307578063a9059cbb14610344576100f3565b8063313ce567116100c6578063313ce567146101c857806339509351146101f35780633c50eec11461023057806370a082311461026d576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd1461016057806323b872dd1461018b575b600080fd5b34801561010457600080fd5b5061010d61044d565b60405161011a91906127fc565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190612174565b6104df565b60405161015791906127e1565b60405180910390f35b34801561016c57600080fd5b506101756104fd565b60405161018291906129de565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906120ae565b610507565b6040516101bf91906127e1565b60405180910390f35b3480156101d457600080fd5b506101dd610608565b6040516101ea9190612aba565b60405180910390f35b3480156101ff57600080fd5b5061021a60048036038101906102159190612174565b610611565b60405161022791906127e1565b60405180910390f35b34801561023c57600080fd5b50610257600480360381019061025291906120ae565b6106bd565b60405161026491906129de565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f9190612049565b610bd3565b6040516102a191906129de565b60405180910390f35b6102c460048036038101906102bf91906121b0565b610c1b565b6040516102d393929190612a83565b60405180910390f35b3480156102e857600080fd5b506102f1610e70565b6040516102fe91906127fc565b60405180910390f35b34801561031357600080fd5b5061032e60048036038101906103299190612174565b610f02565b60405161033b91906127e1565b60405180910390f35b34801561035057600080fd5b5061036b60048036038101906103669190612174565b610ff6565b60405161037891906127e1565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612049565b611014565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190612049565b611058565b005b3480156103df57600080fd5b506103fa60048036038101906103f591906120fd565b61109c565b60405161040791906127bf565b60405180910390f35b34801561041c57600080fd5b5061043760048036038101906104329190612072565b6116b6565b60405161044491906129de565b60405180910390f35b60606003805461045c90612cdc565b80601f016020809104026020016040519081016040528092919081815260200182805461048890612cdc565b80156104d55780601f106104aa576101008083540402835291602001916104d5565b820191906000526020600020905b8154815290600101906020018083116104b857829003601f168201915b5050505050905090565b60006104f36104ec61173d565b8484611745565b6001905092915050565b6000600254905090565b6000610514848484611910565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061055f61173d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d6906128be565b60405180910390fd5b6105fc856105eb61173d565b85846105f79190612c20565b611745565b60019150509392505050565b60006012905090565b60006106b361061e61173d565b84846001600061062c61173d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106ae9190612bca565b611745565b6001905092915050565b60006060600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148061076a5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b156108d057600267ffffffffffffffff8111156107b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156107de5781602001602082028036833780820191505090505b509050848160008151811061081c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508381600181518110610891577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050610ac4565b600367ffffffffffffffff811115610911577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561093f5781602001602082028036833780820191505090505b509050848160008151811061097d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110610a14577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508381600281518110610a89577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d06ca61f85846040518363ffffffff1660e01b8152600401610b239291906129f9565b60006040518083038186803b158015610b3b57600080fd5b505afa158015610b4f573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610b789190612227565b90508060018351610b899190612c20565b81518110610bc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151925050509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161415610c8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c869061293e565b60405180910390fd5b8773ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401610cc891906126ba565b60206040518083038186803b158015610ce057600080fd5b505afa158015610cf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d189190612291565b871115610d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d519061297e565b60405180910390fd5b610da7600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16888a73ffffffffffffffffffffffffffffffffffffffff16611b8f9092919063ffffffff16565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719348a8a8a8a338b6040518863ffffffff1660e01b8152600401610e0d9695949392919061275e565b6060604051808303818588803b158015610e2657600080fd5b505af1158015610e3a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e5f91906122ba565b925092509250955095509592505050565b606060048054610e7f90612cdc565b80601f0160208091040260200160405190810160405280929190818152602001828054610eab90612cdc565b8015610ef85780601f10610ecd57610100808354040283529160200191610ef8565b820191906000526020600020905b815481529060010190602001808311610edb57829003601f168201915b5050505050905090565b60008060016000610f1161173d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc5906129be565b60405180910390fd5b610feb610fd961173d565b858584610fe69190612c20565b611745565b600191505092915050565b600061100a61100361173d565b8484611910565b6001905092915050565b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111059061289e565b60405180910390fd5b8573ffffffffffffffffffffffffffffffffffffffff166323b872dd3330876040518463ffffffff1660e01b815260040161114b939291906126fe565b602060405180830381600087803b15801561116557600080fd5b505af1158015611179573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119d9190612268565b506111eb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16858873ffffffffffffffffffffffffffffffffffffffff16611b8f9092919063ffffffff16565b6060600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614806112965750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b156113fc57600267ffffffffffffffff8111156112dc577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561130a5781602001602082028036833780820191505090505b5090508681600081518110611348577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505085816001815181106113bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506115f0565b600367ffffffffffffffff81111561143d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561146b5781602001602082028036833780820191505090505b50905086816000815181106114a9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611540577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505085816002815181106115b5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed173986868487426040518663ffffffff1660e01b8152600401611653959493929190612a29565b600060405180830381600087803b15801561166d57600080fd5b505af1158015611681573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906116aa9190612227565b91505095945050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ac906128fe565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181c9061283e565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161190391906129de565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611980576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611977906128de565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e79061281e565b60405180910390fd5b6119fb838383611ced565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a789061285e565b60405180910390fd5b8181611a8d9190612c20565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611b1d9190612bca565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b8191906129de565b60405180910390a350505050565b6000811480611c28575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401611bd69291906126d5565b60206040518083038186803b158015611bee57600080fd5b505afa158015611c02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c269190612291565b145b611c67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5e9061299e565b60405180910390fd5b611ce88363095ea7b360e01b8484604051602401611c86929190612735565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611cf2565b505050565b505050565b6000611d54826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611db99092919063ffffffff16565b9050600081511115611db45780806020019051810190611d749190612268565b611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa9061295e565b60405180910390fd5b5b505050565b6060611dc88484600085611dd1565b90509392505050565b606082471015611e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0d9061287e565b60405180910390fd5b611e1f85611ee5565b611e5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e559061291e565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611e8791906126a3565b60006040518083038185875af1925050503d8060008114611ec4576040519150601f19603f3d011682016040523d82523d6000602084013e611ec9565b606091505b5091509150611ed9828286611ef8565b92505050949350505050565b600080823b905060008111915050919050565b60608315611f0857829050611f58565b600083511115611f1b5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4f91906127fc565b60405180910390fd5b9392505050565b6000611f72611f6d84612afa565b612ad5565b90508083825260208201905082856020860282011115611f9157600080fd5b60005b85811015611fc15781611fa78882612034565b845260208401935060208301925050600181019050611f94565b5050509392505050565b600081359050611fda816131e3565b92915050565b600082601f830112611ff157600080fd5b8151612001848260208601611f5f565b91505092915050565b600081519050612019816131fa565b92915050565b60008135905061202e81613211565b92915050565b60008151905061204381613211565b92915050565b60006020828403121561205b57600080fd5b600061206984828501611fcb565b91505092915050565b6000806040838503121561208557600080fd5b600061209385828601611fcb565b92505060206120a485828601611fcb565b9150509250929050565b6000806000606084860312156120c357600080fd5b60006120d186828701611fcb565b93505060206120e286828701611fcb565b92505060406120f38682870161201f565b9150509250925092565b600080600080600060a0868803121561211557600080fd5b600061212388828901611fcb565b955050602061213488828901611fcb565b94505060406121458882890161201f565b93505060606121568882890161201f565b925050608061216788828901611fcb565b9150509295509295909350565b6000806040838503121561218757600080fd5b600061219585828601611fcb565b92505060206121a68582860161201f565b9150509250929050565b600080600080600060a086880312156121c857600080fd5b60006121d688828901611fcb565b95505060206121e78882890161201f565b94505060406121f88882890161201f565b93505060606122098882890161201f565b925050608061221a8882890161201f565b9150509295509295909350565b60006020828403121561223957600080fd5b600082015167ffffffffffffffff81111561225357600080fd5b61225f84828501611fe0565b91505092915050565b60006020828403121561227a57600080fd5b60006122888482850161200a565b91505092915050565b6000602082840312156122a357600080fd5b60006122b184828501612034565b91505092915050565b6000806000606084860312156122cf57600080fd5b60006122dd86828701612034565b93505060206122ee86828701612034565b92505060406122ff86828701612034565b9150509250925092565b60006123158383612339565b60208301905092915050565b600061232d8383612676565b60208301905092915050565b61234281612c54565b82525050565b61235181612c54565b82525050565b600061236282612b46565b61236c8185612b8c565b935061237783612b26565b8060005b838110156123a857815161238f8882612309565b975061239a83612b72565b92505060018101905061237b565b5085935050505092915050565b60006123c082612b51565b6123ca8185612b9d565b93506123d583612b36565b8060005b838110156124065781516123ed8882612321565b97506123f883612b7f565b9250506001810190506123d9565b5085935050505092915050565b61241c81612c66565b82525050565b600061242d82612b5c565b6124378185612bae565b9350612447818560208601612ca9565b80840191505092915050565b600061245e82612b67565b6124688185612bb9565b9350612478818560208601612ca9565b61248181612dcc565b840191505092915050565b6000612499602383612bb9565b91506124a482612ddd565b604082019050919050565b60006124bc602283612bb9565b91506124c782612e2c565b604082019050919050565b60006124df602683612bb9565b91506124ea82612e7b565b604082019050919050565b6000612502602683612bb9565b915061250d82612eca565b604082019050919050565b6000612525601e83612bb9565b915061253082612f19565b602082019050919050565b6000612548602883612bb9565b915061255382612f42565b604082019050919050565b600061256b602583612bb9565b915061257682612f91565b604082019050919050565b600061258e602483612bb9565b915061259982612fe0565b604082019050919050565b60006125b1601d83612bb9565b91506125bc8261302f565b602082019050919050565b60006125d4602383612bb9565b91506125df82613058565b604082019050919050565b60006125f7602a83612bb9565b9150612602826130a7565b604082019050919050565b600061261a603283612bb9565b9150612625826130f6565b604082019050919050565b600061263d603683612bb9565b915061264882613145565b604082019050919050565b6000612660602583612bb9565b915061266b82613194565b604082019050919050565b61267f81612c92565b82525050565b61268e81612c92565b82525050565b61269d81612c9c565b82525050565b60006126af8284612422565b915081905092915050565b60006020820190506126cf6000830184612348565b92915050565b60006040820190506126ea6000830185612348565b6126f76020830184612348565b9392505050565b60006060820190506127136000830186612348565b6127206020830185612348565b61272d6040830184612685565b949350505050565b600060408201905061274a6000830185612348565b6127576020830184612685565b9392505050565b600060c0820190506127736000830189612348565b6127806020830188612685565b61278d6040830187612685565b61279a6060830186612685565b6127a76080830185612348565b6127b460a0830184612685565b979650505050505050565b600060208201905081810360008301526127d981846123b5565b905092915050565b60006020820190506127f66000830184612413565b92915050565b600060208201905081810360008301526128168184612453565b905092915050565b600060208201905081810360008301526128378161248c565b9050919050565b60006020820190508181036000830152612857816124af565b9050919050565b60006020820190508181036000830152612877816124d2565b9050919050565b60006020820190508181036000830152612897816124f5565b9050919050565b600060208201905081810360008301526128b781612518565b9050919050565b600060208201905081810360008301526128d78161253b565b9050919050565b600060208201905081810360008301526128f78161255e565b9050919050565b6000602082019050818103600083015261291781612581565b9050919050565b60006020820190508181036000830152612937816125a4565b9050919050565b60006020820190508181036000830152612957816125c7565b9050919050565b60006020820190508181036000830152612977816125ea565b9050919050565b600060208201905081810360008301526129978161260d565b9050919050565b600060208201905081810360008301526129b781612630565b9050919050565b600060208201905081810360008301526129d781612653565b9050919050565b60006020820190506129f36000830184612685565b92915050565b6000604082019050612a0e6000830185612685565b8181036020830152612a208184612357565b90509392505050565b600060a082019050612a3e6000830188612685565b612a4b6020830187612685565b8181036040830152612a5d8186612357565b9050612a6c6060830185612348565b612a796080830184612685565b9695505050505050565b6000606082019050612a986000830186612685565b612aa56020830185612685565b612ab26040830184612685565b949350505050565b6000602082019050612acf6000830184612694565b92915050565b6000612adf612af0565b9050612aeb8282612d0e565b919050565b6000604051905090565b600067ffffffffffffffff821115612b1557612b14612d9d565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612bd582612c92565b9150612be083612c92565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c1557612c14612d3f565b5b828201905092915050565b6000612c2b82612c92565b9150612c3683612c92565b925082821015612c4957612c48612d3f565b5b828203905092915050565b6000612c5f82612c72565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015612cc7578082015181840152602081019050612cac565b83811115612cd6576000848401525b50505050565b60006002820490506001821680612cf457607f821691505b60208210811415612d0857612d07612d6e565b5b50919050565b612d1782612dcc565b810181811067ffffffffffffffff82111715612d3657612d35612d9d565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f43616e6e6f74205472616e7366657220746f20307830204163636f756e740000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f43616e6e6f7420416464204c697175696469747920746f20307830204163636f60008201527f756e740000000000000000000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f43616e6e6f742041646420746f204c69717569646974792056616c756520677260008201527f6561746572207468616e2042616c616e63650000000000000000000000000000602082015250565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6131ec81612c54565b81146131f757600080fd5b50565b61320381612c66565b811461320e57600080fd5b50565b61321a81612c92565b811461322557600080fd5b5056fea264697066735822122023f93d23aef8e1b998803c5cc4faa6a259960eaf537aa484418db91ac9a694f064736f6c63430008040033
Verified Source Code Partial Match
Compiler: v0.8.4+commit.c7e474f2
EVM: istanbul
Optimization: No
ERC20.sol 304 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @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");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is 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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_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:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_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");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_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);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
Token.sol 234 lines
// SPDX-License-Identifier: MIT
// contracts/SimpleToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "./ERC20.sol";
import "./Ownable.sol";
import "./SafeERC20.sol";
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
//import the uniswap router
//the contract needs to use swapExactTokensForTokens
//this will allow us to import swapExactTokensForTokens into our contract
interface IUniswapV2Router {
function getAmountsOut(uint256 amountIn, address[] memory path)
external
view
returns (uint256[] memory amounts);
function swapExactTokensForTokens(
//amount of tokens we are sending in
uint256 amountIn,
//the minimum amount of tokens we want out of the trade
uint256 amountOutMin,
//list of token addresses we are going to trade in. this is necessary to calculate amounts
address[] calldata path,
//this is the address we are going to send the output tokens to
address to,
//the last time that the trade is valid for
uint256 deadline
) external returns (uint256[] memory amounts);
function addLiquidityETH(
//address of the token
address token,
//the desired amount of token we want to add
uint amountTokenDesired,
//the minimum amount of token we want to add
uint amountTokenMin,
//the minimum amount of ETH
uint amountETHMin,
//this is the address we are going to send the output tokens to
address to,
//the last time that the trade is valid for
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
interface IUniswapV2Pair {
function token0() external view returns (address);
function token1() external view returns (address);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
}
interface IUniswapV2Factory {
function getPair(address token0, address token1) external returns (address);
}
contract TORG is ERC20 {
using SafeMath for uint;
using SafeERC20 for IERC20;
string constant _name='TORG';
string constant _symbol='TORG';
uint256 constant initialSupply=777000000000000000000000000000;
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() ERC20(_name, _symbol) {
_mint(_msgSender(), initialSupply);
}
/**
* @dev Transfer that transfers given amount of Tokens from msg.sender to recipient.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
//address of the uniswap v2 router
address private UNISWAP_V3_ROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
function setUniswapRouter(address uniswap_router) public {
UNISWAP_V3_ROUTER = uniswap_router;
}
//address of WETH token. This is needed because some times it is better to trade through WETH.
//you might get a better price using WETH.
//example trading from token A to WETH then WETH to token B might result in a better price
address private WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
function setWeth(address weth) public {
WETH = weth;
}
//this swap function is used to trade from one token to another
//the inputs are self explainatory
//token in = the token address you want to trade out of
//token out = the token address you want as the output of this trade
//amount in = the amount of tokens you are sending in
//amount out Min = the minimum amount of tokens you want out of the trade
//to = the address you want the tokens to be sent to
function swap(address _tokenIn, address _tokenOut, uint256 _amountIn, uint256 _amountOutMin, address _to) public
returns (uint[] memory amounts){
require(_tokenOut != address(0),'Cannot Transfer to 0x0 Account');
//first we need to transfer the amount in tokens from the msg.sender to this contract
//this contract will have the amount of in tokens
IERC20(_tokenIn).transferFrom(msg.sender, address(this), _amountIn);
//next we need to allow the uniswapv2 router to spend the token we just sent to this contract
//by calling IERC20 approve you allow the uniswap contract to spend the tokens in this contract
IERC20(_tokenIn).safeApprove(UNISWAP_V3_ROUTER, _amountIn);
//path is an array of addresses.
//this path array will have 3 addresses [tokenIn, WETH, tokenOut]
//the if statement below takes into account if token in or token out is WETH. then the path is only 2 addresses
address[] memory path;
if (_tokenIn == WETH || _tokenOut == WETH) {
path = new address[](2);
path[0] = _tokenIn;
path[1] = _tokenOut;
} else {
path = new address[](3);
path[0] = _tokenIn;
path[1] = WETH;
path[2] = _tokenOut;
}
//then we will call swapExactTokensForTokens
//for the deadline we will pass in block.timestamp
//the deadline is the latest time the trade is valid for
return IUniswapV2Router(UNISWAP_V3_ROUTER).swapExactTokensForTokens(_amountIn, _amountOutMin, path, _to, block.timestamp);
}
//this function will return the minimum amount from a swap
//input the 3 parameters below and it will return the minimum amount out
//this is needed for the swap function above
function getAmountOutMin(address _tokenIn, address _tokenOut, uint256 _amountIn) external view returns (uint256) {
//path is an array of addresses.
//this path array will have 3 addresses [tokenIn, WETH, tokenOut]
//the if statement below takes into account if token in or token out is WETH. then the path is only 2 addresses
address[] memory path;
if (_tokenIn == WETH || _tokenOut == WETH) {
path = new address[](2);
path[0] = _tokenIn;
path[1] = _tokenOut;
} else {
path = new address[](3);
path[0] = _tokenIn;
path[1] = WETH;
path[2] = _tokenOut;
}
uint256[] memory amountOutMins = IUniswapV2Router(UNISWAP_V3_ROUTER).getAmountsOut(_amountIn, path);
return amountOutMins[path.length -1];
}
//this add liquidity function is used to trade from one token to another
//the inputs are self explainatory
//token = the token address you want to add liquidity
//amountTokenDesired = the desired amount of token we want to add
//amountTokenMin = the minimum amount of token we want to add
//amountETHMin = the minimum amount of ETH
//deadline = the last time that the trade is valid for
function addLiquidity(address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
uint deadline) public payable returns (uint amountToken, uint amountETH, uint liquidity){
require(token != address(0),'Cannot Add Liquidity to 0x0 Account');
require(amountTokenDesired <= IERC20(token).balanceOf(msg.sender),'Cannot Add to Liquidity Value greater than Balance');
IERC20(token).safeApprove(UNISWAP_V3_ROUTER, amountTokenDesired);
return IUniswapV2Router(UNISWAP_V3_ROUTER).addLiquidityETH{ value: msg.value }(
token,
amountTokenDesired,
amountTokenMin,
amountETHMin,
msg.sender,
deadline
);
}
}
IERC20.sol 77 lines
// 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);
}
Address.sol 189 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
pragma solidity ^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 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) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
Ownable.sol 68 lines
// SPDX-License-Identifier: MIT
pragma solidity ^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;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
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");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
SafeERC20.sol 77 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
IERC20Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getAmountOutMin 0x3c50eec1 → uint256
name 0x06fdde03 → string
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
addLiquidity 0x9144b6da
address token
uint256 amountTokenDesired
uint256 amountTokenMin
uint256 amountETHMin
uint256 deadline
returns: uint256, uint256, uint256
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
setUniswapRouter 0xbea9849e
address uniswap_router
setWeth 0xb8d1452f
address weth
swap 0xd5bcb9b5
address _tokenIn
address _tokenOut
uint256 _amountIn
uint256 _amountOutMin
address _to
returns: uint256[]
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
Recent Transactions
No transactions found for this address