Address Contract Partially Verified
Address
0x07A1f40a76a5e7e42DEF56C23DEB6B422bE2F291
Balance
0 ETH
Nonce
1
Code Size
22827 bytes
Creator
0xb2688b68...16c8 at tx 0x19913e4b...5ceb84
Indexed Transactions
0
Contract Bytecode
22827 bytes
0x608060405234801561001057600080fd5b506004361061023d5760003560e01c80635c1eca841161013b578063a457c2d7116100b8578063e46adf621161007c578063e46adf6214610bcf578063f2cc0c1814610c13578063f2fde38b14610c57578063f84354f114610c9b578063fe4b84df14610cdf5761023d565b8063a457c2d714610a17578063a9059cbb14610a7b578063aef7f99e14610adf578063cba0e99614610afd578063dd62ed3e14610b575761023d565b80638da5cb5b116100ff5780638da5cb5b1461082757806391d4ec181461085b57806395d89b411461087957806397d0677b146108fc5780639ace38c21461094a5761023d565b80635c1eca84146107215780636e9dde991461076d57806370a08231146107a7578063715018a6146107ff5780637d449789146108095761023d565b806323b872dd116101c957806338a9ad1d1161018d57806338a9ad1d1461061f578063395093511461063d5780633aa8d4be146106a1578063456e0a5d146106d557806346c3bd1f146106f35761023d565b806323b872dd146104fc5780632ae427dc146105805780632bc1281e1461059e578063303bb0b6146105bc578063313ce567146105fe5761023d565b8063126e19be11610210578063126e19be1461038957806313114a9d1461046457806314f43f7e1461048257806318160ddd146104b05780631f36d925146104ce5761023d565b806306fdde031461024257806308d1dd8a146102c5578063095ea7b3146102e35780630ab114f914610347575b600080fd5b61024a610d0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561028a57808201518184015260208101905061026f565b50505050905090810190601f1680156102b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102cd610daf565b6040518082815260200191505060405180910390f35b61032f600480360360408110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db5565b60405180821515815260200191505060405180910390f35b6103736004803603602081101561035d57600080fd5b8101908080359060200190929190505050610dd3565b6040518082815260200191505060405180910390f35b6104626004803603604081101561039f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156103dc57600080fd5b8201836020820111156103ee57600080fd5b8035906020019184600183028401116401000000008311171561041057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506114d1565b005b61046c611684565b6040518082815260200191505060405180910390f35b6104ae6004803603602081101561049857600080fd5b810190808035906020019092919050505061168e565b005b6104b8611821565b6040518082815260200191505060405180910390f35b6104fa600480360360208110156104e457600080fd5b810190808035906020019092919050505061182b565b005b6105686004803603606081101561051257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611965565b60405180821515815260200191505060405180910390f35b610588611a3e565b6040518082815260200191505060405180910390f35b6105a6611a44565b6040518082815260200191505060405180910390f35b6105e8600480360360208110156105d257600080fd5b8101908080359060200190929190505050611a4a565b6040518082815260200191505060405180910390f35b610606611ace565b604051808260ff16815260200191505060405180910390f35b610627611ae5565b6040518082815260200191505060405180910390f35b6106896004803603604081101561065357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611aeb565b60405180821515815260200191505060405180910390f35b6106a9611b9e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106dd611bc4565b6040518082815260200191505060405180910390f35b61071f6004803603602081101561070957600080fd5b8101908080359060200190929190505050611bca565b005b61076b6004803603608081101561073757600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611e8e565b005b6107a56004803603604081101561078357600080fd5b8101908080359060200190929190803515159060200190929190505050611ff9565b005b6107e9600480360360208110156107bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061215a565b6040518082815260200191505060405180910390f35b610807612245565b005b6108116123d0565b6040518082815260200191505060405180910390f35b61082f6123d6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610863612400565b6040518082815260200191505060405180910390f35b61088161240d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108c15780820151818401526020810190506108a6565b50505050905090810190601f1680156108ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6109346004803603604081101561091257600080fd5b81019080803590602001909291908035151590602001909291905050506124af565b6040518082815260200191505060405180910390f35b6109766004803603602081101561096057600080fd5b810190808035906020019092919050505061256a565b6040518084151581526020018373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109da5780820151818401526020810190506109bf565b50505050905090810190601f168015610a075780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b610a6360048036036040811015610a2d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612666565b60405180821515815260200191505060405180910390f35b610ac760048036036040811015610a9157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612733565b60405180821515815260200191505060405180910390f35b610ae7612751565b6040518082815260200191505060405180910390f35b610b3f60048036036020811015610b1357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612757565b60405180821515815260200191505060405180910390f35b610bb960048036036040811015610b6d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127ad565b6040518082815260200191505060405180910390f35b610c1160048036036020811015610be557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612834565b005b610c5560048036036020811015610c2957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612942565b005b610c9960048036036020811015610c6d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c5e565b005b610cdd60048036036020811015610cb157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e6e565b005b610d0b60048036036020811015610cf557600080fd5b81019080803590602001909291905050506131fa565b005b606060688054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610da55780601f10610d7a57610100808354040283529160200191610da5565b820191906000526020600020905b815481529060010190602001808311610d8857829003601f168201915b5050505050905090565b60da5481565b6000610dc9610dc2613555565b848461355d565b6001905092915050565b6000610ddd6123d6565b73ffffffffffffffffffffffffffffffffffffffff16610dfb613555565b73ffffffffffffffffffffffffffffffffffffffff161480610e71575060d560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e59613555565b73ffffffffffffffffffffffffffffffffffffffff16145b610ee3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53656e646572206e6f7420617574686f72697a6564000000000000000000000081525060200191505060405180910390fd5b610ef9600160ca5461375490919063ffffffff16565b60ca819055506000821415610f4e5760ca547f72725a3b1e5bd622d6bcd1339bb31279c351abe8f541ac7fd320f24e1b1641f260d0546040518082815260200191505060405180910390a260d05490506114cc565b6000610f6b60008412610f615783610f66565b836000035b6137dc565b90506000610f9a60d054610f8c6009600a0a8561385c90919063ffffffff16565b6134c190919063ffffffff16565b9050600080851215610fc457610fbd826009600a0a61350b90919063ffffffff16565b9050610fde565b610fdb826009600a0a61375490919063ffffffff16565b90505b600085121561100757610ffc8360d05461350b90919063ffffffff16565b60d081905550611023565b61101c8360d05461375490919063ffffffff16565b60d0819055505b60001960d05411156110395760001960d0819055505b60005b60cf805490508110156111ef57600060cc600060cf848154811061105c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156111e2576111676009600a0a6111598460cc600060cf87815481106110e557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461385c90919063ffffffff16565b6134c190919063ffffffff16565b60cc600060cf848154811061117857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b808060010191505061103c565b5060ca547f72725a3b1e5bd622d6bcd1339bb31279c351abe8f541ac7fd320f24e1b1641f260d0546040518082815260200191505060405180910390a260005b60c9805490508110156114c257600060c9828154811061124b57fe5b906000526020600020906002020190508060000160009054906101000a900460ff16156114b457600061133e8260000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113345780601f1061130957610100808354040283529160200191611334565b820191906000526020600020905b81548152906001019060200180831161131757829003601f168201915b50505050506138e2565b9050806114b2578160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8091ecaaa54ebb82e02d36c2c336528e0fcb9b3430fc1291ac88295032b9c263848460010160405180838152602001806020018281038252838181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114355780601f1061140a57610100808354040283529160200191611435565b820191906000526020600020905b81548152906001019060200180831161141857829003601f168201915b5050935050505060405180910390a26040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f5472616e73616374696f6e204661696c6564000000000000000000000000000081525060200191505060405180910390fd5b505b50808060010191505061122f565b5060d05493505050505b919050565b6114d9613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461159b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60c960405180606001604052806001151581526020018473ffffffffffffffffffffffffffffffffffffffff16815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604082015181600101908051906020019061167d92919061543b565b5050505050565b600060d254905090565b6000611698613555565b905060ce60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561173d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806158a5602c913960400191505060405180910390fd5b600061174b8360d354613909565b5050505090506117a38160cb60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461350b90919063ffffffff16565b60cb60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117fb8160d15461350b90919063ffffffff16565b60d1819055506118168360d25461375490919063ffffffff16565b60d281905550505050565b600060d054905090565b611833613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61a8c060d45401421015611954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180615784602c913960400191505060405180910390fd5b8060d3819055504260d48190555050565b6000611972848484613963565b611a338461197e613555565b611a2e8560405180606001604052806028815260200161575c6028913960cd60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006119e4613555565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613f759092919063ffffffff16565b61355d565b600190509392505050565b60d35481565b60d75481565b600060d154821115611aa7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180615832602a913960400191505060405180910390fd5b6000611ab1614035565b9050611ac681846134c190919063ffffffff16565b915050919050565b6000606a60009054906101000a900460ff16905090565b60d65481565b6000611b94611af8613555565b84611b8f8560cd6000611b09613555565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461375490919063ffffffff16565b61355d565b6001905092915050565b60d560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60d85481565b611bd2613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60c9805490508110611d0e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f696e646578206f7574206f6620626f756e64730000000000000000000000000081525060200191505060405180910390fd5b600160c98054905003811015611e1c5760c9600160c9805490500381548110611d3357fe5b906000526020600020906002020160c98281548110611d4e57fe5b90600052602060002090600202016000820160009054906101000a900460ff168160000160006101000a81548160ff0219169083151502179055506000820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018201816001019080546001816001161561010002031660029004611e179291906154bb565b509050505b60c9805480611e2757fe5b6001900381819060005260206000209060020201600080820160006101000a81549060ff02191690556000820160016101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000611e879190615542565b5050905550565b611e96613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600060da5414611fd0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f4c696d6974206368616e676573206e6f7420616c6c6f7765640000000000000081525060200191505060405180910390fd5b8360d6819055508260d7819055508160d8819055508060d9819055504260da8190555050505050565b612001613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60c9805490508210612120576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806156936028913960400191505060405180910390fd5b8060c9838154811061212e57fe5b906000526020600020906002020160000160006101000a81548160ff0219169083151502179055505050565b600060ce60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156121f55760cc60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050612240565b61223d60cb60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4a565b90505b919050565b61224d613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461230f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60d95481565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060c980549050905090565b606060698054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124a55780601f1061247a576101008083540402835291602001916124a5565b820191906000526020600020905b81548152906001019060200180831161248857829003601f168201915b5050505050905090565b600060d054831115612529576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f416d6f756e74206d757374206265206c657373207468616e20737570706c790081525060200191505060405180910390fd5b8161254b57600061253c8460d354613909565b50505050905080915050612564565b60006125598460d354613909565b505050915050809150505b92915050565b60c9818154811061257757fe5b90600052602060002090600202016000915090508060000160009054906101000a900460ff16908060000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561265c5780601f106126315761010080835404028352916020019161265c565b820191906000526020600020905b81548152906001019060200180831161263f57829003601f168201915b5050505050905083565b6000612729612673613555565b84612724856040518060600160405280602581526020016158d16025913960cd600061269d613555565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613f759092919063ffffffff16565b61355d565b6001905092915050565b6000612747612740613555565b8484613963565b6001905092915050565b60d45481565b600060ce60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600060cd60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61283c613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146128fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060d560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61294a613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612a0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60ce60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612acc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4163636f756e7420697320616c7265616479206578636c75646564000000000081525060200191505060405180910390fd5b600060cb60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115612ba057612b5c60cb60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4a565b60cc60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600160ce60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060cf819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612c66613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612d28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612dae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061564b6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612e76613555565b73ffffffffffffffffffffffffffffffffffffffff16609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612f38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60ce60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612ff7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4163636f756e74206973206e6f74206578636c7564656400000000000000000081525060200191505060405180910390fd5b60005b60cf805490508110156131f6578173ffffffffffffffffffffffffffffffffffffffff1660cf828154811061302b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156131e95760cf600160cf80549050038154811061308757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660cf82815481106130bf57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600060cc60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060ce60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060cf8054806131af57fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905590556131f6565b8080600101915050612ffa565b5050565b600060019054906101000a900460ff16806132195750613218614060565b5b8061322f575060008054906101000a900460ff16155b613284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806157d9602e913960400191505060405180910390fd5b60008060019054906101000a900460ff1615905080156132d4576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b6133486040518060400160405280600d81526020017f42617333722e66696e616e6365000000000000000000000000000000000000008152506040518060400160405280600581526020017f4261733372000000000000000000000000000000000000000000000000000000815250614077565b6133526009614189565b61335a6141a7565b8160d08190555060d0546000198161336e57fe5b066000190360d181905550613381613555565b60d560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550603260d3819055504260d48190555060d15460cb60006133df613555565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613425613555565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60d0546040518082815260200191505060405180910390a361349c613497613555565b612942565b80156134bd5760008060016101000a81548160ff0219169083151502179055505b5050565b600061350383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506142b5565b905092915050565b600061354d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613f75565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156135e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806158816024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613669576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806156716022913960400191505060405180910390fd5b8060cd60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808284019050838110156137d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080821215613854576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f53616665436173743a2076616c7565206d75737420626520706f73697469766581525060200191505060405180910390fd5b819050919050565b60008083141561386f57600090506138dc565b600082840290508284828161388057fe5b04146138d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061573b6021913960400191505060405180910390fd5b809150505b92915050565b6000806040516020840160008286518360008a6187965a03f1925050508091505092915050565b600080600080600080600061391e898961437b565b91509150600061392c614035565b9050600080600061393e8d86866143cf565b92509250925082828288889a509a509a509a509a505050505050509295509295909350565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156139e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061585c6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613a6f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806156286023913960400191505060405180910390fd5b60008111613ac8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806157b06029913960400191505060405180910390fd5b60ce60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015613b6b575060ce60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15613c5d574260d65410613c4a5760d754811115613bd4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806157046037913960400191505060405180910390fd5b60d854613bf282613be48561215a565b61375490919063ffffffff16565b1115613c49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615807602b913960400191505060405180910390fd5b5b613c5883838360d35461442d565b613f70565b60ce60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015613d00575060ce60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15613d35574260d65410613d2157613d1c83838360d954614682565b613d30565b613d2f83838360d354614682565b5b613f6f565b60ce60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015613dd9575060ce60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15613e4b574260d65410613e38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260498152602001806156bb6049913960600191505060405180910390fd5b613e4683838360d3546148d7565b613f6e565b60ce60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015613eed575060ce60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15613f0457613eff8383836000614a97565b613f6d565b4260d65410613f5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260498152602001806156bb6049913960600191505060405180910390fd5b613f6c83838360d3546148d7565b5b5b5b5b505050565b6000838311158290614022576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613fe7578082015181840152602081019050613fcc565b50505050905090810190601f1680156140145780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000806000614042614d81565b9150915061405981836134c190919063ffffffff16565b9250505090565b6000803090506000813b9050600081149250505090565b600060019054906101000a900460ff16806140965750614095614060565b5b806140ac575060008054906101000a900460ff16155b614101576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806157d9602e913960400191505060405180910390fd5b60008060019054906101000a900460ff161590508015614151576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b614159615012565b6141638383615110565b80156141845760008060016101000a81548160ff0219169083151502179055505b505050565b80606a60006101000a81548160ff021916908360ff16021790555050565b600060019054906101000a900460ff16806141c657506141c5614060565b5b806141dc575060008054906101000a900460ff16155b614231576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806157d9602e913960400191505060405180910390fd5b60008060019054906101000a900460ff161590508015614281576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b614289615012565b61429161525a565b80156142b25760008060016101000a81548160ff0219169083151502179055505b50565b60008083118290614361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561432657808201518184015260208101905061430b565b50505050905090810190601f1680156143535780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161436d57fe5b049050809150509392505050565b60008060006143a7612710614399868861385c90919063ffffffff16565b6134c190919063ffffffff16565b905060006143be828761350b90919063ffffffff16565b905080829350935050509250929050565b6000806000806143e8858861385c90919063ffffffff16565b905060006143ff868861385c90919063ffffffff16565b90506000614416828461350b90919063ffffffff16565b905082818395509550955050505093509350939050565b600080600080600061443f8787613909565b9450945094509450945061449b8760cc60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461350b90919063ffffffff16565b60cc60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506145308560cb60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461350b90919063ffffffff16565b60cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506145c58460cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461375490919063ffffffff16565b60cb60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506146128382615401565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050505050505050565b60008060008060006146948787613909565b945094509450945094506146f08560cb60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461350b90919063ffffffff16565b60cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506147858260cc60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461375490919063ffffffff16565b60cc60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061481a8460cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461375490919063ffffffff16565b60cb60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506148678382615401565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050505050505050565b60008060008060006148e98787613909565b945094509450945094506149458560cb60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461350b90919063ffffffff16565b60cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506149da8460cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461375490919063ffffffff16565b60cb60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614a278382615401565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050505050505050565b6000806000806000614aa98787613909565b94509450945094509450614b058760cc60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461350b90919063ffffffff16565b60cc60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614b9a8560cb60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461350b90919063ffffffff16565b60cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614c2f8260cc60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461375490919063ffffffff16565b60cc60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614cc48460cb60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461375490919063ffffffff16565b60cb60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614d118382615401565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050505050505050565b600080600060d1549050600060d054905060005b60cf80549050811015614fd5578260cb600060cf8481548110614db457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180614e9b57508160cc600060cf8481548110614e3357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15614eb25760d15460d0549450945050505061500e565b614f3b60cb600060cf8481548110614ec657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461350b90919063ffffffff16565b9250614fc660cc600060cf8481548110614f5157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361350b90919063ffffffff16565b91508080600101915050614d95565b50614fed60d05460d1546134c190919063ffffffff16565b8210156150055760d15460d05493509350505061500e565b81819350935050505b9091565b600060019054906101000a900460ff16806150315750615030614060565b5b80615047575060008054906101000a900460ff16155b61509c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806157d9602e913960400191505060405180910390fd5b60008060019054906101000a900460ff1615905080156150ec576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b801561510d5760008060016101000a81548160ff0219169083151502179055505b50565b600060019054906101000a900460ff168061512f575061512e614060565b5b80615145575060008054906101000a900460ff16155b61519a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806157d9602e913960400191505060405180910390fd5b60008060019054906101000a900460ff1615905080156151ea576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b826068908051906020019061520092919061558a565b50816069908051906020019061521792919061558a565b506012606a60006101000a81548160ff021916908360ff16021790555080156152555760008060016101000a81548160ff0219169083151502179055505b505050565b600060019054906101000a900460ff16806152795750615278614060565b5b8061528f575060008054906101000a900460ff16155b6152e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806157d9602e913960400191505060405180910390fd5b60008060019054906101000a900460ff161590508015615334576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b600061533e613555565b905080609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35080156153fe5760008060016101000a81548160ff0219169083151502179055505b50565b6154168260d15461350b90919063ffffffff16565b60d1819055506154318160d25461375490919063ffffffff16565b60d2819055505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061547c57805160ff19168380011785556154aa565b828001600101855582156154aa579182015b828111156154a957825182559160200191906001019061548e565b5b5090506154b7919061560a565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106154f45780548555615531565b8280016001018555821561553157600052602060002091601f016020900482015b82811115615530578254825591600101919060010190615515565b5b50905061553e919061560a565b5090565b50805460018160011615610100020316600290046000825580601f106155685750615587565b601f016020900490600052602060002090810190615586919061560a565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106155cb57805160ff19168380011785556155f9565b828001600101855582156155f9579182015b828111156155f85782518255916020019190600101906155dd565b5b509050615606919061560a565b5090565b5b8082111561562357600081600090555060010161560b565b509056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373696e646578206d75737420626520696e2072616e6765206f662073746f726564207478206c697374496e697469616c20556e6973776170206c697374696e67202d2057616c6c657420746f2057616c6c6574207472616e73666572732074656d706f726172696c792064697361626c6564496e697469616c20556e6973776170206c697374696e67202d20616d6f756e742065786365656473207472616e73666572206c696d6974536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220666565206368616e6765732074696d656c6f636b656420666f7220313220686f7572735472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564496e697469616c20556e6973776170206c697374696e67202d206d61782062616c616e6365206c696d6974416d6f756e74206d757374206265206c657373207468616e20746f74616c2072656672616374696f6e7345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734578636c75646564206164647265737365732063616e6e6f742063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220bdc9c3d6815683c8d15e0915d61388c0850441f4f8219032db50183f447c439664736f6c634300060c0033
Verified Source Code Partial Match
Compiler: v0.6.12+commit.27d51765
EVM: istanbul
Optimization: No
BaserFinance.sol 1346 lines
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's uintXX casting operators with added overflow
* checks.
*
* Downcasting from uint256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*
* Can be combined with {SafeMath} to extend it to smaller types, by performing
* all math on `uint256` and then downcasting.
*/
library SafeCast {
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
require(value < 2**255, "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/Initializable.sol
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/GSN/Context.sol
pragma solidity ^0.6.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 GSN 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.
*/
contract ContextUpgradeSafe is Initializable {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
uint256[50] private __gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol
pragma solidity ^0.6.0;
/**
* @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.
*/
contract OwnableUpgradeSafe is Initializable, ContextUpgradeSafe {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal initializer {
__Context_init_unchained();
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal initializer {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view 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;
}
uint256[49] private __gap;
}
// File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.6.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);
}
// File: @openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts-ethereum-package/contracts/utils/Address.sol
pragma solidity ^0.6.2;
/**
* @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) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @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");
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @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 {ERC20MinterPauser}.
*
* 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 ERC20UpgradeSafe is Initializable, ContextUpgradeSafe, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name, string memory symbol) internal initializer {
__Context_init_unchained();
__ERC20_init_unchained(name, symbol);
}
function __ERC20_init_unchained(string memory name, string memory symbol) internal initializer {
_name = name;
_symbol = symbol;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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 {_setupDecimals} is
* called.
*
* 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 returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
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].add(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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
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);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is 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 Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @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 { }
uint256[44] private __gap;
}
contract BaserFinance is ERC20UpgradeSafe, OwnableUpgradeSafe {
using SafeCast for int256;
using SafeMath for uint256;
using Address for address;
struct Transaction {
bool enabled;
address destination;
bytes data;
}
event TransactionFailed(address indexed destination, uint index, bytes data);
// Stable ordering is not guaranteed.
Transaction[] public transactions;
uint256 private _epoch;
event LogRebase(uint256 indexed epoch, uint256 totalSupply);
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private _totalSupply;
uint256 private constant MAX = ~uint256(0);
uint256 private _rTotal;
uint256 private _tFeeTotal;
uint256 private constant DECIMALS = 9;
uint256 private constant RATE_PRECISION = 10 ** DECIMALS;
uint256 public _tFeePercent;
uint256 public _tFeeTimestamp;
address public _rebaser;
uint256 public _limitExpiresTimestamp;
uint256 public _limitTransferAmount;
uint256 public _limitMaxBalance;
uint256 public _limitSellFeePercent;
uint256 public _limitTimestamp;
constructor() public{
initialize(10000000000000);
}
function initialize(uint256 initialSupply)
public
initializer
{
__ERC20_init("Bas3r.finance", "Bas3r");
_setupDecimals(uint8(DECIMALS));
__Ownable_init();
_totalSupply = initialSupply;
_rTotal = (MAX - (MAX % _totalSupply));
_rebaser = _msgSender();
_tFeePercent = 50; //2.00%
_tFeeTimestamp = now;
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _totalSupply);
excludeAccount(_msgSender());
}
function setRebaser(address rebaser) external onlyOwner() {
_rebaser = rebaser;
}
function setTransferFeePercent(uint256 tFeePercent) external onlyOwner() {
require(now >= (_tFeeTimestamp + 12 hours), "Transfer fee changes timelocked for 12 hours");
_tFeePercent = tFeePercent;
_tFeeTimestamp = now;
}
function setLimit(uint256 expiresTimestamp, uint256 transferAmount, uint256 maxBalance, uint256 sellFeePercent) external onlyOwner() {
require(_limitTimestamp == 0, "Limit changes not allowed");
_limitExpiresTimestamp = expiresTimestamp;
_limitTransferAmount = transferAmount;
_limitMaxBalance = maxBalance;
_limitSellFeePercent = sellFeePercent;
_limitTimestamp = now;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function rebase(int256 supplyDelta)
external
returns (uint256)
{
require(_msgSender() == owner() || _msgSender() == _rebaser, "Sender not authorized");
_epoch = _epoch.add(1);
if (supplyDelta == 0) {
emit LogRebase(_epoch, _totalSupply);
return _totalSupply;
}
uint256 uSupplyDelta = (supplyDelta < 0 ? -supplyDelta : supplyDelta).toUint256();
uint256 rate = uSupplyDelta.mul(RATE_PRECISION).div(_totalSupply);
uint256 multiplier;
if (supplyDelta < 0) {
multiplier = RATE_PRECISION.sub(rate);
} else {
multiplier = RATE_PRECISION.add(rate);
}
if (supplyDelta < 0) {
_totalSupply = _totalSupply.sub(uSupplyDelta);
} else {
_totalSupply = _totalSupply.add(uSupplyDelta);
}
if (_totalSupply > MAX) {
_totalSupply = MAX;
}
for (uint256 i = 0; i < _excluded.length; i++) {
if(_tOwned[_excluded[i]] > 0) {
_tOwned[_excluded[i]] = _tOwned[_excluded[i]].mul(multiplier).div(RATE_PRECISION);
}
}
emit LogRebase(_epoch, _totalSupply);
for (uint i = 0; i < transactions.length; i++) {
Transaction storage t = transactions[i];
if (t.enabled) {
bool result = externalCall(t.destination, t.data);
if (!result) {
emit TransactionFailed(t.destination, i, t.data);
revert("Transaction Failed");
}
}
}
return _totalSupply;
}
/**
* @notice Adds a transaction that gets called for a downstream receiver of rebases
* @param destination Address of contract destination
* @param data Transaction data payload
*/
function addTransaction(address destination, bytes memory data)
external
onlyOwner
{
transactions.push(Transaction({
enabled: true,
destination: destination,
data: data
}));
}
/**
* @param index Index of transaction to remove.
* Transaction ordering may have changed since adding.
*/
function removeTransaction(uint index)
external
onlyOwner
{
require(index < transactions.length, "index out of bounds");
if (index < transactions.length - 1) {
transactions[index] = transactions[transactions.length - 1];
}
transactions.pop();
}
/**
* @param index Index of transaction. Transaction ordering may have changed since adding.
* @param enabled True for enabled, false for disabled.
*/
function setTransactionEnabled(uint index, bool enabled)
external
onlyOwner
{
require(index < transactions.length, "index must be in range of stored tx list");
transactions[index].enabled = enabled;
}
/**
* @return Number of transactions, both enabled and disabled, in transactions list.
*/
function transactionsSize()
external
view
returns (uint256)
{
return transactions.length;
}
/**
* @dev wrapper to call the encoded transactions on downstream consumers.
* @param destination Address of destination contract.
* @param data The encoded data payload.
* @return True on success
*/
function externalCall(address destination, bytes memory data)
internal
returns (bool)
{
bool result;
assembly { // solhint-disable-line no-inline-assembly
// "Allocate" memory for output
// (0x40 is where "free memory" pointer is stored by convention)
let outputAddress := mload(0x40)
// First 32 bytes are the padded length of data, so exclude that
let dataAddress := add(data, 32)
result := call(
// 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB)
// + callValueTransferGas (9000) + callNewAccountGas
// (25000, in case the destination address does not exist and needs creating)
sub(gas(), 34710),
destination,
0, // transfer value in wei
dataAddress,
mload(data), // Size of the input, in bytes. Stored in position 0 of the array.
outputAddress,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromRefraction(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual override returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual override returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function refract(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount, _tFeePercent);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);
}
function refractionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _totalSupply, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount, _tFeePercent);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount, _tFeePercent);
return rTransferAmount;
}
}
function tokenFromRefraction(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total refractions");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function excludeAccount(address account) public onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromRefraction(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) public onlyOwner() {
require(_isExcluded[account], "Account is not excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) internal override {
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);
}
function _transfer(address sender, address recipient, uint256 amount) internal override {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(_isExcluded[sender] && !_isExcluded[recipient]) {
if(_limitExpiresTimestamp >= now) {
require(amount <= _limitTransferAmount, "Initial Uniswap listing - amount exceeds transfer limit");
require(balanceOf(recipient).add(amount) <= _limitMaxBalance, "Initial Uniswap listing - max balance limit");
}
_transferFromExcluded(sender, recipient, amount, _tFeePercent);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
if(_limitExpiresTimestamp >= now) {
_transferToExcluded(sender, recipient, amount, _limitSellFeePercent);
} else {
_transferToExcluded(sender, recipient, amount, _tFeePercent);
}
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
require(_limitExpiresTimestamp < now, "Initial Uniswap listing - Wallet to Wallet transfers temporarily disabled");
_transferStandard(sender, recipient, amount, _tFeePercent);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount, 0);
} else {
require(_limitExpiresTimestamp < now, "Initial Uniswap listing - Wallet to Wallet transfers temporarily disabled");
_transferStandard(sender, recipient, amount, _tFeePercent);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount, uint256 tFeePercent) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, tFeePercent);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_refractFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount, uint256 tFeePercent) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, tFeePercent);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_refractFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount, uint256 tFeePercent) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, tFeePercent);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_refractFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount, uint256 tFeePercent) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount, tFeePercent);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_refractFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _refractFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount, uint256 tFeePercent) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount, tFeePercent);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount, uint256 tFeePercent) private pure returns (uint256, uint256) {
uint256 tFee = tAmount.mul(tFeePercent).div(10000);
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _totalSupply;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _totalSupply);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_totalSupply)) return (_rTotal, _totalSupply);
return (rSupply, tSupply);
}
}
Read Contract
_limitExpiresTimestamp 0x38a9ad1d → uint256
_limitMaxBalance 0x456e0a5d → uint256
_limitSellFeePercent 0x7d449789 → uint256
_limitTimestamp 0x08d1dd8a → uint256
_limitTransferAmount 0x2bc1281e → uint256
_rebaser 0x3aa8d4be → address
_tFeePercent 0x2ae427dc → uint256
_tFeeTimestamp 0xaef7f99e → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
isExcluded 0xcba0e996 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
refractionFromToken 0x97d0677b → uint256
symbol 0x95d89b41 → string
tokenFromRefraction 0x303bb0b6 → uint256
totalFees 0x13114a9d → uint256
totalSupply 0x18160ddd → uint256
transactions 0x9ace38c2 → bool, address, bytes
transactionsSize 0x91d4ec18 → uint256
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
addTransaction 0x126e19be
address destination
bytes data
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeAccount 0xf2cc0c18
address account
includeAccount 0xf84354f1
address account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
initialize 0xfe4b84df
uint256 initialSupply
rebase 0x0ab114f9
int256 supplyDelta
returns: uint256
refract 0x14f43f7e
uint256 tAmount
removeTransaction 0x46c3bd1f
uint256 index
renounceOwnership 0x715018a6
No parameters
setLimit 0x5c1eca84
uint256 expiresTimestamp
uint256 transferAmount
uint256 maxBalance
uint256 sellFeePercent
setRebaser 0xe46adf62
address rebaser
setTransactionEnabled 0x6e9dde99
uint256 index
bool enabled
setTransferFeePercent 0x1f36d925
uint256 tFeePercent
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address