Address Contract Verified
Address
0xb160FB3265Be197287e647c82Fef7913d5491e11
Balance
0 ETH
Nonce
1
Code Size
20480 bytes
Creator
0x931a9039...DFC5 at tx 0x2a2a797b...d22a21
Indexed Transactions
0
Contract Bytecode
20480 bytes
0x608060405260043610610296575f3560e01c8063715018a611610159578063bbc0c742116100c0578063dd62ed3e11610079578063dd62ed3e146109d5578063e2f4560514610a11578063ee40166e14610a3b578063f2fde38b14610a65578063f5648a4f14610a8d578063fabb0b4f14610aa35761029d565b8063bbc0c742146108e1578063c02466681461090b578063c18bc19514610933578063cc274b291461095b578063cc2ffe7c14610983578063dc3f0d0f146109ad5761029d565b806395d89b411161011257806395d89b41146107b15780639a7a23d6146107db578063a457c2d714610803578063a9059cbb1461083f578063aa4bde281461087b578063b62496f5146108a55761029d565b8063715018a6146106cd578063751039fc146106e35780637571336a146106f95780638366e79a1461072157806388e765ff1461075d5780638da5cb5b146107875761029d565b8063467abe0a116101fd5780635b5c251f116101b65780635b5c251f146105c35780635e83ae76146105ed5780636605bfda1461061557806366d602ae1461063d5780636ddd17131461066757806370a08231146106915761029d565b8063467abe0a146104dd578063470624021461050557806349bd5a5e1461052f5780634a62bb651461055957806351bc3c8514610583578063591f09eb146105995761029d565b80631e586fe31161024f5780631e586fe3146103bf57806323b872dd146103e95780632b14ca56146104255780632be32b611461044f578063313ce5671461047757806339509351146104a15761029d565b806306fdde03146102a1578063095ea7b3146102cb57806310d5de53146103075780631694505e1461034357806318160ddd1461036d5780631d933a4a146103975761029d565b3661029d57005b5f80fd5b3480156102ac575f80fd5b506102b5610acd565b6040516102c29190613a47565b60405180910390f35b3480156102d6575f80fd5b506102f160048036038101906102ec9190613af8565b610b5d565b6040516102fe9190613b50565b60405180910390f35b348015610312575f80fd5b5061032d60048036038101906103289190613b69565b610b7a565b60405161033a9190613b50565b60405180910390f35b34801561034e575f80fd5b50610357610b97565b6040516103649190613bef565b60405180910390f35b348015610378575f80fd5b50610381610bbb565b60405161038e9190613c17565b60405180910390f35b3480156103a2575f80fd5b506103bd60048036038101906103b89190613c30565b610bc4565b005b3480156103ca575f80fd5b506103d3610caa565b6040516103e09190613b50565b60405180910390f35b3480156103f4575f80fd5b5061040f600480360381019061040a9190613c5b565b610cbc565b60405161041c9190613b50565b60405180910390f35b348015610430575f80fd5b50610439610dae565b6040516104469190613c17565b60405180910390f35b34801561045a575f80fd5b5061047560048036038101906104709190613c30565b610db4565b005b348015610482575f80fd5b5061048b610f16565b6040516104989190613cc6565b60405180910390f35b3480156104ac575f80fd5b506104c760048036038101906104c29190613af8565b610f1e565b6040516104d49190613b50565b60405180910390f35b3480156104e8575f80fd5b5061050360048036038101906104fe9190613c30565b610fc5565b005b348015610510575f80fd5b506105196110ab565b6040516105269190613c17565b60405180910390f35b34801561053a575f80fd5b506105436110b1565b6040516105509190613cee565b60405180910390f35b348015610564575f80fd5b5061056d6110d5565b60405161057a9190613b50565b60405180910390f35b34801561058e575f80fd5b506105976110e7565b005b3480156105a4575f80fd5b506105ad611199565b6040516105ba9190613c17565b60405180910390f35b3480156105ce575f80fd5b506105d761119f565b6040516105e49190613cee565b60405180910390f35b3480156105f8575f80fd5b50610613600480360381019061060e9190613d31565b6111c4565b005b348015610620575f80fd5b5061063b60048036038101906106369190613b69565b61135c565b005b348015610648575f80fd5b506106516114e6565b60405161065e9190613c17565b60405180910390f35b348015610672575f80fd5b5061067b6114ec565b6040516106889190613b50565b60405180910390f35b34801561069c575f80fd5b506106b760048036038101906106b29190613b69565b6114ff565b6040516106c49190613c17565b60405180910390f35b3480156106d8575f80fd5b506106e1611544565b005b3480156106ee575f80fd5b506106f7611697565b005b348015610704575f80fd5b5061071f600480360381019061071a9190613d6f565b611774565b005b34801561072c575f80fd5b5061074760048036038101906107429190613dad565b6118f6565b6040516107549190613b50565b60405180910390f35b348015610768575f80fd5b50610771611b2c565b60405161077e9190613c17565b60405180910390f35b348015610792575f80fd5b5061079b611b32565b6040516107a89190613cee565b60405180910390f35b3480156107bc575f80fd5b506107c5611b5a565b6040516107d29190613a47565b60405180910390f35b3480156107e6575f80fd5b5061080160048036038101906107fc9190613d6f565b611bea565b005b34801561080e575f80fd5b5061082960048036038101906108249190613af8565b611d1c565b6040516108369190613b50565b60405180910390f35b34801561084a575f80fd5b5061086560048036038101906108609190613af8565b611e02565b6040516108729190613b50565b60405180910390f35b348015610886575f80fd5b5061088f611e1f565b60405161089c9190613c17565b60405180910390f35b3480156108b0575f80fd5b506108cb60048036038101906108c69190613b69565b611e25565b6040516108d89190613b50565b60405180910390f35b3480156108ec575f80fd5b506108f5611e42565b6040516109029190613b50565b60405180910390f35b348015610916575f80fd5b50610931600480360381019061092c9190613d6f565b611e55565b005b34801561093e575f80fd5b5061095960048036038101906109549190613c30565b611f91565b005b348015610966575f80fd5b50610981600480360381019061097c9190613c30565b6120f3565b005b34801561098e575f80fd5b5061099761219f565b6040516109a49190613c17565b60405180910390f35b3480156109b8575f80fd5b506109d360048036038101906109ce9190613c30565b6121a5565b005b3480156109e0575f80fd5b506109fb60048036038101906109f69190613dad565b612307565b604051610a089190613c17565b60405180910390f35b348015610a1c575f80fd5b50610a25612389565b604051610a329190613c17565b60405180910390f35b348015610a46575f80fd5b50610a4f61238f565b604051610a5c9190613c17565b60405180910390f35b348015610a70575f80fd5b50610a8b6004803603810190610a869190613b69565b612395565b005b348015610a98575f80fd5b50610aa1612557565b005b348015610aae575f80fd5b50610ab7612653565b604051610ac49190613c17565b60405180910390f35b606060038054610adc90613e18565b80601f0160208091040260200160405190810160405280929190818152602001828054610b0890613e18565b8015610b535780601f10610b2a57610100808354040283529160200191610b53565b820191905f5260205f20905b815481529060010190602001808311610b3657829003601f168201915b5050505050905090565b5f610b70610b69612659565b8484612660565b6001905092915050565b6015602052805f5260405f205f915054906101000a900460ff1681565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b5f600254905090565b610bcc612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613e92565b60405180910390fd5b8060108190555060286010541115610ca7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9e90613efa565b60405180910390fd5b50565b60125f9054906101000a900460ff1681565b5f610cc8848484612823565b5f60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f610d0f612659565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905082811015610d8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8590613f88565b60405180910390fd5b610da285610d9a612659565b858403612660565b60019150509392505050565b60105481565b610dbc612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4190613e92565b60405180910390fd5b670de0b6b3a76400006103e86001610e60610bbb565b610e6a9190613fd3565b610e749190614041565b610e7e9190614041565b811015610ec0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb7906140e1565b60405180910390fd5b670de0b6b3a764000081610ed49190613fd3565b6006819055507ffcc0366804aaa8dbf88a2924100c733b70dec8445957a5d5f8ff92898de41009600654604051610f0b9190613c17565b60405180910390a150565b5f6012905090565b5f610fbb610f2a612659565b848460015f610f37612659565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054610fb691906140ff565b612660565b6001905092915050565b610fcd612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461105b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105290613e92565b60405180910390fd5b80600f819055506028600f5411156110a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109f90613efa565b60405180910390fd5b50565b600f5481565b7f000000000000000000000000c688082d4e2ccbad61b58613c40709f338320cba81565b600e5f9054906101000a900460ff1681565b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611127612659565b73ffffffffffffffffffffffffffffffffffffffff1614611146575f80fd5b5f611150306114ff565b90505f81111561119657600160095f6101000a81548160ff02191690831515021790555061117c6132af565b5f60095f6101000a81548160ff0219169083151502179055505b50565b60115481565b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6111cc612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461125a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125190613e92565b60405180910390fd5b600e60019054906101000a900460ff16156112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a19061417c565b60405180910390fd5b81600e60016101000a81548160ff0219169083151502179055506001600e60026101000a81548160ff0219169083151502179055507fe185248899f361d51a48833938ab33493ebd7272d195abf7f51a833ea8138812600e60019054906101000a900460ff168260405161131f92919061419a565b60405180910390a1600e60019054906101000a900460ff16801561134457505f600c54145b156113585743600c8190555080600d819055505b5050565b611364612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e990613e92565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611460576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145790614231565b60405180910390fd5b80600b5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f2e1e696cfb265fa16e1170d24ef04cb2262772bde00ecf34d80bae6722487b7f60405160405180910390a250565b60075481565b600e60029054906101000a900460ff1681565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b61154c612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d190613e92565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35f60055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61169f612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461172d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172490613e92565b60405180910390fd5b5f600e5f6101000a81548160ff0219169083151502179055507fa4ffae85e880608d5d4365c2b682786545d136145537788e7e0940dff9f0b98c60405160405180910390a1565b61177c612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461180a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180190613e92565b60405180910390fd5b8061189e577f000000000000000000000000c688082d4e2ccbad61b58613c40709f338320cba73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361189d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611894906142bf565b60405180910390fd5b5b8060155f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505050565b5f8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611965576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195c90614327565b60405180910390fd5b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119eb906143b5565b60405180910390fd5b5f8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611a2e9190613cee565b602060405180830381865afa158015611a49573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a6d91906143e7565b90508373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401611aaa929190614412565b6020604051808303815f875af1158015611ac6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611aea919061444d565b91507fdeda980967fcead7b61e78ac46a4da14274af29e894d4d61e8b81ec38ab3e4388482604051611b1d929190614412565b60405180910390a15092915050565b60065481565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054611b6990613e18565b80601f0160208091040260200160405190810160405280929190818152602001828054611b9590613e18565b8015611be05780601f10611bb757610100808354040283529160200191611be0565b820191905f5260205f20905b815481529060010190602001808311611bc357829003601f168201915b5050505050905090565b611bf2612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7790613e92565b60405180910390fd5b7f000000000000000000000000c688082d4e2ccbad61b58613c40709f338320cba73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611d0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d05906144e8565b60405180910390fd5b611d1882826133f2565b5050565b5f8060015f611d29612659565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905082811015611de3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dda90614576565b60405180910390fd5b611df7611dee612659565b85858403612660565b600191505092915050565b5f611e15611e0e612659565b8484612823565b6001905092915050565b60085481565b6016602052805f5260405f205f915054906101000a900460ff1681565b600e60019054906101000a900460ff1681565b611e5d612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611eeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee290613e92565b60405180910390fd5b8060145f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df782604051611f859190613b50565b60405180910390a25050565b611f99612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612027576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201e90613e92565b60405180910390fd5b670de0b6b3a76400006103e8600261203d610bbb565b6120479190613fd3565b6120519190614041565b61205b9190614041565b81101561209d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209490614604565b60405180910390fd5b670de0b6b3a7640000816120b19190613fd3565b6008819055507fefc9add9a9b7382de284ef5ad69d8ea863e2680492b21a81948c2d5f04a442bc6008546040516120e89190613c17565b60405180910390a150565b600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612182576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217990614692565b60405180910390fd5b670de0b6b3a7640000816121969190613fd3565b600a8190555050565b60135481565b6121ad612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461223b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223290613e92565b60405180910390fd5b670de0b6b3a76400006103e86001612251610bbb565b61225b9190613fd3565b6122659190614041565b61226f9190614041565b8110156122b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a890614720565b60405180910390fd5b670de0b6b3a7640000816122c59190613fd3565b6007819055507f53c4eb831d8cfeb750f1c62590d8cd30f4c6f0380d29a05caa09f0d92588560e6007546040516122fc9190613c17565b60405180910390a150565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b600a5481565b600c5481565b61239d612659565b73ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461242b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242290613e92565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612499576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612490906147ae565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a38060055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146125e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125de906143b5565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff164760405161260b906147f9565b5f6040518083038185875af1925050503d805f8114612645576040519150601f19603f3d011682016040523d82523d5f602084013e61264a565b606091505b50508091505050565b600d5481565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036126ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126c59061487d565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361273c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127339061490b565b60405180910390fd5b8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516128169190613c17565b60405180910390a3505050565b601154431115612847575f60125f6101000a81548160ff0219169083151502179055505b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036128b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ac90614999565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291a90614a27565b60405180910390fd5b5f8111612965576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161295c90614a8f565b60405180910390fd5b600e5f9054906101000a900460ff1615612efa57612981611b32565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156129ef57506129bf611b32565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612a2757505f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612a61575061dead73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612ef957600e60019054906101000a900460ff16612bca5760155f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680612b15575060155f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff165b612b54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b4b90614af7565b60405180910390fd5b612b5c611b32565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612bc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bc090614b5f565b60405180910390fd5b5b60165f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168015612c67575060155f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15612d0e57600654811115612cb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ca890614bed565b60405180910390fd5b600854612cbd836114ff565b82612cc891906140ff565b1115612d09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d0090614c55565b60405180910390fd5b612ef8565b60165f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168015612dab575060155f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15612dfa57600754811115612df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612dec90614ce3565b60405180910390fd5b612ef7565b60155f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015612e98575060155f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15612ef657600854612ea9836114ff565b82612eb491906140ff565b1115612ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612eec90614c55565b60405180910390fd5b5b5b5b5b5b5f612f04306114ff565b90505f600a548210159050808015612f285750600e60029054906101000a900460ff165b8015612f40575060095f9054906101000a900460ff16155b8015612f93575060165f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b8015612fe6575060145f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b8015613039575060145f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b1561307a57600160095f6101000a81548160ff0219169083151502179055506130606132af565b5f60095f6101000a81548160ff0219169083151502179055505b5f6001905060145f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061311a575060145f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff165b15613123575f90505b5f8082801561313357505f600c54115b80156131405750600c5443115b1561329a5760165f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16801561319c57505f601054115b156131da576064601054876131b19190613fd3565b6131bb9190614041565b91508160135f8282546131ce91906140ff565b9250508190555061326c565b60165f8973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16801561323157505f600f54115b1561326b576064600f54876132469190613fd3565b6132509190614041565b91508160135f82825461326391906140ff565b925050819055505b5b5f8211156132805761327f88308461349a565b5b808261328c91906140ff565b866132979190614d01565b95505b6132a588888861349a565b5050505050505050565b60125f9054906101000a900460ff1680156132cb575060115443145b6133f0575f6132d9306114ff565b90505f60135490505f8214806132ee57505f81145b156132fa5750506133f0565b6005600a546133099190613fd3565b821115613322576005600a5461331f9190613fd3565b91505b5f61332c836136f9565b5f60138190555043601181905550600160125f6101000a81548160ff0219169083151502179055505f4790505f8111156133eb57600b5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16476040516133a5906147f9565b5f6040518083038185875af1925050503d805f81146133df576040519150601f19603f3d011682016040523d82523d5f602084013e6133e4565b606091505b5050809250505b505050505b565b8060165f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550613450828261392c565b8015158273ffffffffffffffffffffffffffffffffffffffff167fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab60405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603613508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134ff90614999565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161356d90614a27565b60405180910390fd5b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156135f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135f090614da4565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550815f808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825461368791906140ff565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516136eb9190613c17565b60405180910390a350505050565b5f600267ffffffffffffffff81111561371557613714614dc2565b5b6040519080825280602002602001820160405280156137435781602001602082028036833780820191505090505b50905030815f8151811061375a57613759614def565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156137fd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906138219190614e30565b8160018151811061383557613834614def565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061389a307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d84612660565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8430426040518663ffffffff1660e01b81526004016138fb959493929190614f4b565b5f604051808303815f87803b158015613912575f80fd5b505af1158015613924573d5f803e3d5ffd5b505050505050565b8060155f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055507f6b4f1be9103e6cbcd38ca4a922334f2c3109b260130a6676a987f94088fd674682826040516139b1929190614fa3565b60405180910390a15050565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156139f45780820151818401526020810190506139d9565b5f8484015250505050565b5f601f19601f8301169050919050565b5f613a19826139bd565b613a2381856139c7565b9350613a338185602086016139d7565b613a3c816139ff565b840191505092915050565b5f6020820190508181035f830152613a5f8184613a0f565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f613a9482613a6b565b9050919050565b613aa481613a8a565b8114613aae575f80fd5b50565b5f81359050613abf81613a9b565b92915050565b5f819050919050565b613ad781613ac5565b8114613ae1575f80fd5b50565b5f81359050613af281613ace565b92915050565b5f8060408385031215613b0e57613b0d613a67565b5b5f613b1b85828601613ab1565b9250506020613b2c85828601613ae4565b9150509250929050565b5f8115159050919050565b613b4a81613b36565b82525050565b5f602082019050613b635f830184613b41565b92915050565b5f60208284031215613b7e57613b7d613a67565b5b5f613b8b84828501613ab1565b91505092915050565b5f819050919050565b5f613bb7613bb2613bad84613a6b565b613b94565b613a6b565b9050919050565b5f613bc882613b9d565b9050919050565b5f613bd982613bbe565b9050919050565b613be981613bcf565b82525050565b5f602082019050613c025f830184613be0565b92915050565b613c1181613ac5565b82525050565b5f602082019050613c2a5f830184613c08565b92915050565b5f60208284031215613c4557613c44613a67565b5b5f613c5284828501613ae4565b91505092915050565b5f805f60608486031215613c7257613c71613a67565b5b5f613c7f86828701613ab1565b9350506020613c9086828701613ab1565b9250506040613ca186828701613ae4565b9150509250925092565b5f60ff82169050919050565b613cc081613cab565b82525050565b5f602082019050613cd95f830184613cb7565b92915050565b613ce881613a8a565b82525050565b5f602082019050613d015f830184613cdf565b92915050565b613d1081613b36565b8114613d1a575f80fd5b50565b5f81359050613d2b81613d07565b92915050565b5f8060408385031215613d4757613d46613a67565b5b5f613d5485828601613d1d565b9250506020613d6585828601613ae4565b9150509250929050565b5f8060408385031215613d8557613d84613a67565b5b5f613d9285828601613ab1565b9250506020613da385828601613d1d565b9150509250929050565b5f8060408385031215613dc357613dc2613a67565b5b5f613dd085828601613ab1565b9250506020613de185828601613ab1565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680613e2f57607f821691505b602082108103613e4257613e41613deb565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f613e7c6020836139c7565b9150613e8782613e48565b602082019050919050565b5f6020820190508181035f830152613ea981613e70565b9050919050565b7f46656573206d7573742062652034302520206f72206c657373000000000000005f82015250565b5f613ee46019836139c7565b9150613eef82613eb0565b602082019050919050565b5f6020820190508181035f830152613f1181613ed8565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320615f8201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b5f613f726028836139c7565b9150613f7d82613f18565b604082019050919050565b5f6020820190508181035f830152613f9f81613f66565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f613fdd82613ac5565b9150613fe883613ac5565b9250828202613ff681613ac5565b9150828204841483151761400d5761400c613fa6565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61404b82613ac5565b915061405683613ac5565b92508261406657614065614014565b5b828204905092915050565b7f43616e6e6f7420736574206d61782062757920616d6f756e74206c6f776572205f8201527f7468616e20302e31250000000000000000000000000000000000000000000000602082015250565b5f6140cb6029836139c7565b91506140d682614071565b604082019050919050565b5f6020820190508181035f8301526140f8816140bf565b9050919050565b5f61410982613ac5565b915061411483613ac5565b925082820190508082111561412c5761412b613fa6565b5b92915050565b7f43616e6e6f7420726520656e61626c652074726164696e6700000000000000005f82015250565b5f6141666018836139c7565b915061417182614132565b602082019050919050565b5f6020820190508181035f8301526141938161415a565b9050919050565b5f6040820190506141ad5f830185613b41565b6141ba6020830184613c08565b9392505050565b7f5f54726561737572794164647265737320616464726573732063616e6e6f74205f8201527f6265203000000000000000000000000000000000000000000000000000000000602082015250565b5f61421b6024836139c7565b9150614226826141c1565b604082019050919050565b5f6020820190508181035f8301526142488161420f565b9050919050565b7f43616e6e6f742072656d6f766520756e697377617020706169722066726f6d205f8201527f6d61782074786e00000000000000000000000000000000000000000000000000602082015250565b5f6142a96027836139c7565b91506142b48261424f565b604082019050919050565b5f6020820190508181035f8301526142d68161429d565b9050919050565b7f5f746f6b656e20616464726573732063616e6e6f7420626520300000000000005f82015250565b5f614311601a836139c7565b915061431c826142dd565b602082019050919050565b5f6020820190508181035f83015261433e81614305565b9050919050565b7f6f6e6c79205472656173757279416464726573732063616e20776974686472615f8201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b5f61439f6021836139c7565b91506143aa82614345565b604082019050919050565b5f6020820190508181035f8301526143cc81614393565b9050919050565b5f815190506143e181613ace565b92915050565b5f602082840312156143fc576143fb613a67565b5b5f614409848285016143d3565b91505092915050565b5f6040820190506144255f830185613cdf565b6144326020830184613c08565b9392505050565b5f8151905061444781613d07565b92915050565b5f6020828403121561446257614461613a67565b5b5f61446f84828501614439565b91505092915050565b7f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d205f8201527f6175746f6d617465644d61726b65744d616b6572506169727300000000000000602082015250565b5f6144d26039836139c7565b91506144dd82614478565b604082019050919050565b5f6020820190508181035f8301526144ff816144c6565b9050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f775f8201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b5f6145606025836139c7565b915061456b82614506565b604082019050919050565b5f6020820190508181035f83015261458d81614554565b9050919050565b7f43616e6e6f7420736574206d61782077616c6c657420616d6f756e74206c6f775f8201527f6572207468616e20302e32250000000000000000000000000000000000000000602082015250565b5f6145ee602c836139c7565b91506145f982614594565b604082019050919050565b5f6020820190508181035f83015261461b816145e2565b9050919050565b7f6f6e6c79205472656173757279416464726573732063616e206368616e6765205f8201527f737761705468726573686f6c6400000000000000000000000000000000000000602082015250565b5f61467c602d836139c7565b915061468782614622565b604082019050919050565b5f6020820190508181035f8301526146a981614670565b9050919050565b7f43616e6e6f7420736574206d61782073656c6c20616d6f756e74206c6f7765725f8201527f207468616e20302e312500000000000000000000000000000000000000000000602082015250565b5f61470a602a836139c7565b9150614715826146b0565b604082019050919050565b5f6020820190508181035f830152614737816146fe565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f6147986026836139c7565b91506147a38261473e565b604082019050919050565b5f6020820190508181035f8301526147c58161478c565b9050919050565b5f81905092915050565b50565b5f6147e45f836147cc565b91506147ef826147d6565b5f82019050919050565b5f614803826147d9565b9150819050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f6148676024836139c7565b91506148728261480d565b604082019050919050565b5f6020820190508181035f8301526148948161485b565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f6148f56022836139c7565b91506149008261489b565b604082019050919050565b5f6020820190508181035f830152614922816148e9565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f6149836025836139c7565b915061498e82614929565b604082019050919050565b5f6020820190508181035f8301526149b081614977565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f614a116023836139c7565b9150614a1c826149b7565b604082019050919050565b5f6020820190508181035f830152614a3e81614a05565b9050919050565b7f616d6f756e74206d7573742062652067726561746572207468616e20300000005f82015250565b5f614a79601d836139c7565b9150614a8482614a45565b602082019050919050565b5f6020820190508181035f830152614aa681614a6d565b9050919050565b7f54726164696e67206973206e6f74206163746976652e000000000000000000005f82015250565b5f614ae16016836139c7565b9150614aec82614aad565b602082019050919050565b5f6020820190508181035f830152614b0e81614ad5565b9050919050565b7f54726164696e67206973206e6f7420656e61626c6564000000000000000000005f82015250565b5f614b496016836139c7565b9150614b5482614b15565b602082019050919050565b5f6020820190508181035f830152614b7681614b3d565b9050919050565b7f427579207472616e7366657220616d6f756e74206578636565647320746865205f8201527f6d6178206275792e000000000000000000000000000000000000000000000000602082015250565b5f614bd76028836139c7565b9150614be282614b7d565b604082019050919050565b5f6020820190508181035f830152614c0481614bcb565b9050919050565b7f43616e6e6f7420457863656564206d61782077616c6c657400000000000000005f82015250565b5f614c3f6018836139c7565b9150614c4a82614c0b565b602082019050919050565b5f6020820190508181035f830152614c6c81614c33565b9050919050565b7f53656c6c207472616e7366657220616d6f756e742065786365656473207468655f8201527f206d61782073656c6c2e00000000000000000000000000000000000000000000602082015250565b5f614ccd602a836139c7565b9150614cd882614c73565b604082019050919050565b5f6020820190508181035f830152614cfa81614cc1565b9050919050565b5f614d0b82613ac5565b9150614d1683613ac5565b9250828203905081811115614d2e57614d2d613fa6565b5b92915050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f614d8e6026836139c7565b9150614d9982614d34565b604082019050919050565b5f6020820190508181035f830152614dbb81614d82565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81519050614e2a81613a9b565b92915050565b5f60208284031215614e4557614e44613a67565b5b5f614e5284828501614e1c565b91505092915050565b5f819050919050565b5f614e7e614e79614e7484614e5b565b613b94565b613ac5565b9050919050565b614e8e81614e64565b82525050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b614ec681613a8a565b82525050565b5f614ed78383614ebd565b60208301905092915050565b5f602082019050919050565b5f614ef982614e94565b614f038185614e9e565b9350614f0e83614eae565b805f5b83811015614f3e578151614f258882614ecc565b9750614f3083614ee3565b925050600181019050614f11565b5085935050505092915050565b5f60a082019050614f5e5f830188613c08565b614f6b6020830187614e85565b8181036040830152614f7d8186614eef565b9050614f8c6060830185613cdf565b614f996080830184613c08565b9695505050505050565b5f604082019050614fb65f830185613cdf565b614fc36020830184613b41565b939250505056fea2646970667358221220b2ebd8b597e00e24667488c64b612710dc4f9b2da1ba7897356530c9cade991264736f6c63430008140033
Verified Source Code Full Match
Compiler: v0.8.20+commit.a1b79de6
EVM: shanghai
Optimization: No
SCALR.sol 583 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
/*
Unlock your algorithm with Scalr
Official Links at: https://linktr.ee/usescalr
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
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;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
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;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
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");
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);
}
function _createInitialSupply(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);
}
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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() external virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IDexFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract SCALR is ERC20, Ownable {
uint256 public maxBuyAmount;
uint256 public maxSellAmount;
uint256 public maxWalletAmount;
IDexRouter public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool private swapping;
uint256 public swapTokensAtAmount;
address public TreasuryAddress;
uint256 public tradingActiveBlock = 0; // 0 means trading is not active
uint256 public deadBlocks = 1;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
uint256 public buyFee;
uint256 public sellFee;
uint256 public lastSwapBlock;
bool public swapBackTriggeredThisBlock;
uint256 public tokensForTreasury;
// exlcude from fees and max transaction amount
mapping (address => bool) private _isExcludedFromFees;
mapping (address => bool) public _isExcludedMaxTransactionAmount;
// store addresses that a automatic market maker pairs. Any transfer *to* these addresses
// could be subject to a maximum transfer amount
mapping (address => bool) public automatedMarketMakerPairs;
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event EnabledTrading(bool tradingActive, uint256 deadBlocks);
event RemovedLimits();
event ExcludeFromFees(address indexed account, bool isExcluded);
event UpdatedMaxBuyAmount(uint256 newAmount);
event UpdatedMaxSellAmount(uint256 newAmount);
event UpdatedMaxWalletAmount(uint256 newAmount);
event UpdatedTreasuryAddress(address indexed newWallet);
event MaxTransactionExclusion(address _address, bool excluded);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event TransferForeignToken(address token, uint256 amount);
constructor() ERC20("Scalr", "SCALR") {
address newOwner = msg.sender;
IDexRouter _uniswapV2Router = IDexRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IDexFactory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_setAutomatedMarketMakerPair(address(uniswapV2Pair), true);
uint256 totalSupply = 100000000 * 1e18;
uint256 ownerAmount = totalSupply * 90 / 100; // 90% to owner
uint256 contractAmount = totalSupply - ownerAmount; // 10% stays in contract
maxBuyAmount = totalSupply * 10 / 1000;
maxSellAmount = totalSupply * 10 / 1000;
maxWalletAmount = totalSupply * 10 / 1000;
swapTokensAtAmount = totalSupply * 20 / 100000;
buyFee = 40;
sellFee = 40;
_excludeFromMaxTransaction(newOwner, true);
_excludeFromMaxTransaction(address(this), true);
_excludeFromMaxTransaction(address(0xdead), true);
TreasuryAddress = address(0x309b75A43ad38456A16d699E1047aB9A0EbCddFb);
excludeFromFees(newOwner, true);
excludeFromFees(address(this), true);
excludeFromFees(address(0xdead), true);
excludeFromFees(TreasuryAddress, true);
// Use the existing _createInitialSupply function twice
_createInitialSupply(newOwner, ownerAmount);
_createInitialSupply(address(this), contractAmount);
transferOwnership(newOwner);
}
receive() external payable {}
function updateMaxBuyAmount(uint256 newNum) external onlyOwner {
require(newNum >= (totalSupply() * 1 / 1000)/1e18, "Cannot set max buy amount lower than 0.1%");
maxBuyAmount = newNum * (10**18);
emit UpdatedMaxBuyAmount(maxBuyAmount);
}
function updateMaxSellAmount(uint256 newNum) external onlyOwner {
require(newNum >= (totalSupply() * 1 / 1000)/1e18, "Cannot set max sell amount lower than 0.1%");
maxSellAmount = newNum * (10**18);
emit UpdatedMaxSellAmount(maxSellAmount);
}
// remove limits after token is stable
function removeLimits() external onlyOwner {
limitsInEffect = false;
emit RemovedLimits();
}
function _excludeFromMaxTransaction(address updAds, bool isExcluded) private {
_isExcludedMaxTransactionAmount[updAds] = isExcluded;
emit MaxTransactionExclusion(updAds, isExcluded);
}
function excludeFromMaxTransaction(address updAds, bool isEx) external onlyOwner {
if(!isEx){
require(updAds != uniswapV2Pair, "Cannot remove uniswap pair from max txn");
}
_isExcludedMaxTransactionAmount[updAds] = isEx;
}
function updateMaxWalletAmount(uint256 newNum) external onlyOwner {
require(newNum >= (totalSupply() * 2 / 1000)/1e18, "Cannot set max wallet amount lower than 0.2%");
maxWalletAmount = newNum * (10**18);
emit UpdatedMaxWalletAmount(maxWalletAmount);
}
function updateSwapThreshold(uint256 newAmount) public {
require(msg.sender==TreasuryAddress,"only TreasuryAddress can change swapThreshold");
swapTokensAtAmount = newAmount* (10**18);
}
function transferForeignToken(address _token, address _to) public returns (bool _sent) {
require(_token != address(0), "_token address cannot be 0");
require(msg.sender==TreasuryAddress,"only TreasuryAddress can withdraw");
uint256 _contractBalance = IERC20(_token).balanceOf(address(this));
_sent = IERC20(_token).transfer(_to, _contractBalance);
emit TransferForeignToken(_token, _contractBalance);
}
// withdraw ETH if stuck or someone sends to the address
function withdrawStuckETH() public {
bool success;
require(msg.sender==TreasuryAddress,"only TreasuryAddress can withdraw");
(success,) = address(msg.sender).call{value: address(this).balance}("");
}
function updateBuyFee(uint256 _fee) external onlyOwner {
buyFee = _fee;
require(buyFee <= 40, "Fees must be 40% or less");
}
function updateSellFee(uint256 _fee) external onlyOwner {
sellFee = _fee;
require(sellFee <= 40, "Fees must be 40% or less");
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
function _transfer(address from, address to, uint256 amount) internal override {
if (block.number > lastSwapBlock) {
swapBackTriggeredThisBlock = false;
}
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "amount must be greater than 0");
if(limitsInEffect){
if (from != owner() && to != owner() && to != address(0) && to != address(0xdead)){
if(!tradingActive){
require(_isExcludedMaxTransactionAmount[from] || _isExcludedMaxTransactionAmount[to], "Trading is not active.");
require(from == owner(), "Trading is not enabled");
}
//when buy
if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
require(amount <= maxBuyAmount, "Buy transfer amount exceeds the max buy.");
require(amount + balanceOf(to) <= maxWalletAmount, "Cannot Exceed max wallet");
}
//when sell
else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {
require(amount <= maxSellAmount, "Sell transfer amount exceeds the max sell.");
}
else if (!_isExcludedMaxTransactionAmount[to] && !_isExcludedMaxTransactionAmount[from]){
require(amount + balanceOf(to) <= maxWalletAmount, "Cannot Exceed max wallet");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if(canSwap && swapEnabled && !swapping && !automatedMarketMakerPairs[from] && !_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = true;
// if any account belongs to _isExcludedFromFee account then remove the fee
if(_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
uint256 penaltyAmount = 0;
// only take fees on Trades, not on wallet transfers
if(takeFee && tradingActiveBlock>0 && (block.number>tradingActiveBlock)) {
// on sell
if (automatedMarketMakerPairs[to] && sellFee > 0) {
fees = amount * sellFee / 100;
tokensForTreasury += fees;
}
// on buy
else if(automatedMarketMakerPairs[from] && buyFee > 0) {
fees = amount * buyFee / 100;
tokensForTreasury += fees;
}
if(fees > 0){
super._transfer(from, address(this), fees);
}
amount -= fees + penaltyAmount;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function setAutomatedMarketMakerPair(address pair, bool value) external onlyOwner {
require(pair != uniswapV2Pair, "The pair cannot be removed from automatedMarketMakerPairs");
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
_excludeFromMaxTransaction(pair, value);
emit SetAutomatedMarketMakerPair(pair, value);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(owner()),
block.timestamp
);
}
function setTreasuryAddress(address _TreasuryAddress) external onlyOwner {
require(_TreasuryAddress != address(0), "_TreasuryAddress address cannot be 0");
TreasuryAddress = payable(_TreasuryAddress);
emit UpdatedTreasuryAddress(_TreasuryAddress);
}
function swapBack() private {
// Only proceed if we haven't swapped this block yet
if (swapBackTriggeredThisBlock && block.number == lastSwapBlock) {
return;
}
uint256 contractBalance = balanceOf(address(this));
uint256 totalTokensToSwap = tokensForTreasury;
if(contractBalance == 0 || totalTokensToSwap == 0) {
return;
}
if(contractBalance > swapTokensAtAmount * 5){
contractBalance = swapTokensAtAmount * 5;
}
bool success;
swapTokensForEth(contractBalance);
tokensForTreasury = 0;
// Update swap tracking
lastSwapBlock = block.number;
swapBackTriggeredThisBlock = true;
uint256 ethBalance=address(this).balance;
if(ethBalance>0){
(success,) = address(TreasuryAddress).call{value: address(this).balance}("");
}
}
function manualSwap() external {
require(_msgSender()==TreasuryAddress);
uint256 tokenBalance=balanceOf(address(this));
if(tokenBalance>0){
swapping = true;
swapBack();
swapping = false;
}
}
// once enabled, can never be turned off
function enableTrading(bool _status, uint256 _deadBlocks) external onlyOwner {
require(!tradingActive, "Cannot re enable trading");
tradingActive = _status;
swapEnabled = true;
emit EnabledTrading(tradingActive, _deadBlocks);
if (tradingActive && tradingActiveBlock == 0) {
tradingActiveBlock = block.number;
deadBlocks = _deadBlocks;
}
}
}
Read Contract
TreasuryAddress 0x5b5c251f → address
_isExcludedMaxTransactionAmount 0x10d5de53 → bool
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
buyFee 0x47062402 → uint256
deadBlocks 0xfabb0b4f → uint256
decimals 0x313ce567 → uint8
lastSwapBlock 0x591f09eb → uint256
limitsInEffect 0x4a62bb65 → bool
maxBuyAmount 0x88e765ff → uint256
maxSellAmount 0x66d602ae → uint256
maxWalletAmount 0xaa4bde28 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
sellFee 0x2b14ca56 → uint256
swapBackTriggeredThisBlock 0x1e586fe3 → bool
swapEnabled 0x6ddd1713 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
tokensForTreasury 0xcc2ffe7c → uint256
totalSupply 0x18160ddd → uint256
tradingActive 0xbbc0c742 → bool
tradingActiveBlock 0xee40166e → uint256
uniswapV2Pair 0x49bd5a5e → address
uniswapV2Router 0x1694505e → address
Write Contract 22 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableTrading 0x5e83ae76
bool _status
uint256 _deadBlocks
excludeFromFees 0xc0246668
address account
bool excluded
excludeFromMaxTransaction 0x7571336a
address updAds
bool isEx
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
manualSwap 0x51bc3c85
No parameters
removeLimits 0x751039fc
No parameters
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
setTreasuryAddress 0x6605bfda
address _TreasuryAddress
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferForeignToken 0x8366e79a
address _token
address _to
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateBuyFee 0x467abe0a
uint256 _fee
updateMaxBuyAmount 0x2be32b61
uint256 newNum
updateMaxSellAmount 0xdc3f0d0f
uint256 newNum
updateMaxWalletAmount 0xc18bc195
uint256 newNum
updateSellFee 0x1d933a4a
uint256 _fee
updateSwapThreshold 0xcc274b29
uint256 newAmount
withdrawStuckETH 0xf5648a4f
No parameters
Recent Transactions
No transactions found for this address