Address Contract Verified
Address
0xBd58a0A10d01b99BDd912ca8f0f89c93F348092D
Balance
0 ETH
Nonce
1
Code Size
16126 bytes
Creator
0xBBA2b0d0...d8B8 at tx 0x336920fe...bc3e74
Indexed Transactions
0
Contract Bytecode
16126 bytes
0x6080604052600436106101e25760003560e01c8063805dffb111610102578063978bbdb911610095578063d0202d3b11610064578063d0202d3b14610655578063f160d36914610680578063f2fde38b146106a9578063f4463743146106d2576101e2565b8063978bbdb9146105ad578063b1494290146105d8578063c6bbd5a714610601578063cf7398c81461062c576101e2565b8063857c7e90116100d1578063857c7e90146105105780638910c5441461053b5780638c04166f146105575780638da5cb5b14610582576101e2565b8063805dffb1146104755780638322fff2146104915780638456cb59146104bc57806385444d03146104d3576101e2565b8063469048401161017a57806360db96d71161014957806360db96d7146103e157806361c9a7361461040c578063715018a6146104355780637b84fda51461044c576101e2565b8063469048401461032557806353f7c587146103505780635c975abb146103795780635df4f353146103a4576101e2565b80632c76d7a6116101b65780632c76d7a61461028d5780632f48ab7d146102b85780633e413bee146102e35780633f4ba83a1461030e576101e2565b806279eb4e146101e757806303b9c5ad146102105780630c72f4a21461023957806315b0d49614610264575b600080fd5b3480156101f357600080fd5b5061020e600480360381019061020991906128e6565b6106fb565b005b34801561021c57600080fd5b50610237600480360381019061023291906129f0565b610741565b005b34801561024557600080fd5b5061024e6107ee565b60405161025b9190612ad6565b60405180910390f35b34801561027057600080fd5b5061028b60048036038101906102869190612b2e565b61087c565b005b34801561029957600080fd5b506102a261088e565b6040516102af9190612bda565b60405180910390f35b3480156102c457600080fd5b506102cd6108b4565b6040516102da9190612c16565b60405180910390f35b3480156102ef57600080fd5b506102f86108da565b6040516103059190612c16565b60405180910390f35b34801561031a57600080fd5b50610323610900565b005b34801561033157600080fd5b5061033a610912565b6040516103479190612c16565b60405180910390f35b34801561035c57600080fd5b5061037760048036038101906103729190612c31565b610938565b005b34801561038557600080fd5b5061038e610f24565b60405161039b9190612c8c565b60405180910390f35b3480156103b057600080fd5b506103cb60048036038101906103c69190612cd3565b610f3b565b6040516103d89190612c8c565b60405180910390f35b3480156103ed57600080fd5b506103f6610f5b565b6040516104039190612ad6565b60405180910390f35b34801561041857600080fd5b50610433600480360381019061042e9190612d00565b610fe9565b005b34801561044157600080fd5b5061044a6112d3565b005b34801561045857600080fd5b50610473600480360381019061046e9190612b2e565b6112e7565b005b61048f600480360381019061048a9190612db6565b6112f9565b005b34801561049d57600080fd5b506104a66113ab565b6040516104b39190612c16565b60405180910390f35b3480156104c857600080fd5b506104d16113b0565b005b3480156104df57600080fd5b506104fa60048036038101906104f59190612f26565b6113c2565b6040516105079190612f91565b60405180910390f35b34801561051c57600080fd5b506105256115db565b6040516105329190612ad6565b60405180910390f35b61055560048036038101906105509190612b2e565b611669565b005b34801561056357600080fd5b5061056c61168e565b6040516105799190612f91565b60405180910390f35b34801561058e57600080fd5b50610597611694565b6040516105a49190612c16565b60405180910390f35b3480156105b957600080fd5b506105c26116be565b6040516105cf9190612f91565b60405180910390f35b3480156105e457600080fd5b506105ff60048036038101906105fa9190612fac565b6116c4565b005b34801561060d57600080fd5b50610616611752565b604051610623919061300d565b60405180910390f35b34801561063857600080fd5b50610653600480360381019061064e9190612c31565b611778565b005b34801561066157600080fd5b5061066a611d64565b6040516106779190612c16565b60405180910390f35b34801561068c57600080fd5b506106a760048036038101906106a29190612cd3565b611d8a565b005b3480156106b557600080fd5b506106d060048036038101906106cb9190612cd3565b611dd6565b005b3480156106de57600080fd5b506106f960048036038101906106f491906129f0565b611e5a565b005b610703611f07565b858560d191906107149291906127ca565b50838360d291906107269291906127ca565b50818160d391906107389291906127ca565b50505050505050565b610749611f07565b60005b828290508110156107e957600160d460008585858181106107705761076f613028565b5b90506020020160208101906107859190612cd3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107e190613086565b91505061074c565b505050565b60d180546107fb906130fe565b80601f0160208091040260200160405190810160405280929190818152602001828054610827906130fe565b80156108745780601f1061084957610100808354040283529160200191610874565b820191906000526020600020905b81548152906001019060200180831161085757829003601f168201915b505050505081565b610884611f07565b8060cf8190555050565b60cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60ce60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610908611f07565b610910611f85565b565b60c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610940611fe8565b60008211610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097a9061318d565b60405180910390fd5b600061271060ca548461099691906131ad565b6109a09190613236565b9050600081846109b09190613267565b905060cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3360c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518463ffffffff1660e01b8152600401610a339392919061329b565b602060405180830381600087803b158015610a4d57600080fd5b505af1158015610a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8591906132fe565b5060cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401610ae59392919061329b565b602060405180830381600087803b158015610aff57600080fd5b505af1158015610b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3791906132fe565b506000610bce8260d28054610b4b906130fe565b80601f0160208091040260200160405190810160405280929190818152602001828054610b77906130fe565b8015610bc45780601f10610b9957610100808354040283529160200191610bc4565b820191906000526020600020905b815481529060010190602001808311610ba757829003601f168201915b50505050506113c2565b9050606460cf5482610be091906131ad565b610bea9190613236565b81610bf59190613267565b841015610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90613377565b60405180910390fd5b60cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401610cb6929190613397565b602060405180830381600087803b158015610cd057600080fd5b505af1158015610ce4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0891906132fe565b506000604051806080016040528060d28054610d23906130fe565b80601f0160208091040260200160405190810160405280929190818152602001828054610d4f906130fe565b8015610d9c5780601f10610d7157610100808354040283529160200191610d9c565b820191906000526020600020905b815481529060010190602001808311610d7f57829003601f168201915b505050505081526020013373ffffffffffffffffffffffffffffffffffffffff168152602001848152602001868152509050600060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b858183f836040518263ffffffff1660e01b8152600401610e2b919061348b565b602060405180830381600087803b158015610e4557600080fd5b505af1158015610e59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7d91906134c2565b905060cd60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16813373ffffffffffffffffffffffffffffffffffffffff167f4d8aead3491b7eba4b5c7a65fc17e493b9e63f9e433522fc5f6a85a168fc9d368764e8d4a5100089610f0391906131ad565b42604051610f13939291906134ef565b60405180910390a450505050505050565b6000609760009054906101000a900460ff16905090565b60d46020528060005260406000206000915054906101000a900460ff1681565b60d38054610f68906130fe565b80601f0160208091040260200160405190810160405280929190818152602001828054610f94906130fe565b8015610fe15780601f10610fb657610100808354040283529160200191610fe1565b820191906000526020600020905b815481529060010190602001808311610fc457829003601f168201915b505050505081565b60008060019054906101000a900460ff1615905080801561101a5750600160008054906101000a900460ff1660ff16105b80611047575061102930612032565b1580156110465750600160008054906101000a900460ff1660ff16145b5b611086576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107d90613598565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156110c3576001600060016101000a81548160ff0219169083151502179055505b6110cb612055565b6110d36120c1565b6110db612122565b8860c960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508760ca819055508660cb60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508560cd60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460ce60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360cf819055508260d060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160cc60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080156112c85760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516112bf9190613600565b60405180910390a15b505050505050505050565b6112db611f07565b6112e5600061217a565b565b6112ef611f07565b8060ca8190555050565b611301611fe8565b611309612240565b60d460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90613667565b60405180910390fd5b61139f8282612290565b6113a7612619565b5050565b600081565b6113b8611f07565b6113c0612622565b565b600080601483510360208401015190508060601c73ffffffffffffffffffffffffffffffffffffffff1660d060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145c906136d3565b60405180910390fd5b600063cdca175360e01b84866040516024016114829291906136f3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060008060cc60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360405161152b919061375f565b6000604051808303816000865af19150503d8060008114611568576040519150601f19603f3d011682016040523d82523d6000602084013e61156d565b606091505b5091509150816115b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a9906137c2565b60405180910390fd5b6000818060200190518101906115c891906139d0565b5050509050809550505050505092915050565b60d280546115e8906130fe565b80601f0160208091040260200160405190810160405280929190818152602001828054611614906130fe565b80156116615780601f1061163657610100808354040283529160200191611661565b820191906000526020600020905b81548152906001019060200180831161164457829003601f168201915b505050505081565b611671611fe8565b611679612240565b6116833382612290565b61168b612619565b50565b60cf5481565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60ca5481565b6116cc611f07565b8060cb60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160cc60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60cc60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611780611fe8565b600082116117c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ba9061318d565b60405180910390fd5b600061271060ca54846117d691906131ad565b6117e09190613236565b9050600081846117f09190613267565b905060ce60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3360c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518463ffffffff1660e01b81526004016118739392919061329b565b602060405180830381600087803b15801561188d57600080fd5b505af11580156118a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c591906132fe565b5060ce60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016119259392919061329b565b602060405180830381600087803b15801561193f57600080fd5b505af1158015611953573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197791906132fe565b506000611a0e8260d3805461198b906130fe565b80601f01602080910402602001604051908101604052809291908181526020018280546119b7906130fe565b8015611a045780601f106119d957610100808354040283529160200191611a04565b820191906000526020600020905b8154815290600101906020018083116119e757829003601f168201915b50505050506113c2565b9050606460cf5482611a2091906131ad565b611a2a9190613236565b81611a359190613267565b841015611a77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6e90613377565b60405180910390fd5b60ce60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401611af6929190613397565b602060405180830381600087803b158015611b1057600080fd5b505af1158015611b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4891906132fe565b506000604051806080016040528060d38054611b63906130fe565b80601f0160208091040260200160405190810160405280929190818152602001828054611b8f906130fe565b8015611bdc5780601f10611bb157610100808354040283529160200191611bdc565b820191906000526020600020905b815481529060010190602001808311611bbf57829003601f168201915b505050505081526020013373ffffffffffffffffffffffffffffffffffffffff168152602001848152602001868152509050600060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b858183f836040518263ffffffff1660e01b8152600401611c6b919061348b565b602060405180830381600087803b158015611c8557600080fd5b505af1158015611c99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cbd91906134c2565b905060ce60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16813373ffffffffffffffffffffffffffffffffffffffff167f4d8aead3491b7eba4b5c7a65fc17e493b9e63f9e433522fc5f6a85a168fc9d368764e8d4a5100089611d4391906131ad565b42604051611d53939291906134ef565b60405180910390a450505050505050565b60d060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611d92611f07565b8060c960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611dde611f07565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4590613ae1565b60405180910390fd5b611e578161217a565b50565b611e62611f07565b60005b82829050811015611f0257600060d46000858585818110611e8957611e88613028565b5b9050602002016020810190611e9e9190612cd3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611efa90613086565b915050611e65565b505050565b611f0f612685565b73ffffffffffffffffffffffffffffffffffffffff16611f2d611694565b73ffffffffffffffffffffffffffffffffffffffff1614611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7a90613b4d565b60405180910390fd5b565b611f8d61268d565b6000609760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611fd1612685565b604051611fde9190612c16565b60405180910390a1565b611ff0610f24565b15612030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202790613bb9565b60405180910390fd5b565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff166120a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209b90613c4b565b60405180910390fd5b6000609760006101000a81548160ff021916908315150217905550565b600060019054906101000a900460ff16612110576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210790613c4b565b60405180910390fd5b61212061211b612685565b61217a565b565b600060019054906101000a900460ff16612171576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216890613c4b565b60405180910390fd5b60018081905550565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60026001541415612286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227d90613cb7565b60405180910390fd5b6002600181905550565b600034116122d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ca9061318d565b60405180910390fd5b600061271060ca54346122e691906131ad565b6122f09190613236565b9050600081346123009190613267565b905061232e60c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836126d6565b60006123c48260d18054612341906130fe565b80601f016020809104026020016040519081016040528092919081815260200182805461236d906130fe565b80156123ba5780601f1061238f576101008083540402835291602001916123ba565b820191906000526020600020905b81548152906001019060200180831161239d57829003601f168201915b50505050506113c2565b9050606460cf54826123d691906131ad565b6123e09190613236565b816123eb9190613267565b84101561242d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242490613377565b60405180910390fd5b6000604051806080016040528060d18054612447906130fe565b80601f0160208091040260200160405190810160405280929190818152602001828054612473906130fe565b80156124c05780601f10612495576101008083540402835291602001916124c0565b820191906000526020600020905b8154815290600101906020018083116124a357829003601f168201915b505050505081526020018773ffffffffffffffffffffffffffffffffffffffff168152602001848152602001868152509050600060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b858183f85846040518363ffffffff1660e01b8152600401612550919061348b565b6020604051808303818588803b15801561256957600080fd5b505af115801561257d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906125a291906134c2565b9050600073ffffffffffffffffffffffffffffffffffffffff16813373ffffffffffffffffffffffffffffffffffffffff167f4d8aead3491b7eba4b5c7a65fc17e493b9e63f9e433522fc5f6a85a168fc9d368760004260405161260893929190613d12565b60405180910390a450505050505050565b60018081905550565b61262a611fe8565b6001609760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861266e612685565b60405161267b9190612c16565b60405180910390a1565b600033905090565b612695610f24565b6126d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126cb90613d95565b60405180910390fd5b565b80471015612719576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161271090613e01565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161273f90613e47565b60006040518083038185875af1925050503d806000811461277c576040519150601f19603f3d011682016040523d82523d6000602084013e612781565b606091505b50509050806127c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127bc90613ea8565b60405180910390fd5b505050565b8280546127d6906130fe565b90600052602060002090601f0160209004810192826127f8576000855561283f565b82601f1061281157803560ff191683800117855561283f565b8280016001018555821561283f579182015b8281111561283e578235825591602001919060010190612823565b5b50905061284c9190612850565b5090565b5b80821115612869576000816000905550600101612851565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126128a6576128a5612881565b5b8235905067ffffffffffffffff8111156128c3576128c2612886565b5b6020830191508360018202830111156128df576128de61288b565b5b9250929050565b6000806000806000806060878903121561290357612902612877565b5b600087013567ffffffffffffffff8111156129215761292061287c565b5b61292d89828a01612890565b9650965050602087013567ffffffffffffffff8111156129505761294f61287c565b5b61295c89828a01612890565b9450945050604087013567ffffffffffffffff81111561297f5761297e61287c565b5b61298b89828a01612890565b92509250509295509295509295565b60008083601f8401126129b0576129af612881565b5b8235905067ffffffffffffffff8111156129cd576129cc612886565b5b6020830191508360208202830111156129e9576129e861288b565b5b9250929050565b60008060208385031215612a0757612a06612877565b5b600083013567ffffffffffffffff811115612a2557612a2461287c565b5b612a318582860161299a565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612a77578082015181840152602081019050612a5c565b83811115612a86576000848401525b50505050565b6000601f19601f8301169050919050565b6000612aa882612a3d565b612ab28185612a48565b9350612ac2818560208601612a59565b612acb81612a8c565b840191505092915050565b60006020820190508181036000830152612af08184612a9d565b905092915050565b6000819050919050565b612b0b81612af8565b8114612b1657600080fd5b50565b600081359050612b2881612b02565b92915050565b600060208284031215612b4457612b43612877565b5b6000612b5284828501612b19565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612ba0612b9b612b9684612b5b565b612b7b565b612b5b565b9050919050565b6000612bb282612b85565b9050919050565b6000612bc482612ba7565b9050919050565b612bd481612bb9565b82525050565b6000602082019050612bef6000830184612bcb565b92915050565b6000612c0082612b5b565b9050919050565b612c1081612bf5565b82525050565b6000602082019050612c2b6000830184612c07565b92915050565b60008060408385031215612c4857612c47612877565b5b6000612c5685828601612b19565b9250506020612c6785828601612b19565b9150509250929050565b60008115159050919050565b612c8681612c71565b82525050565b6000602082019050612ca16000830184612c7d565b92915050565b612cb081612bf5565b8114612cbb57600080fd5b50565b600081359050612ccd81612ca7565b92915050565b600060208284031215612ce957612ce8612877565b5b6000612cf784828501612cbe565b91505092915050565b600080600080600080600080610100898b031215612d2157612d20612877565b5b6000612d2f8b828c01612cbe565b9850506020612d408b828c01612b19565b9750506040612d518b828c01612cbe565b9650506060612d628b828c01612cbe565b9550506080612d738b828c01612cbe565b94505060a0612d848b828c01612b19565b93505060c0612d958b828c01612cbe565b92505060e0612da68b828c01612cbe565b9150509295985092959890939650565b60008060408385031215612dcd57612dcc612877565b5b6000612ddb85828601612cbe565b9250506020612dec85828601612b19565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612e3382612a8c565b810181811067ffffffffffffffff82111715612e5257612e51612dfb565b5b80604052505050565b6000612e6561286d565b9050612e718282612e2a565b919050565b600067ffffffffffffffff821115612e9157612e90612dfb565b5b612e9a82612a8c565b9050602081019050919050565b82818337600083830152505050565b6000612ec9612ec484612e76565b612e5b565b905082815260208101848484011115612ee557612ee4612df6565b5b612ef0848285612ea7565b509392505050565b600082601f830112612f0d57612f0c612881565b5b8135612f1d848260208601612eb6565b91505092915050565b60008060408385031215612f3d57612f3c612877565b5b6000612f4b85828601612b19565b925050602083013567ffffffffffffffff811115612f6c57612f6b61287c565b5b612f7885828601612ef8565b9150509250929050565b612f8b81612af8565b82525050565b6000602082019050612fa66000830184612f82565b92915050565b60008060408385031215612fc357612fc2612877565b5b6000612fd185828601612cbe565b9250506020612fe285828601612cbe565b9150509250929050565b6000612ff782612ba7565b9050919050565b61300781612fec565b82525050565b60006020820190506130226000830184612ffe565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061309182612af8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130c4576130c3613057565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061311657607f821691505b6020821081141561312a576131296130cf565b5b50919050565b600082825260208201905092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000613177601d83613130565b915061318282613141565b602082019050919050565b600060208201905081810360008301526131a68161316a565b9050919050565b60006131b882612af8565b91506131c383612af8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb613057565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061324182612af8565b915061324c83612af8565b92508261325c5761325b613207565b5b828204905092915050565b600061327282612af8565b915061327d83612af8565b9250828210156132905761328f613057565b5b828203905092915050565b60006060820190506132b06000830186612c07565b6132bd6020830185612c07565b6132ca6040830184612f82565b949350505050565b6132db81612c71565b81146132e657600080fd5b50565b6000815190506132f8816132d2565b92915050565b60006020828403121561331457613313612877565b5b6000613322848285016132e9565b91505092915050565b7f4d617820736c6970706167652056330000000000000000000000000000000000600082015250565b6000613361600f83613130565b915061336c8261332b565b602082019050919050565b6000602082019050818103600083015261339081613354565b9050919050565b60006040820190506133ac6000830185612c07565b6133b96020830184612f82565b9392505050565b600082825260208201905092915050565b60006133dc82612a3d565b6133e681856133c0565b93506133f6818560208601612a59565b6133ff81612a8c565b840191505092915050565b61341381612bf5565b82525050565b61342281612af8565b82525050565b6000608083016000830151848203600086015261344582826133d1565b915050602083015161345a602086018261340a565b50604083015161346d6040860182613419565b5060608301516134806060860182613419565b508091505092915050565b600060208201905081810360008301526134a58184613428565b905092915050565b6000815190506134bc81612b02565b92915050565b6000602082840312156134d8576134d7612877565b5b60006134e6848285016134ad565b91505092915050565b60006060820190506135046000830186612f82565b6135116020830185612f82565b61351e6040830184612f82565b949350505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000613582602e83613130565b915061358d82613526565b604082019050919050565b600060208201905081810360008301526135b181613575565b9050919050565b6000819050919050565b600060ff82169050919050565b60006135ea6135e56135e0846135b8565b612b7b565b6135c2565b9050919050565b6135fa816135cf565b82525050565b600060208201905061361560008301846135f1565b92915050565b7f55736572206e6f742077686974656c697374656420666f722074686973207478600082015250565b6000613651602083613130565b915061365c8261361b565b602082019050919050565b6000602082019050818103600083015261368081613644565b9050919050565b7f4e6f742074686520636f727265637420746f6b656e0000000000000000000000600082015250565b60006136bd601583613130565b91506136c882613687565b602082019050919050565b600060208201905081810360008301526136ec816136b0565b9050919050565b6000604082019050818103600083015261370d8185612a9d565b905061371c6020830184612f82565b9392505050565b600081905092915050565b600061373982612a3d565b6137438185613723565b9350613753818560208601612a59565b80840191505092915050565b600061376b828461372e565b915081905092915050565b7f43616c6c20746f2051756f746572206661696c65640000000000000000000000600082015250565b60006137ac601583613130565b91506137b782613776565b602082019050919050565b600060208201905081810360008301526137db8161379f565b9050919050565b600067ffffffffffffffff8211156137fd576137fc612dfb565b5b602082029050602081019050919050565b61381781612b5b565b811461382257600080fd5b50565b6000815190506138348161380e565b92915050565b600061384d613848846137e2565b612e5b565b905080838252602082019050602084028301858111156138705761386f61288b565b5b835b8181101561389957806138858882613825565b845260208401935050602081019050613872565b5050509392505050565b600082601f8301126138b8576138b7612881565b5b81516138c884826020860161383a565b91505092915050565b600067ffffffffffffffff8211156138ec576138eb612dfb565b5b602082029050602081019050919050565b600063ffffffff82169050919050565b613916816138fd565b811461392157600080fd5b50565b6000815190506139338161390d565b92915050565b600061394c613947846138d1565b612e5b565b9050808382526020820190506020840283018581111561396f5761396e61288b565b5b835b8181101561399857806139848882613924565b845260208401935050602081019050613971565b5050509392505050565b600082601f8301126139b7576139b6612881565b5b81516139c7848260208601613939565b91505092915050565b600080600080608085870312156139ea576139e9612877565b5b60006139f8878288016134ad565b945050602085015167ffffffffffffffff811115613a1957613a1861287c565b5b613a25878288016138a3565b935050604085015167ffffffffffffffff811115613a4657613a4561287c565b5b613a52878288016139a2565b9250506060613a63878288016134ad565b91505092959194509250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613acb602683613130565b9150613ad682613a6f565b604082019050919050565b60006020820190508181036000830152613afa81613abe565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613b37602083613130565b9150613b4282613b01565b602082019050919050565b60006020820190508181036000830152613b6681613b2a565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000613ba3601083613130565b9150613bae82613b6d565b602082019050919050565b60006020820190508181036000830152613bd281613b96565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000613c35602b83613130565b9150613c4082613bd9565b604082019050919050565b60006020820190508181036000830152613c6481613c28565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000613ca1601f83613130565b9150613cac82613c6b565b602082019050919050565b60006020820190508181036000830152613cd081613c94565b9050919050565b6000819050919050565b6000613cfc613cf7613cf284613cd7565b612b7b565b612af8565b9050919050565b613d0c81613ce1565b82525050565b6000606082019050613d276000830186612f82565b613d346020830185613d03565b613d416040830184612f82565b949350505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b6000613d7f601483613130565b9150613d8a82613d49565b602082019050919050565b60006020820190508181036000830152613dae81613d72565b9050919050565b7f4c6f772062616c616e6365000000000000000000000000000000000000000000600082015250565b6000613deb600b83613130565b9150613df682613db5565b602082019050919050565b60006020820190508181036000830152613e1a81613dde565b9050919050565b50565b6000613e31600083613723565b9150613e3c82613e21565b600082019050919050565b6000613e5282613e24565b9150819050919050565b7f455448205061796d656e74206661696c65640000000000000000000000000000600082015250565b6000613e92601283613130565b9150613e9d82613e5c565b602082019050919050565b60006020820190508181036000830152613ec181613e85565b905091905056fea26469706673582212203752e4fdf79cebe50e280a827f7ce71cb5455caf8c944a1772b0452a92077eab64736f6c63430008090033
Verified Source Code Full Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: No
IERC20Upgradeable.sol 78 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
OwnableUpgradeable.sol 95 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
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 onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
Initializable.sol 166 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
PausableUpgradeable.sol 117 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
ReentrancyGuardUpgradeable.sol 89 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
AddressUpgradeable.sol 244 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/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.8.0/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");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
ContextUpgradeable.sol 37 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
Swapper_final.sol 312 lines
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/[email protected]/security/PausableUpgradeable.sol"; import "@openzeppelin/[email protected]/access/OwnableUpgradeable.sol"; import "@openzeppelin/[email protected]/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; interface IQuoter { function quoteExactInput(bytes memory path, uint256 amountIn) external returns (uint256 amountOut); } interface ISwapRouter { struct ExactInputParams { bytes path; address recipient; uint256 amountIn; uint256 amountOutMinimum; } function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); } contract UpgradableOTC is Initializable, ReentrancyGuardUpgradeable, OwnableUpgradeable, PausableUpgradeable { address public feeRecipient; uint256 public feeRate; ISwapRouter public uniswapV3Router; IQuoter public quoter; address public constant ETH = address(0); address public usdc; address public usdt; uint256 public maxSlippage; address public tokenOut; bytes public ethToTokenOutPathV3; bytes public usdcToTokenOutPathV3; bytes public usdtToTokenOutPathV3; mapping(address => bool) public wertWhitelisted; event TokensBought( address indexed user, uint256 indexed tokensBought, address indexed purchaseToken, uint256 amountPaid, uint256 usdEq, uint256 timestamp ); // /// @custom:oz-upgrades-unsafe-allow constructor // constructor() initializer {} function initialize( address _feeRecipient, uint256 _feeRate, address _uniswapV3Router, address _usdc, address _usdt, uint256 _maxSlippage, address _tokenOut, address _quoter ) public initializer { __Pausable_init_unchained(); __Ownable_init_unchained(); __ReentrancyGuard_init_unchained(); feeRecipient = _feeRecipient; feeRate = _feeRate; uniswapV3Router = ISwapRouter(_uniswapV3Router); usdc = _usdc; usdt = _usdt; maxSlippage = _maxSlippage; tokenOut = _tokenOut; quoter = IQuoter(_quoter); } function updatePathV3( bytes calldata _ethToTokenOutPathV3, bytes calldata _usdcToTokenOutPathV3, bytes calldata _usdtToTokenOutPathV3 ) external onlyOwner { ethToTokenOutPathV3 = _ethToTokenOutPathV3; usdcToTokenOutPathV3 = _usdcToTokenOutPathV3; usdtToTokenOutPathV3 = _usdtToTokenOutPathV3; } function updateFeeRecipient(address _newFeeRecipient) external onlyOwner { feeRecipient = _newFeeRecipient; } function updateFeeRate(uint256 _newFeeRate) external onlyOwner { feeRate = _newFeeRate; } function updateQuoterAndRouter(address _quoter, address _uniswapV3Router) external onlyOwner { uniswapV3Router = ISwapRouter(_uniswapV3Router); quoter = IQuoter(_quoter); } function updateSlippage(uint256 _maxSlippage) external onlyOwner { maxSlippage = _maxSlippage; } /** * @dev To pause the presale */ function pause() external onlyOwner { _pause(); } /** * @dev To unpause the presale */ function unpause() external onlyOwner { _unpause(); } function getPriceV3(uint256 amountIn, bytes memory path) public returns (uint256) { bytes20 last20Bytes; assembly { last20Bytes := mload(add(add(path, 0x20), sub(mload(path), 20))) } require( tokenOut == address(uint160(last20Bytes)), "Not the correct token" ); bytes memory data = abi.encodeWithSelector( quoter.quoteExactInput.selector, path, amountIn ); (bool success, bytes memory result) = address(quoter).call(data); require(success, "Call to Quoter failed"); (uint256 amountOut, , , ) = abi.decode( result, (uint256, uint160[], uint32[], uint256) ); return amountOut; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Low balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "ETH Payment failed"); } function buyWithEthV3(uint256 amountOutMin) external payable whenNotPaused nonReentrant { _buyWithEthV3(msg.sender, amountOutMin); } function buyWithUSDCV3(uint256 amountIn, uint256 amountOutMin) external whenNotPaused { require(amountIn > 0, "Amount must be greater than 0"); uint256 fee = (amountIn * feeRate) / 10000; uint256 amountToSwap = amountIn - fee; IERC20Upgradeable(usdc).transferFrom(msg.sender, feeRecipient, fee); IERC20Upgradeable(usdc).transferFrom( msg.sender, address(this), amountToSwap ); uint256 currentAmountOut = getPriceV3( amountToSwap, usdcToTokenOutPathV3 ); require( amountOutMin >= (currentAmountOut - ((currentAmountOut * maxSlippage) / 100)), "Max slippage V3" ); IERC20Upgradeable(usdc).approve(address(uniswapV3Router), amountToSwap); ISwapRouter.ExactInputParams memory params = ISwapRouter .ExactInputParams({ path: usdcToTokenOutPathV3, recipient: msg.sender, amountIn: amountToSwap, amountOutMinimum: amountOutMin }); uint256 amountOut = uniswapV3Router.exactInput(params); emit TokensBought( msg.sender, amountOut, usdc, amountToSwap, amountToSwap * (10**12), block.timestamp ); } function buyWithUSDTV3(uint256 amountIn, uint256 amountOutMin) external whenNotPaused { require(amountIn > 0, "Amount must be greater than 0"); uint256 fee = (amountIn * feeRate) / 10000; uint256 amountToSwap = amountIn - fee; IERC20Upgradeable(usdt).transferFrom(msg.sender, feeRecipient, fee); IERC20Upgradeable(usdt).transferFrom( msg.sender, address(this), amountToSwap ); uint256 currentAmountOut = getPriceV3( amountToSwap, usdtToTokenOutPathV3 ); require( amountOutMin >= (currentAmountOut - ((currentAmountOut * maxSlippage) / 100)), "Max slippage V3" ); IERC20Upgradeable(usdt).approve(address(uniswapV3Router), amountToSwap); ISwapRouter.ExactInputParams memory params = ISwapRouter .ExactInputParams({ path: usdtToTokenOutPathV3, recipient: msg.sender, amountIn: amountToSwap, amountOutMinimum: amountOutMin }); uint256 amountOut = uniswapV3Router.exactInput(params); emit TokensBought( msg.sender, amountOut, usdt, amountToSwap, amountToSwap * (10**12), block.timestamp ); } function buyWithWertV3(address user, uint256 amountOutMin) external payable whenNotPaused nonReentrant { require( wertWhitelisted[msg.sender], "User not whitelisted for this tx" ); _buyWithEthV3(user, amountOutMin); } function _buyWithEthV3(address user, uint256 amountOutMin) internal { require(msg.value > 0, "Amount must be greater than 0"); uint256 fee = (msg.value * feeRate) / 10000; uint256 amountToSwap = msg.value - fee; sendValue(payable(feeRecipient), fee); uint256 currentAmountOut = getPriceV3( amountToSwap, ethToTokenOutPathV3 ); require( amountOutMin >= (currentAmountOut - ((currentAmountOut * maxSlippage) / 100)), "Max slippage V3" ); ISwapRouter.ExactInputParams memory params = ISwapRouter .ExactInputParams({ path: ethToTokenOutPathV3, recipient: user, amountIn: amountToSwap, amountOutMinimum: amountOutMin }); uint256 amountOut = uniswapV3Router.exactInput{value: amountToSwap}( params ); emit TokensBought( msg.sender, amountOut, address(0), amountToSwap, 0, block.timestamp ); } function whitelistUsersForWERT(address[] calldata _addressesToWhitelist) external onlyOwner { for (uint256 i = 0; i < _addressesToWhitelist.length; i++) { wertWhitelisted[_addressesToWhitelist[i]] = true; } } function removeFromWhitelistForWERT( address[] calldata _addressesToRemoveFromWhitelist ) external onlyOwner { for (uint256 i = 0; i < _addressesToRemoveFromWhitelist.length; i++) { wertWhitelisted[_addressesToRemoveFromWhitelist[i]] = false; } } }
Read Contract
ETH 0x8322fff2 → address
ethToTokenOutPathV3 0x0c72f4a2 → bytes
feeRate 0x978bbdb9 → uint256
feeRecipient 0x46904840 → address
maxSlippage 0x8c04166f → uint256
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
quoter 0xc6bbd5a7 → address
tokenOut 0xd0202d3b → address
uniswapV3Router 0x2c76d7a6 → address
usdc 0x3e413bee → address
usdcToTokenOutPathV3 0x857c7e90 → bytes
usdt 0x2f48ab7d → address
usdtToTokenOutPathV3 0x60db96d7 → bytes
wertWhitelisted 0x5df4f353 → bool
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
buyWithEthV3 0x8910c544
uint256 amountOutMin
buyWithUSDCV3 0x53f7c587
uint256 amountIn
uint256 amountOutMin
buyWithUSDTV3 0xcf7398c8
uint256 amountIn
uint256 amountOutMin
buyWithWertV3 0x805dffb1
address user
uint256 amountOutMin
getPriceV3 0x85444d03
uint256 amountIn
bytes path
returns: uint256
initialize 0x61c9a736
address _feeRecipient
uint256 _feeRate
address _uniswapV3Router
address _usdc
address _usdt
uint256 _maxSlippage
address _tokenOut
address _quoter
pause 0x8456cb59
No parameters
removeFromWhitelistForWERT 0xf4463743
address[] _addressesToRemoveFromWhitelist
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
updateFeeRate 0x7b84fda5
uint256 _newFeeRate
updateFeeRecipient 0xf160d369
address _newFeeRecipient
updatePathV3 0x0079eb4e
bytes _ethToTokenOutPathV3
bytes _usdcToTokenOutPathV3
bytes _usdtToTokenOutPathV3
updateQuoterAndRouter 0xb1494290
address _quoter
address _uniswapV3Router
updateSlippage 0x15b0d496
uint256 _maxSlippage
whitelistUsersForWERT 0x03b9c5ad
address[] _addressesToWhitelist
Recent Transactions
No transactions found for this address