From abeb0c7e17a1d934ccdb161936cdbb58952cb5d9 Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 11:34:51 +1000 Subject: [PATCH 1/8] Remove byte code --- frontend/abis/Vester.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/abis/Vester.json b/frontend/abis/Vester.json index 10ca9c6..bf014c4 100644 --- a/frontend/abis/Vester.json +++ b/frontend/abis/Vester.json @@ -896,8 +896,6 @@ "type": "function" } ], - "bytecode": "0x60806040523480156200001157600080fd5b50604051620057f4380380620057f48339818101604052810190620000379190620001f8565b8282816000908051906020019062000051929190620000bf565b5080600190805190602001906200006a929190620000bf565b5050506001600a8190555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050506200043e565b828054620000cd9062000349565b90600052602060002090601f016020900481019282620000f157600085556200013d565b82601f106200010c57805160ff19168380011785556200013d565b828001600101855582156200013d579182015b828111156200013c5782518255916020019190600101906200011f565b5b5090506200014c919062000150565b5090565b5b808211156200016b57600081600090555060010162000151565b5090565b6000620001866200018084620002a9565b62000280565b9050828152602081018484840111156200019f57600080fd5b620001ac84828562000313565b509392505050565b600081519050620001c58162000424565b92915050565b600082601f830112620001dd57600080fd5b8151620001ef8482602086016200016f565b91505092915050565b6000806000606084860312156200020e57600080fd5b600084015167ffffffffffffffff8111156200022957600080fd5b6200023786828701620001cb565b935050602084015167ffffffffffffffff8111156200025557600080fd5b6200026386828701620001cb565b92505060406200027686828701620001b4565b9150509250925092565b60006200028c6200029f565b90506200029a82826200037f565b919050565b6000604051905090565b600067ffffffffffffffff821115620002c757620002c6620003e4565b5b620002d28262000413565b9050602081019050919050565b6000620002ec82620002f3565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60005b838110156200033357808201518184015260208101905062000316565b8381111562000343576000848401525b50505050565b600060028204905060018216806200036257607f821691505b60208210811415620003795762000378620003b5565b5b50919050565b6200038a8262000413565b810181811067ffffffffffffffff82111715620003ac57620003ab620003e4565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6200042f81620002df565b81146200043b57600080fd5b50565b6153a6806200044e6000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c80636352211e1161011a578063b88d4fde116100ad578063e229a0901161007c578063e229a090146105c7578063e626840e146105e3578063e985e9c5146105ff578063f2b9fdb81461062f578063f3fef3a31461064b576101fb565b8063b88d4fde14610541578063c87b56dd1461055d578063d082e3811461058d578063db006a75146105ab576101fb565b806395d89b41116100e957806395d89b41146104bb578063a22cb465146104d9578063abff9d80146104f5578063b6699d0e14610511576101fb565b80636352211e1461043357806370a082311461046357806379ba5097146104935780638da5cb5b1461049d576101fb565b806323b872dd116101925780634f6ccce7116101615780634f6ccce71461039957806353a47bb7146103c95780635b94db27146103e75780635e25ca8a14610403576101fb565b806323b872dd146103275780632f4350c2146103435780632f745c591461034d57806342842e0e1461037d576101fb565b80630c0debea116101ce5780630c0debea1461029a5780630f3d677e146102d1578063102a2a3f146102ed57806318160ddd14610309576101fb565b806301ffc9a71461020057806306fdde0314610230578063081812fc1461024e578063095ea7b31461027e575b600080fd5b61021a60048036038101906102159190613a73565b610667565b604051610227919061421c565b60405180910390f35b6102386106e1565b6040516102459190614237565b60405180910390f35b61026860048036038101906102639190613ac5565b610773565b6040516102759190614155565b60405180910390f35b610298600480360381019061029391906139c9565b6107f8565b005b6102b460048036038101906102af9190613ac5565b610910565b6040516102c89897969594939291906145f4565b60405180910390f35b6102eb60048036038101906102e69190613a05565b610a11565b005b61030760048036038101906103029190613b66565b610a7f565b005b610311610b3a565b60405161031e9190614672565b60405180910390f35b610341600480360381019061033c9190613811565b610b47565b005b61034b610ba7565b005b610367600480360381019061036291906139c9565b610bea565b6040516103749190614672565b60405180910390f35b61039760048036038101906103929190613811565b610c8f565b005b6103b360048036038101906103ae9190613ac5565b610caf565b6040516103c09190614672565b60405180910390f35b6103d1610d46565b6040516103de9190614155565b60405180910390f35b61040160048036038101906103fc91906137ac565b610d6c565b005b61041d60048036038101906104189190613ac5565b610e83565b60405161042a91906145d9565b60405180910390f35b61044d60048036038101906104489190613ac5565b610f40565b60405161045a9190614155565b60405180910390f35b61047d600480360381019061047891906137ac565b610ff2565b60405161048a9190614672565b60405180910390f35b61049b6110aa565b005b6104a5611249565b6040516104b29190614155565b60405180910390f35b6104c361126f565b6040516104d09190614237565b60405180910390f35b6104f360048036038101906104ee919061398d565b611301565b005b61050f600480360381019061050a9190613ac5565b611317565b005b61052b60048036038101906105269190613ac5565b61146a565b60405161053891906145d9565b60405180910390f35b61055b60048036038101906105569190613860565b6115b9565b005b61057760048036038101906105729190613ac5565b61161b565b6040516105849190614237565b60405180910390f35b6105956116c2565b6040516105a29190614672565b60405180910390f35b6105c560048036038101906105c09190613ac5565b6116c8565b005b6105e160048036038101906105dc9190613b17565b6116d6565b005b6105fd60048036038101906105f891906138db565b611717565b005b610619600480360381019061061491906137d5565b611b67565b604051610626919061421c565b60405180910390f35b610649600480360381019061064491906139c9565b611bfb565b005b610665600480360381019061066091906139c9565b611c7c565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106da57506106d982611da0565b5b9050919050565b6060600080546106f0906149d7565b80601f016020809104026020016040519081016040528092919081815260200182805461071c906149d7565b80156107695780601f1061073e57610100808354040283529160200191610769565b820191906000526020600020905b81548152906001019060200180831161074c57829003601f168201915b5050505050905090565b600061077e82611e82565b6107bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b490614499565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061080382610f40565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b906144f9565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610893611eee565b73ffffffffffffffffffffffffffffffffffffffff1614806108c257506108c1816108bc611eee565b611b67565b5b610901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f8906143b9565b60405180910390fd5b61090b8383611ef6565b505050565b600e6020528060005260406000206000915090508060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16908060010160009054906101000a90046fffffffffffffffffffffffffffffffff16908060010160109054906101000a900467ffffffffffffffff16908060010160189054906101000a900467ffffffffffffffff16908060020160009054906101000a900463ffffffff16908060020160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160189054906101000a900460ff16905088565b60005b82829050811015610a7a57610a67838383818110610a5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201356116c8565b8080610a7290614a3a565b915050610a14565b505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0690614259565b60405180910390fd5b610b1888611317565b610b30610b2489610f40565b88888888888888611717565b5050505050505050565b6000600880549050905090565b610b58610b52611eee565b82611faf565b610b97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8e90614519565b60405180910390fd5b610ba283838361208d565b505050565b6000610bb233610ff2565b905060005b81811015610be657610bd3610bcc3383610bea565b60006122e9565b8080610bde90614a3a565b915050610bb7565b5050565b6000610bf583610ff2565b8210610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d90614279565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610caa838383604051806020016040528060008152506115b9565b505050565b6000610cb9610b3a565b8210610cfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf190614559565b60405180910390fd5b60088281548110610d34577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df390614259565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fa43af109f494a1b33d1d9f272a0a84f482e536f260818914271d36d0b47ba00e60405160405180910390a250565b600080610e8f8361146a565b90506000600e600085815260200190815260200160002060010160009054906101000a90046fffffffffffffffffffffffffffffffff169050600e600085815260200190815260200160002060020160189054906101000a900460ff1680610f1a5750806fffffffffffffffffffffffffffffffff16826fffffffffffffffffffffffffffffffff16105b15610f2a57600092505050610f3b565b8082610f369190614879565b925050505b919050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090614419565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105a906143f9565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461110457600080fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606001805461127e906149d7565b80601f01602080910402602001604051908101604052809291908181526020018280546112aa906149d7565b80156112f75780601f106112cc576101008083540402835291602001916112f7565b820191906000526020600020905b8154815290600101906020018083116112da57829003601f168201915b5050505050905090565b61131361130c611eee565b8383612646565b5050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139e90614259565b60405180910390fd5b600e600082815260200190815260200160002060020160189054906101000a900460ff161561140b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140290614439565b60405180910390fd5b6001600e600083815260200190815260200160002060020160186101000a81548160ff021916908315150217905550807f4df93d542273eb976c82d138be4f31cca880a82b7f8209e8281719a1a877fa4860405160405180910390a250565b600080600e600084815260200190815260200160002090508060010160189054906101000a900467ffffffffffffffff1667ffffffffffffffff164210156114b65760009150506115b4565b60008160000160009054906101000a90046fffffffffffffffffffffffffffffffff168260020160009054906101000a900463ffffffff1663ffffffff168360010160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16426115229190614879565b61152c91906147cd565b611536919061482f565b90508160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1611156115ae578160000160109054906101000a90046fffffffffffffffffffffffffffffffff16925050506115b4565b80925050505b919050565b6115ca6115c4611eee565b83611faf565b611609576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160090614519565b60405180910390fd5b611615848484846127b3565b50505050565b606061162682611e82565b611665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165c906144d9565b60405180910390fd5b600061166f61280f565b9050600081511161168f57604051806020016040528060008152506116ba565b8061169984612826565b6040516020016116aa929190614131565b6040516020818303038152906040525b915050919050565b600d5481565b6116d38160016122e9565b50565b60008290506116e4846116c8565b6117113330848473ffffffffffffffffffffffffffffffffffffffff166129d3909392919063ffffffff16565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179e90614259565b60405180910390fd5b60008667ffffffffffffffff16116117f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117eb906142d9565b60405180910390fd5b60008163ffffffff161161183d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183490614319565b60405180910390fd5b826fffffffffffffffffffffffffffffffff16826fffffffffffffffffffffffffffffffff1611156118a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189b906142f9565b60405180910390fd5b6000600d549050600d60008154809291906118be90614a3a565b9190505550604051806101000160405280866fffffffffffffffffffffffffffffffff168152602001856fffffffffffffffffffffffffffffffff168152602001846fffffffffffffffffffffffffffffffff1681526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018363ffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff16815260200160001515815250600e600083815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160020160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e08201518160020160186101000a81548160ff021916908315150217905550905050611b2f8982612a5c565b807f22a2abd07e87b230325c9a9ca7e31611cb7458a525a490f050e656ffb2410c2660405160405180910390a2505050505050505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611c283330838573ffffffffffffffffffffffffffffffffffffffff166129d3909392919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fd1cf3d156d5f8f0d50f6c122ed609cec09d35c9b9fb3fff6ea0959134dae424e3383604051611c709291906141f3565b60405180910390a25050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0390614259565b60405180910390fd5b611d3733828473ffffffffffffffffffffffffffffffffffffffff16612a7a9092919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b639883604051611d949190614672565b60405180910390a35050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611e6b57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611e7b5750611e7a82612b00565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611f6983610f40565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611fba82611e82565b611ff9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff090614399565b60405180910390fd5b600061200483610f40565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061207357508373ffffffffffffffffffffffffffffffffffffffff1661205b84610773565b73ffffffffffffffffffffffffffffffffffffffff16145b8061208457506120838185611b67565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166120ad82610f40565b73ffffffffffffffffffffffffffffffffffffffff1614612103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120fa906144b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612173576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216a90614339565b60405180910390fd5b61217e838383612b6a565b612189600082611ef6565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546121d991906148ad565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122309190614777565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6002600a54141561232f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612326906145b9565b60405180910390fd5b6002600a819055503373ffffffffffffffffffffffffffffffffffffffff1661235783610f40565b73ffffffffffffffffffffffffffffffffffffffff16146123ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a490614479565b60405180910390fd5b60006123b883610e83565b90506000816fffffffffffffffffffffffffffffffff16141561241c578115612416576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240d90614579565b60405180910390fd5b5061263a565b6000600e600085815260200190815260200160002060020160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816fffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016124a39190614155565b60206040518083038186803b1580156124bb57600080fd5b505afa1580156124cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f39190613aee565b1015612534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252b906143d9565b60405180910390fd5b81600e600086815260200190815260200160002060010160008282829054906101000a90046fffffffffffffffffffffffffffffffff166125759190614731565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506125e833836fffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16612a7a9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff16847fdeedc3b2f529d2c0a63d08e4e0a3bbec8e617a02e0f03e9581f4f8c45e8489298460405161262f91906145d9565b60405180910390a350505b6001600a819055505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156126b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ac90614359565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127a6919061421c565b60405180910390a3505050565b6127be84848461208d565b6127ca84848484612c7e565b612809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280090614299565b60405180910390fd5b50505050565b606060405180602001604052806000815250905090565b6060600082141561286e576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506129ce565b600082905060005b600082146128a057808061288990614a3a565b915050600a8261289991906147fe565b9150612876565b60008167ffffffffffffffff8111156128e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156129145781602001600182028036833780820191505090505b5090505b600085146129c75760018261292d91906148ad565b9150600a8561293c9190614a83565b60306129489190614777565b60f81b818381518110612984577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856129c091906147fe565b9450612918565b8093505050505b919050565b612a56846323b872dd60e01b8585856040516024016129f493929190614170565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e15565b50505050565b612a76828260405180602001604052806000815250612edc565b5050565b612afb8363a9059cbb60e01b8484604051602401612a999291906141f3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e15565b505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612b75838383612f37565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612bb857612bb381612f3c565b612bf7565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612bf657612bf58382612f85565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612c3a57612c35816130f2565b612c79565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612c7857612c778282613235565b5b5b505050565b6000612c9f8473ffffffffffffffffffffffffffffffffffffffff166132b4565b15612e08578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612cc8611eee565b8786866040518563ffffffff1660e01b8152600401612cea94939291906141a7565b602060405180830381600087803b158015612d0457600080fd5b505af1925050508015612d3557506040513d601f19601f82011682018060405250810190612d329190613a9c565b60015b612db8573d8060008114612d65576040519150601f19603f3d011682016040523d82523d6000602084013e612d6a565b606091505b50600081511415612db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612da790614299565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612e0d565b600190505b949350505050565b6000612e77826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166132c79092919063ffffffff16565b9050600081511115612ed75780806020019051810190612e979190613a4a565b612ed6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ecd90614599565b60405180910390fd5b5b505050565b612ee683836132df565b612ef36000848484612c7e565b612f32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f2990614299565b60405180910390fd5b505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612f9284610ff2565b612f9c91906148ad565b9050600060076000848152602001908152602001600020549050818114613081576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b6000600160088054905061310691906148ad565b905060006009600084815260200190815260200160002054905060006008838154811061315c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080600883815481106131a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480613219577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061324083610ff2565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600080823b905060008111915050919050565b60606132d684846000856134ad565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561334f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161334690614459565b60405180910390fd5b61335881611e82565b15613398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161338f906142b9565b60405180910390fd5b6133a460008383612b6a565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546133f49190614777565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6060824710156134f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134e990614379565b60405180910390fd5b6134fb856132b4565b61353a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353190614539565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613563919061411a565b60006040518083038185875af1925050503d80600081146135a0576040519150601f19603f3d011682016040523d82523d6000602084013e6135a5565b606091505b50915091506135b58282866135c1565b92505050949350505050565b606083156135d157829050613621565b6000835111156135e45782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136189190614237565b60405180910390fd5b9392505050565b600061363b613636846146b2565b61468d565b90508281526020810184848401111561365357600080fd5b61365e848285614995565b509392505050565b600081359050613675816152cf565b92915050565b60008083601f84011261368d57600080fd5b8235905067ffffffffffffffff8111156136a657600080fd5b6020830191508360208202830111156136be57600080fd5b9250929050565b6000813590506136d4816152e6565b92915050565b6000815190506136e9816152e6565b92915050565b6000813590506136fe816152fd565b92915050565b600081519050613713816152fd565b92915050565b600082601f83011261372a57600080fd5b813561373a848260208601613628565b91505092915050565b60008135905061375281615314565b92915050565b6000813590506137678161532b565b92915050565b60008151905061377c8161532b565b92915050565b60008135905061379181615342565b92915050565b6000813590506137a681615359565b92915050565b6000602082840312156137be57600080fd5b60006137cc84828501613666565b91505092915050565b600080604083850312156137e857600080fd5b60006137f685828601613666565b925050602061380785828601613666565b9150509250929050565b60008060006060848603121561382657600080fd5b600061383486828701613666565b935050602061384586828701613666565b925050604061385686828701613758565b9150509250925092565b6000806000806080858703121561387657600080fd5b600061388487828801613666565b945050602061389587828801613666565b93505060406138a687828801613758565b925050606085013567ffffffffffffffff8111156138c357600080fd5b6138cf87828801613719565b91505092959194509250565b600080600080600080600080610100898b0312156138f857600080fd5b60006139068b828c01613666565b98505060206139178b828c01613666565b97505060406139288b828c01613797565b96505060606139398b828c01613797565b955050608061394a8b828c01613743565b94505060a061395b8b828c01613743565b93505060c061396c8b828c01613743565b92505060e061397d8b828c01613782565b9150509295985092959890939650565b600080604083850312156139a057600080fd5b60006139ae85828601613666565b92505060206139bf858286016136c5565b9150509250929050565b600080604083850312156139dc57600080fd5b60006139ea85828601613666565b92505060206139fb85828601613758565b9150509250929050565b60008060208385031215613a1857600080fd5b600083013567ffffffffffffffff811115613a3257600080fd5b613a3e8582860161367b565b92509250509250929050565b600060208284031215613a5c57600080fd5b6000613a6a848285016136da565b91505092915050565b600060208284031215613a8557600080fd5b6000613a93848285016136ef565b91505092915050565b600060208284031215613aae57600080fd5b6000613abc84828501613704565b91505092915050565b600060208284031215613ad757600080fd5b6000613ae584828501613758565b91505092915050565b600060208284031215613b0057600080fd5b6000613b0e8482850161376d565b91505092915050565b600080600060608486031215613b2c57600080fd5b6000613b3a86828701613758565b9350506020613b4b86828701613666565b9250506040613b5c86828701613758565b9150509250925092565b600080600080600080600080610100898b031215613b8357600080fd5b6000613b918b828c01613758565b9850506020613ba28b828c01613666565b9750506040613bb38b828c01613797565b9650506060613bc48b828c01613797565b9550506080613bd58b828c01613743565b94505060a0613be68b828c01613743565b93505060c0613bf78b828c01613743565b92505060e0613c088b828c01613782565b9150509295985092959890939650565b613c21816148e1565b82525050565b613c30816148f3565b82525050565b6000613c41826146e3565b613c4b81856146f9565b9350613c5b8185602086016149a4565b613c6481614b70565b840191505092915050565b6000613c7a826146e3565b613c84818561470a565b9350613c948185602086016149a4565b80840191505092915050565b6000613cab826146ee565b613cb58185614715565b9350613cc58185602086016149a4565b613cce81614b70565b840191505092915050565b6000613ce4826146ee565b613cee8185614726565b9350613cfe8185602086016149a4565b80840191505092915050565b6000613d17602683614715565b9150613d2282614b81565b604082019050919050565b6000613d3a602b83614715565b9150613d4582614bd0565b604082019050919050565b6000613d5d603283614715565b9150613d6882614c1f565b604082019050919050565b6000613d80601c83614715565b9150613d8b82614c6e565b602082019050919050565b6000613da3601683614715565b9150613dae82614c97565b602082019050919050565b6000613dc6601a83614715565b9150613dd182614cc0565b602082019050919050565b6000613de9601483614715565b9150613df482614ce9565b602082019050919050565b6000613e0c602483614715565b9150613e1782614d12565b604082019050919050565b6000613e2f601983614715565b9150613e3a82614d61565b602082019050919050565b6000613e52602683614715565b9150613e5d82614d8a565b604082019050919050565b6000613e75602c83614715565b9150613e8082614dd9565b604082019050919050565b6000613e98603883614715565b9150613ea382614e28565b604082019050919050565b6000613ebb604783614715565b9150613ec682614e77565b606082019050919050565b6000613ede602a83614715565b9150613ee982614eec565b604082019050919050565b6000613f01602983614715565b9150613f0c82614f3b565b604082019050919050565b6000613f24601183614715565b9150613f2f82614f8a565b602082019050919050565b6000613f47602083614715565b9150613f5282614fb3565b602082019050919050565b6000613f6a601983614715565b9150613f7582614fdc565b602082019050919050565b6000613f8d602c83614715565b9150613f9882615005565b604082019050919050565b6000613fb0602983614715565b9150613fbb82615054565b604082019050919050565b6000613fd3602f83614715565b9150613fde826150a3565b604082019050919050565b6000613ff6602183614715565b9150614001826150f2565b604082019050919050565b6000614019603183614715565b915061402482615141565b604082019050919050565b600061403c601d83614715565b915061404782615190565b602082019050919050565b600061405f602c83614715565b915061406a826151b9565b604082019050919050565b6000614082602b83614715565b915061408d82615208565b604082019050919050565b60006140a5602a83614715565b91506140b082615257565b604082019050919050565b60006140c8601f83614715565b91506140d3826152a6565b602082019050919050565b6140e78161492b565b82525050565b6140f681614967565b82525050565b61410581614971565b82525050565b61411481614981565b82525050565b60006141268284613c6f565b915081905092915050565b600061413d8285613cd9565b91506141498284613cd9565b91508190509392505050565b600060208201905061416a6000830184613c18565b92915050565b60006060820190506141856000830186613c18565b6141926020830185613c18565b61419f60408301846140ed565b949350505050565b60006080820190506141bc6000830187613c18565b6141c96020830186613c18565b6141d660408301856140ed565b81810360608301526141e88184613c36565b905095945050505050565b60006040820190506142086000830185613c18565b61421560208301846140ed565b9392505050565b60006020820190506142316000830184613c27565b92915050565b600060208201905081810360008301526142518184613ca0565b905092915050565b6000602082019050818103600083015261427281613d0a565b9050919050565b6000602082019050818103600083015261429281613d2d565b9050919050565b600060208201905081810360008301526142b281613d50565b9050919050565b600060208201905081810360008301526142d281613d73565b9050919050565b600060208201905081810360008301526142f281613d96565b9050919050565b6000602082019050818103600083015261431281613db9565b9050919050565b6000602082019050818103600083015261433281613ddc565b9050919050565b6000602082019050818103600083015261435281613dff565b9050919050565b6000602082019050818103600083015261437281613e22565b9050919050565b6000602082019050818103600083015261439281613e45565b9050919050565b600060208201905081810360008301526143b281613e68565b9050919050565b600060208201905081810360008301526143d281613e8b565b9050919050565b600060208201905081810360008301526143f281613eae565b9050919050565b6000602082019050818103600083015261441281613ed1565b9050919050565b6000602082019050818103600083015261443281613ef4565b9050919050565b6000602082019050818103600083015261445281613f17565b9050919050565b6000602082019050818103600083015261447281613f3a565b9050919050565b6000602082019050818103600083015261449281613f5d565b9050919050565b600060208201905081810360008301526144b281613f80565b9050919050565b600060208201905081810360008301526144d281613fa3565b9050919050565b600060208201905081810360008301526144f281613fc6565b9050919050565b6000602082019050818103600083015261451281613fe9565b9050919050565b600060208201905081810360008301526145328161400c565b9050919050565b600060208201905081810360008301526145528161402f565b9050919050565b6000602082019050818103600083015261457281614052565b9050919050565b6000602082019050818103600083015261459281614075565b9050919050565b600060208201905081810360008301526145b281614098565b9050919050565b600060208201905081810360008301526145d2816140bb565b9050919050565b60006020820190506145ee60008301846140de565b92915050565b60006101008201905061460a600083018b6140de565b614617602083018a6140de565b61462460408301896140de565b614631606083018861410b565b61463e608083018761410b565b61464b60a08301866140fc565b61465860c0830185613c18565b61466560e0830184613c27565b9998505050505050505050565b600060208201905061468760008301846140ed565b92915050565b60006146976146a8565b90506146a38282614a09565b919050565b6000604051905090565b600067ffffffffffffffff8211156146cd576146cc614b41565b5b6146d682614b70565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061473c8261492b565b91506147478361492b565b9250826fffffffffffffffffffffffffffffffff0382111561476c5761476b614ab4565b5b828201905092915050565b600061478282614967565b915061478d83614967565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156147c2576147c1614ab4565b5b828201905092915050565b60006147d88261492b565b91506147e38361492b565b9250826147f3576147f2614ae3565b5b828204905092915050565b600061480982614967565b915061481483614967565b92508261482457614823614ae3565b5b828204905092915050565b600061483a8261492b565b91506148458361492b565b9250816fffffffffffffffffffffffffffffffff048311821515161561486e5761486d614ab4565b5b828202905092915050565b60006148848261492b565b915061488f8361492b565b9250828210156148a2576148a1614ab4565b5b828203905092915050565b60006148b882614967565b91506148c383614967565b9250828210156148d6576148d5614ab4565b5b828203905092915050565b60006148ec82614947565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600067ffffffffffffffff82169050919050565b82818337600083830152505050565b60005b838110156149c25780820151818401526020810190506149a7565b838111156149d1576000848401525b50505050565b600060028204905060018216806149ef57607f821691505b60208210811415614a0357614a02614b12565b5b50919050565b614a1282614b70565b810181811067ffffffffffffffff82111715614a3157614a30614b41565b5b80604052505050565b6000614a4582614967565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614a7857614a77614ab4565b5b600182019050919050565b6000614a8e82614967565b9150614a9983614967565b925082614aa957614aa8614ae3565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e60008201527f6374696f6e2e0000000000000000000000000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f737461727454696d657374616d70206973207a65726f00000000000000000000600082015250565b7f72656465656d656420686967686572207468616e20746f74616c000000000000600082015250565b7f76657374496e74657276616c206973207a65726f000000000000000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4d6f726520746f6b656e73206d757374206265207472616e736665727265642060008201527f746f207468697320636f6e7472616374206265666f726520796f752063616e2060208201527f72656465656d2e00000000000000000000000000000000000000000000000000604082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f416c72656164792063616e63656c6c6564000000000000000000000000000000600082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f596f7520646f6e2774206f776e2074686973206772616e742e00000000000000600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f4e6f20746f6b656e7320617661696c61626c6520666f7220726564656d70746960008201527f6f6e206f66206772616e74000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6152d8816148e1565b81146152e357600080fd5b50565b6152ef816148f3565b81146152fa57600080fd5b50565b615306816148ff565b811461531157600080fd5b50565b61531d8161492b565b811461532857600080fd5b50565b61533481614967565b811461533f57600080fd5b50565b61534b81614971565b811461535657600080fd5b50565b61536281614981565b811461536d57600080fd5b5056fea2646970667358221220ed4269a172e77c8edaff21d0948cb90f5077ccdef92c0f66ba063aed86d4d20764736f6c63430008040033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c80636352211e1161011a578063b88d4fde116100ad578063e229a0901161007c578063e229a090146105c7578063e626840e146105e3578063e985e9c5146105ff578063f2b9fdb81461062f578063f3fef3a31461064b576101fb565b8063b88d4fde14610541578063c87b56dd1461055d578063d082e3811461058d578063db006a75146105ab576101fb565b806395d89b41116100e957806395d89b41146104bb578063a22cb465146104d9578063abff9d80146104f5578063b6699d0e14610511576101fb565b80636352211e1461043357806370a082311461046357806379ba5097146104935780638da5cb5b1461049d576101fb565b806323b872dd116101925780634f6ccce7116101615780634f6ccce71461039957806353a47bb7146103c95780635b94db27146103e75780635e25ca8a14610403576101fb565b806323b872dd146103275780632f4350c2146103435780632f745c591461034d57806342842e0e1461037d576101fb565b80630c0debea116101ce5780630c0debea1461029a5780630f3d677e146102d1578063102a2a3f146102ed57806318160ddd14610309576101fb565b806301ffc9a71461020057806306fdde0314610230578063081812fc1461024e578063095ea7b31461027e575b600080fd5b61021a60048036038101906102159190613a73565b610667565b604051610227919061421c565b60405180910390f35b6102386106e1565b6040516102459190614237565b60405180910390f35b61026860048036038101906102639190613ac5565b610773565b6040516102759190614155565b60405180910390f35b610298600480360381019061029391906139c9565b6107f8565b005b6102b460048036038101906102af9190613ac5565b610910565b6040516102c89897969594939291906145f4565b60405180910390f35b6102eb60048036038101906102e69190613a05565b610a11565b005b61030760048036038101906103029190613b66565b610a7f565b005b610311610b3a565b60405161031e9190614672565b60405180910390f35b610341600480360381019061033c9190613811565b610b47565b005b61034b610ba7565b005b610367600480360381019061036291906139c9565b610bea565b6040516103749190614672565b60405180910390f35b61039760048036038101906103929190613811565b610c8f565b005b6103b360048036038101906103ae9190613ac5565b610caf565b6040516103c09190614672565b60405180910390f35b6103d1610d46565b6040516103de9190614155565b60405180910390f35b61040160048036038101906103fc91906137ac565b610d6c565b005b61041d60048036038101906104189190613ac5565b610e83565b60405161042a91906145d9565b60405180910390f35b61044d60048036038101906104489190613ac5565b610f40565b60405161045a9190614155565b60405180910390f35b61047d600480360381019061047891906137ac565b610ff2565b60405161048a9190614672565b60405180910390f35b61049b6110aa565b005b6104a5611249565b6040516104b29190614155565b60405180910390f35b6104c361126f565b6040516104d09190614237565b60405180910390f35b6104f360048036038101906104ee919061398d565b611301565b005b61050f600480360381019061050a9190613ac5565b611317565b005b61052b60048036038101906105269190613ac5565b61146a565b60405161053891906145d9565b60405180910390f35b61055b60048036038101906105569190613860565b6115b9565b005b61057760048036038101906105729190613ac5565b61161b565b6040516105849190614237565b60405180910390f35b6105956116c2565b6040516105a29190614672565b60405180910390f35b6105c560048036038101906105c09190613ac5565b6116c8565b005b6105e160048036038101906105dc9190613b17565b6116d6565b005b6105fd60048036038101906105f891906138db565b611717565b005b610619600480360381019061061491906137d5565b611b67565b604051610626919061421c565b60405180910390f35b610649600480360381019061064491906139c9565b611bfb565b005b610665600480360381019061066091906139c9565b611c7c565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106da57506106d982611da0565b5b9050919050565b6060600080546106f0906149d7565b80601f016020809104026020016040519081016040528092919081815260200182805461071c906149d7565b80156107695780601f1061073e57610100808354040283529160200191610769565b820191906000526020600020905b81548152906001019060200180831161074c57829003601f168201915b5050505050905090565b600061077e82611e82565b6107bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b490614499565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061080382610f40565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b906144f9565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610893611eee565b73ffffffffffffffffffffffffffffffffffffffff1614806108c257506108c1816108bc611eee565b611b67565b5b610901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f8906143b9565b60405180910390fd5b61090b8383611ef6565b505050565b600e6020528060005260406000206000915090508060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16908060010160009054906101000a90046fffffffffffffffffffffffffffffffff16908060010160109054906101000a900467ffffffffffffffff16908060010160189054906101000a900467ffffffffffffffff16908060020160009054906101000a900463ffffffff16908060020160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160189054906101000a900460ff16905088565b60005b82829050811015610a7a57610a67838383818110610a5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201356116c8565b8080610a7290614a3a565b915050610a14565b505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0690614259565b60405180910390fd5b610b1888611317565b610b30610b2489610f40565b88888888888888611717565b5050505050505050565b6000600880549050905090565b610b58610b52611eee565b82611faf565b610b97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8e90614519565b60405180910390fd5b610ba283838361208d565b505050565b6000610bb233610ff2565b905060005b81811015610be657610bd3610bcc3383610bea565b60006122e9565b8080610bde90614a3a565b915050610bb7565b5050565b6000610bf583610ff2565b8210610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d90614279565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610caa838383604051806020016040528060008152506115b9565b505050565b6000610cb9610b3a565b8210610cfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf190614559565b60405180910390fd5b60088281548110610d34577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df390614259565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fa43af109f494a1b33d1d9f272a0a84f482e536f260818914271d36d0b47ba00e60405160405180910390a250565b600080610e8f8361146a565b90506000600e600085815260200190815260200160002060010160009054906101000a90046fffffffffffffffffffffffffffffffff169050600e600085815260200190815260200160002060020160189054906101000a900460ff1680610f1a5750806fffffffffffffffffffffffffffffffff16826fffffffffffffffffffffffffffffffff16105b15610f2a57600092505050610f3b565b8082610f369190614879565b925050505b919050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe090614419565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105a906143f9565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461110457600080fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a60405160405180910390a3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606001805461127e906149d7565b80601f01602080910402602001604051908101604052809291908181526020018280546112aa906149d7565b80156112f75780601f106112cc576101008083540402835291602001916112f7565b820191906000526020600020905b8154815290600101906020018083116112da57829003601f168201915b5050505050905090565b61131361130c611eee565b8383612646565b5050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139e90614259565b60405180910390fd5b600e600082815260200190815260200160002060020160189054906101000a900460ff161561140b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140290614439565b60405180910390fd5b6001600e600083815260200190815260200160002060020160186101000a81548160ff021916908315150217905550807f4df93d542273eb976c82d138be4f31cca880a82b7f8209e8281719a1a877fa4860405160405180910390a250565b600080600e600084815260200190815260200160002090508060010160189054906101000a900467ffffffffffffffff1667ffffffffffffffff164210156114b65760009150506115b4565b60008160000160009054906101000a90046fffffffffffffffffffffffffffffffff168260020160009054906101000a900463ffffffff1663ffffffff168360010160109054906101000a900467ffffffffffffffff1667ffffffffffffffff16426115229190614879565b61152c91906147cd565b611536919061482f565b90508160000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1611156115ae578160000160109054906101000a90046fffffffffffffffffffffffffffffffff16925050506115b4565b80925050505b919050565b6115ca6115c4611eee565b83611faf565b611609576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160090614519565b60405180910390fd5b611615848484846127b3565b50505050565b606061162682611e82565b611665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165c906144d9565b60405180910390fd5b600061166f61280f565b9050600081511161168f57604051806020016040528060008152506116ba565b8061169984612826565b6040516020016116aa929190614131565b6040516020818303038152906040525b915050919050565b600d5481565b6116d38160016122e9565b50565b60008290506116e4846116c8565b6117113330848473ffffffffffffffffffffffffffffffffffffffff166129d3909392919063ffffffff16565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179e90614259565b60405180910390fd5b60008667ffffffffffffffff16116117f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117eb906142d9565b60405180910390fd5b60008163ffffffff161161183d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183490614319565b60405180910390fd5b826fffffffffffffffffffffffffffffffff16826fffffffffffffffffffffffffffffffff1611156118a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189b906142f9565b60405180910390fd5b6000600d549050600d60008154809291906118be90614a3a565b9190505550604051806101000160405280866fffffffffffffffffffffffffffffffff168152602001856fffffffffffffffffffffffffffffffff168152602001846fffffffffffffffffffffffffffffffff1681526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018363ffffffff1681526020018973ffffffffffffffffffffffffffffffffffffffff16815260200160001515815250600e600083815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160020160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e08201518160020160186101000a81548160ff021916908315150217905550905050611b2f8982612a5c565b807f22a2abd07e87b230325c9a9ca7e31611cb7458a525a490f050e656ffb2410c2660405160405180910390a2505050505050505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611c283330838573ffffffffffffffffffffffffffffffffffffffff166129d3909392919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fd1cf3d156d5f8f0d50f6c122ed609cec09d35c9b9fb3fff6ea0959134dae424e3383604051611c709291906141f3565b60405180910390a25050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0390614259565b60405180910390fd5b611d3733828473ffffffffffffffffffffffffffffffffffffffff16612a7a9092919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b639883604051611d949190614672565b60405180910390a35050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611e6b57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611e7b5750611e7a82612b00565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611f6983610f40565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611fba82611e82565b611ff9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff090614399565b60405180910390fd5b600061200483610f40565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061207357508373ffffffffffffffffffffffffffffffffffffffff1661205b84610773565b73ffffffffffffffffffffffffffffffffffffffff16145b8061208457506120838185611b67565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166120ad82610f40565b73ffffffffffffffffffffffffffffffffffffffff1614612103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120fa906144b9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612173576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216a90614339565b60405180910390fd5b61217e838383612b6a565b612189600082611ef6565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546121d991906148ad565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122309190614777565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6002600a54141561232f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612326906145b9565b60405180910390fd5b6002600a819055503373ffffffffffffffffffffffffffffffffffffffff1661235783610f40565b73ffffffffffffffffffffffffffffffffffffffff16146123ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a490614479565b60405180910390fd5b60006123b883610e83565b90506000816fffffffffffffffffffffffffffffffff16141561241c578115612416576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240d90614579565b60405180910390fd5b5061263a565b6000600e600085815260200190815260200160002060020160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816fffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016124a39190614155565b60206040518083038186803b1580156124bb57600080fd5b505afa1580156124cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f39190613aee565b1015612534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252b906143d9565b60405180910390fd5b81600e600086815260200190815260200160002060010160008282829054906101000a90046fffffffffffffffffffffffffffffffff166125759190614731565b92506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506125e833836fffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16612a7a9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff16847fdeedc3b2f529d2c0a63d08e4e0a3bbec8e617a02e0f03e9581f4f8c45e8489298460405161262f91906145d9565b60405180910390a350505b6001600a819055505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156126b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ac90614359565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127a6919061421c565b60405180910390a3505050565b6127be84848461208d565b6127ca84848484612c7e565b612809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280090614299565b60405180910390fd5b50505050565b606060405180602001604052806000815250905090565b6060600082141561286e576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506129ce565b600082905060005b600082146128a057808061288990614a3a565b915050600a8261289991906147fe565b9150612876565b60008167ffffffffffffffff8111156128e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156129145781602001600182028036833780820191505090505b5090505b600085146129c75760018261292d91906148ad565b9150600a8561293c9190614a83565b60306129489190614777565b60f81b818381518110612984577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856129c091906147fe565b9450612918565b8093505050505b919050565b612a56846323b872dd60e01b8585856040516024016129f493929190614170565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e15565b50505050565b612a76828260405180602001604052806000815250612edc565b5050565b612afb8363a9059cbb60e01b8484604051602401612a999291906141f3565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e15565b505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612b75838383612f37565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612bb857612bb381612f3c565b612bf7565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612bf657612bf58382612f85565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612c3a57612c35816130f2565b612c79565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612c7857612c778282613235565b5b5b505050565b6000612c9f8473ffffffffffffffffffffffffffffffffffffffff166132b4565b15612e08578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612cc8611eee565b8786866040518563ffffffff1660e01b8152600401612cea94939291906141a7565b602060405180830381600087803b158015612d0457600080fd5b505af1925050508015612d3557506040513d601f19601f82011682018060405250810190612d329190613a9c565b60015b612db8573d8060008114612d65576040519150601f19603f3d011682016040523d82523d6000602084013e612d6a565b606091505b50600081511415612db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612da790614299565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612e0d565b600190505b949350505050565b6000612e77826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166132c79092919063ffffffff16565b9050600081511115612ed75780806020019051810190612e979190613a4a565b612ed6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ecd90614599565b60405180910390fd5b5b505050565b612ee683836132df565b612ef36000848484612c7e565b612f32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f2990614299565b60405180910390fd5b505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612f9284610ff2565b612f9c91906148ad565b9050600060076000848152602001908152602001600020549050818114613081576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b6000600160088054905061310691906148ad565b905060006009600084815260200190815260200160002054905060006008838154811061315c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080600883815481106131a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480613219577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061324083610ff2565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600080823b905060008111915050919050565b60606132d684846000856134ad565b90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561334f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161334690614459565b60405180910390fd5b61335881611e82565b15613398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161338f906142b9565b60405180910390fd5b6133a460008383612b6a565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546133f49190614777565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6060824710156134f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134e990614379565b60405180910390fd5b6134fb856132b4565b61353a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353190614539565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613563919061411a565b60006040518083038185875af1925050503d80600081146135a0576040519150601f19603f3d011682016040523d82523d6000602084013e6135a5565b606091505b50915091506135b58282866135c1565b92505050949350505050565b606083156135d157829050613621565b6000835111156135e45782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136189190614237565b60405180910390fd5b9392505050565b600061363b613636846146b2565b61468d565b90508281526020810184848401111561365357600080fd5b61365e848285614995565b509392505050565b600081359050613675816152cf565b92915050565b60008083601f84011261368d57600080fd5b8235905067ffffffffffffffff8111156136a657600080fd5b6020830191508360208202830111156136be57600080fd5b9250929050565b6000813590506136d4816152e6565b92915050565b6000815190506136e9816152e6565b92915050565b6000813590506136fe816152fd565b92915050565b600081519050613713816152fd565b92915050565b600082601f83011261372a57600080fd5b813561373a848260208601613628565b91505092915050565b60008135905061375281615314565b92915050565b6000813590506137678161532b565b92915050565b60008151905061377c8161532b565b92915050565b60008135905061379181615342565b92915050565b6000813590506137a681615359565b92915050565b6000602082840312156137be57600080fd5b60006137cc84828501613666565b91505092915050565b600080604083850312156137e857600080fd5b60006137f685828601613666565b925050602061380785828601613666565b9150509250929050565b60008060006060848603121561382657600080fd5b600061383486828701613666565b935050602061384586828701613666565b925050604061385686828701613758565b9150509250925092565b6000806000806080858703121561387657600080fd5b600061388487828801613666565b945050602061389587828801613666565b93505060406138a687828801613758565b925050606085013567ffffffffffffffff8111156138c357600080fd5b6138cf87828801613719565b91505092959194509250565b600080600080600080600080610100898b0312156138f857600080fd5b60006139068b828c01613666565b98505060206139178b828c01613666565b97505060406139288b828c01613797565b96505060606139398b828c01613797565b955050608061394a8b828c01613743565b94505060a061395b8b828c01613743565b93505060c061396c8b828c01613743565b92505060e061397d8b828c01613782565b9150509295985092959890939650565b600080604083850312156139a057600080fd5b60006139ae85828601613666565b92505060206139bf858286016136c5565b9150509250929050565b600080604083850312156139dc57600080fd5b60006139ea85828601613666565b92505060206139fb85828601613758565b9150509250929050565b60008060208385031215613a1857600080fd5b600083013567ffffffffffffffff811115613a3257600080fd5b613a3e8582860161367b565b92509250509250929050565b600060208284031215613a5c57600080fd5b6000613a6a848285016136da565b91505092915050565b600060208284031215613a8557600080fd5b6000613a93848285016136ef565b91505092915050565b600060208284031215613aae57600080fd5b6000613abc84828501613704565b91505092915050565b600060208284031215613ad757600080fd5b6000613ae584828501613758565b91505092915050565b600060208284031215613b0057600080fd5b6000613b0e8482850161376d565b91505092915050565b600080600060608486031215613b2c57600080fd5b6000613b3a86828701613758565b9350506020613b4b86828701613666565b9250506040613b5c86828701613758565b9150509250925092565b600080600080600080600080610100898b031215613b8357600080fd5b6000613b918b828c01613758565b9850506020613ba28b828c01613666565b9750506040613bb38b828c01613797565b9650506060613bc48b828c01613797565b9550506080613bd58b828c01613743565b94505060a0613be68b828c01613743565b93505060c0613bf78b828c01613743565b92505060e0613c088b828c01613782565b9150509295985092959890939650565b613c21816148e1565b82525050565b613c30816148f3565b82525050565b6000613c41826146e3565b613c4b81856146f9565b9350613c5b8185602086016149a4565b613c6481614b70565b840191505092915050565b6000613c7a826146e3565b613c84818561470a565b9350613c948185602086016149a4565b80840191505092915050565b6000613cab826146ee565b613cb58185614715565b9350613cc58185602086016149a4565b613cce81614b70565b840191505092915050565b6000613ce4826146ee565b613cee8185614726565b9350613cfe8185602086016149a4565b80840191505092915050565b6000613d17602683614715565b9150613d2282614b81565b604082019050919050565b6000613d3a602b83614715565b9150613d4582614bd0565b604082019050919050565b6000613d5d603283614715565b9150613d6882614c1f565b604082019050919050565b6000613d80601c83614715565b9150613d8b82614c6e565b602082019050919050565b6000613da3601683614715565b9150613dae82614c97565b602082019050919050565b6000613dc6601a83614715565b9150613dd182614cc0565b602082019050919050565b6000613de9601483614715565b9150613df482614ce9565b602082019050919050565b6000613e0c602483614715565b9150613e1782614d12565b604082019050919050565b6000613e2f601983614715565b9150613e3a82614d61565b602082019050919050565b6000613e52602683614715565b9150613e5d82614d8a565b604082019050919050565b6000613e75602c83614715565b9150613e8082614dd9565b604082019050919050565b6000613e98603883614715565b9150613ea382614e28565b604082019050919050565b6000613ebb604783614715565b9150613ec682614e77565b606082019050919050565b6000613ede602a83614715565b9150613ee982614eec565b604082019050919050565b6000613f01602983614715565b9150613f0c82614f3b565b604082019050919050565b6000613f24601183614715565b9150613f2f82614f8a565b602082019050919050565b6000613f47602083614715565b9150613f5282614fb3565b602082019050919050565b6000613f6a601983614715565b9150613f7582614fdc565b602082019050919050565b6000613f8d602c83614715565b9150613f9882615005565b604082019050919050565b6000613fb0602983614715565b9150613fbb82615054565b604082019050919050565b6000613fd3602f83614715565b9150613fde826150a3565b604082019050919050565b6000613ff6602183614715565b9150614001826150f2565b604082019050919050565b6000614019603183614715565b915061402482615141565b604082019050919050565b600061403c601d83614715565b915061404782615190565b602082019050919050565b600061405f602c83614715565b915061406a826151b9565b604082019050919050565b6000614082602b83614715565b915061408d82615208565b604082019050919050565b60006140a5602a83614715565b91506140b082615257565b604082019050919050565b60006140c8601f83614715565b91506140d3826152a6565b602082019050919050565b6140e78161492b565b82525050565b6140f681614967565b82525050565b61410581614971565b82525050565b61411481614981565b82525050565b60006141268284613c6f565b915081905092915050565b600061413d8285613cd9565b91506141498284613cd9565b91508190509392505050565b600060208201905061416a6000830184613c18565b92915050565b60006060820190506141856000830186613c18565b6141926020830185613c18565b61419f60408301846140ed565b949350505050565b60006080820190506141bc6000830187613c18565b6141c96020830186613c18565b6141d660408301856140ed565b81810360608301526141e88184613c36565b905095945050505050565b60006040820190506142086000830185613c18565b61421560208301846140ed565b9392505050565b60006020820190506142316000830184613c27565b92915050565b600060208201905081810360008301526142518184613ca0565b905092915050565b6000602082019050818103600083015261427281613d0a565b9050919050565b6000602082019050818103600083015261429281613d2d565b9050919050565b600060208201905081810360008301526142b281613d50565b9050919050565b600060208201905081810360008301526142d281613d73565b9050919050565b600060208201905081810360008301526142f281613d96565b9050919050565b6000602082019050818103600083015261431281613db9565b9050919050565b6000602082019050818103600083015261433281613ddc565b9050919050565b6000602082019050818103600083015261435281613dff565b9050919050565b6000602082019050818103600083015261437281613e22565b9050919050565b6000602082019050818103600083015261439281613e45565b9050919050565b600060208201905081810360008301526143b281613e68565b9050919050565b600060208201905081810360008301526143d281613e8b565b9050919050565b600060208201905081810360008301526143f281613eae565b9050919050565b6000602082019050818103600083015261441281613ed1565b9050919050565b6000602082019050818103600083015261443281613ef4565b9050919050565b6000602082019050818103600083015261445281613f17565b9050919050565b6000602082019050818103600083015261447281613f3a565b9050919050565b6000602082019050818103600083015261449281613f5d565b9050919050565b600060208201905081810360008301526144b281613f80565b9050919050565b600060208201905081810360008301526144d281613fa3565b9050919050565b600060208201905081810360008301526144f281613fc6565b9050919050565b6000602082019050818103600083015261451281613fe9565b9050919050565b600060208201905081810360008301526145328161400c565b9050919050565b600060208201905081810360008301526145528161402f565b9050919050565b6000602082019050818103600083015261457281614052565b9050919050565b6000602082019050818103600083015261459281614075565b9050919050565b600060208201905081810360008301526145b281614098565b9050919050565b600060208201905081810360008301526145d2816140bb565b9050919050565b60006020820190506145ee60008301846140de565b92915050565b60006101008201905061460a600083018b6140de565b614617602083018a6140de565b61462460408301896140de565b614631606083018861410b565b61463e608083018761410b565b61464b60a08301866140fc565b61465860c0830185613c18565b61466560e0830184613c27565b9998505050505050505050565b600060208201905061468760008301846140ed565b92915050565b60006146976146a8565b90506146a38282614a09565b919050565b6000604051905090565b600067ffffffffffffffff8211156146cd576146cc614b41565b5b6146d682614b70565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061473c8261492b565b91506147478361492b565b9250826fffffffffffffffffffffffffffffffff0382111561476c5761476b614ab4565b5b828201905092915050565b600061478282614967565b915061478d83614967565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156147c2576147c1614ab4565b5b828201905092915050565b60006147d88261492b565b91506147e38361492b565b9250826147f3576147f2614ae3565b5b828204905092915050565b600061480982614967565b915061481483614967565b92508261482457614823614ae3565b5b828204905092915050565b600061483a8261492b565b91506148458361492b565b9250816fffffffffffffffffffffffffffffffff048311821515161561486e5761486d614ab4565b5b828202905092915050565b60006148848261492b565b915061488f8361492b565b9250828210156148a2576148a1614ab4565b5b828203905092915050565b60006148b882614967565b91506148c383614967565b9250828210156148d6576148d5614ab4565b5b828203905092915050565b60006148ec82614947565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600067ffffffffffffffff82169050919050565b82818337600083830152505050565b60005b838110156149c25780820151818401526020810190506149a7565b838111156149d1576000848401525b50505050565b600060028204905060018216806149ef57607f821691505b60208210811415614a0357614a02614b12565b5b50919050565b614a1282614b70565b810181811067ffffffffffffffff82111715614a3157614a30614b41565b5b80604052505050565b6000614a4582614967565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614a7857614a77614ab4565b5b600182019050919050565b6000614a8e82614967565b9150614a9983614967565b925082614aa957614aa8614ae3565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e60008201527f6374696f6e2e0000000000000000000000000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f737461727454696d657374616d70206973207a65726f00000000000000000000600082015250565b7f72656465656d656420686967686572207468616e20746f74616c000000000000600082015250565b7f76657374496e74657276616c206973207a65726f000000000000000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4d6f726520746f6b656e73206d757374206265207472616e736665727265642060008201527f746f207468697320636f6e7472616374206265666f726520796f752063616e2060208201527f72656465656d2e00000000000000000000000000000000000000000000000000604082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f416c72656164792063616e63656c6c6564000000000000000000000000000000600082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f596f7520646f6e2774206f776e2074686973206772616e742e00000000000000600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f4e6f20746f6b656e7320617661696c61626c6520666f7220726564656d70746960008201527f6f6e206f66206772616e74000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6152d8816148e1565b81146152e357600080fd5b50565b6152ef816148f3565b81146152fa57600080fd5b50565b615306816148ff565b811461531157600080fd5b50565b61531d8161492b565b811461532857600080fd5b50565b61533481614967565b811461533f57600080fd5b50565b61534b81614971565b811461535657600080fd5b50565b61536281614981565b811461536d57600080fd5b5056fea2646970667358221220ed4269a172e77c8edaff21d0948cb90f5077ccdef92c0f66ba063aed86d4d20764736f6c63430008040033", "linkReferences": {}, "deployedLinkReferences": {} } From 2da81751c673bfbbdd6d94f876aa4cb581671ce6 Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 11:35:20 +1000 Subject: [PATCH 2/8] Remove unneeded network listener --- frontend/pages/_app.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js index 3929d7c..15ef662 100644 --- a/frontend/pages/_app.js +++ b/frontend/pages/_app.js @@ -35,17 +35,8 @@ const { connectors } = getDefaultWallets({ const wagmiClient = createClient({ autoConnect: true, connectors, - provider -}) - -if (typeof window !== "undefined") { - const currentProvider = new ethers.providers.Web3Provider(window.ethereum, "any"); - currentProvider.on("network", (newNetwork, oldNetwork) => { - if (oldNetwork) { - window.location.reload(); - } - }); -} + provider, +}); function MyApp({ Component, pageProps }) { From e657795dfa3824d2fc571957a0717c7237580621 Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 11:36:05 +1000 Subject: [PATCH 3/8] Remove public provider. - This was not a fallback, but a quorum casing it to be slower --- frontend/pages/_app.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js index 15ef662..4e89654 100644 --- a/frontend/pages/_app.js +++ b/frontend/pages/_app.js @@ -21,10 +21,7 @@ import { ConnectButton } from '@rainbow-me/rainbowkit'; const { chains, provider } = configureChains( [chain.mainnet, chain.optimism, chain.rinkeby], - [ - infuraProvider({ infuraId: process.env.NEXT_PUBLIC_INFURA_PROJECT_ID }), - publicProvider() - ] + [infuraProvider({ infuraId: process.env.NEXT_PUBLIC_INFURA_PROJECT_ID })] ); const { connectors } = getDefaultWallets({ From 630fd944874c807157c6fc0858282916375974df Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 11:36:14 +1000 Subject: [PATCH 4/8] Prettier --- frontend/pages/_app.js | 53 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js index 4e89654..703b5f2 100644 --- a/frontend/pages/_app.js +++ b/frontend/pages/_app.js @@ -1,23 +1,23 @@ -import Head from 'next/head' -import { ChakraProvider, ColorModeScript, Heading, Flex, Container, Box } from '@chakra-ui/react' -import { RecoilRoot } from 'recoil'; -import theme from '../styles/theme' -import '@rainbow-me/rainbowkit/styles.css'; -import { ethers } from 'ethers' import { - getDefaultWallets, - RainbowKitProvider, - darkTheme -} from '@rainbow-me/rainbowkit'; + Box, + ChakraProvider, + ColorModeScript, + Container, + Flex, + Heading, +} from "@chakra-ui/react"; import { - chain, - configureChains, - createClient, - WagmiConfig, -} from 'wagmi'; -import { infuraProvider } from 'wagmi/providers/infura'; -import { publicProvider } from 'wagmi/providers/public'; -import { ConnectButton } from '@rainbow-me/rainbowkit'; + ConnectButton, + RainbowKitProvider, + darkTheme, + getDefaultWallets, +} from "@rainbow-me/rainbowkit"; +import "@rainbow-me/rainbowkit/styles.css"; +import Head from "next/head"; +import { RecoilRoot } from "recoil"; +import { WagmiConfig, chain, configureChains, createClient } from "wagmi"; +import { infuraProvider } from "wagmi/providers/infura"; +import theme from "../styles/theme"; const { chains, provider } = configureChains( [chain.mainnet, chain.optimism, chain.rinkeby], @@ -25,8 +25,8 @@ const { chains, provider } = configureChains( ); const { connectors } = getDefaultWallets({ - appName: 'Tokenvest', - chains + appName: "Tokenvest", + chains, }); const wagmiClient = createClient({ @@ -36,7 +36,6 @@ const wagmiClient = createClient({ }); function MyApp({ Component, pageProps }) { - return ( @@ -47,9 +46,11 @@ function MyApp({ Component, pageProps }) { Tokenvest - + - Tokenvest + + Tokenvest + @@ -59,8 +60,8 @@ function MyApp({ Component, pageProps }) { - - ) + + ); } -export default MyApp +export default MyApp; From aa584184a69b93090b2a52e9c0274829f62bb8ca Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 11:39:50 +1000 Subject: [PATCH 5/8] Correct infura url --- frontend/lib/store/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/lib/store/events.js b/frontend/lib/store/events.js index 2266506..213ba10 100644 --- a/frontend/lib/store/events.js +++ b/frontend/lib/store/events.js @@ -53,7 +53,7 @@ export const fetchEvents = async (setEvents) => { } // Always use infura for fetching events, provider from wallet can be really slow const provider = new ethers.providers.JsonRpcProvider( - `https://${networkIdToName}.infura.io/v3/8c6bfe963db94518b16b17114e29e628` + `https://${infuraName}.infura.io/v3/8abb2592d8d344daafc5362ddd33efd1` ); const vesterContract = new ethers.Contract( From d8144b85d5b6c191f31084d870f39b816d69e2a3 Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 11:47:15 +1000 Subject: [PATCH 6/8] Correct infura url --- frontend/lib/store/events.js | 4 +-- frontend/lib/store/grants.js | 66 ++++++++++++++---------------------- 2 files changed, 28 insertions(+), 42 deletions(-) diff --git a/frontend/lib/store/events.js b/frontend/lib/store/events.js index 213ba10..220ce3e 100644 --- a/frontend/lib/store/events.js +++ b/frontend/lib/store/events.js @@ -44,9 +44,9 @@ const networkIdToName = { }; /**** ACTIONS ****/ -export const fetchEvents = async (setEvents) => { - const networkId = window.ethereum.networkVersion; +export const fetchEvents = async (setEvents, networkId) => { const infuraName = networkIdToName[networkId]; + if (!infuraName) { console.error(`Invalid network id ${networkId}, check events.js`); throw Error("Invalid network id:" + networkId); diff --git a/frontend/lib/store/grants.js b/frontend/lib/store/grants.js index 9294412..60d4223 100644 --- a/frontend/lib/store/grants.js +++ b/frontend/lib/store/grants.js @@ -53,44 +53,23 @@ export const getGrantsByUser = selectorFamily({ } }); - +const networkIdToName = { + 1: "mainnet", + 10: "optimism-mainnet", +}; /**** ACTIONS ****/ -export const fetchGrant = async (setGrant, tokenId) => { - const provider = new ethers.providers.Web3Provider(window?.ethereum) - - let vesterInterface = new ethers.utils.Interface(vesterAbi.abi); - let multicallArgs = [ - { - target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, - callData: vesterInterface.encodeFunctionData("grants", [tokenId]), - allowFailure: true, - value: 0, - }, - { - target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, - callData: vesterInterface.encodeFunctionData("amountVested", [tokenId]), - allowFailure: true, - value: 0, - }, - { - target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, - callData: vesterInterface.encodeFunctionData("availableForRedemption", [tokenId]), - allowFailure: true, - value: 0, - }, - { - target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, - callData: vesterInterface.encodeFunctionData("ownerOf", [tokenId]), - allowFailure: true, - value: 0, - }, - ] - const multicallContract = new ethers.Contract(process.env.NEXT_PUBLIC_MULTICALL_ADDRESS, multicall3Abi.abi, provider); - const resp = await multicallContract.callStatic.aggregate3Value(multicallArgs) - const grantData = vesterInterface.decodeFunctionResult("grants", resp[0].returnData) - const erc20Contract = new ethers.Contract(grantData.tokenAddress, erc20Abi.abi, provider); - const tokenSymbol = await erc20Contract.symbol(); +export const fetchGrant = async (setGrant, tokenId, networkId) => { + const infuraName = networkIdToName[networkId]; + if (!infuraName) { + console.error(`Invalid network id ${networkId}, check events.js`); + throw Error("Invalid network id:" + networkId); + } + // Always use infura for fetching events, provider from wallet can be really slow + const provider = new ethers.providers.JsonRpcProvider({ + url: `https://${infuraName}.infura.io/v3/8abb2592d8d344daafc5362ddd33efd1`, + skipFetchSetup: true, + }); try { setGrant({ @@ -106,10 +85,17 @@ export const fetchGrant = async (setGrant, tokenId) => { return resp } -export const fetchGrants = async (setGrant) => { - const provider = new ethers.providers.Web3Provider(window?.ethereum) - const vesterContract = new ethers.Contract(process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, vesterAbi.abi, provider); - let promises = [] +export const fetchGrants = async (setGrant, networkId) => { + const infuraName = networkIdToName[networkId]; + + if (!infuraName) { + console.error(`Invalid network id ${networkId}, check events.js`); + throw Error("Invalid network id:" + networkId); + } + // Always use infura for fetching events, provider from wallet can be really slow + const provider = new ethers.providers.JsonRpcProvider( + `https://${infuraName}.infura.io/v3/8c6bfe963db94518b16b17114e29e628` + ); const totalSupply = await vesterContract.totalSupply(); for (let i = 0; i < totalSupply.toNumber(); i++) { From 7f7573491778ea5ceb0b9512ad172443ee33b78f Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 12:01:00 +1000 Subject: [PATCH 7/8] Skip fetching events for UserGrants page. - When means we skip displaying Recent Activity. That will save 200 requests --- .../Home/UserGrants/RedeemTokens.js | 158 +++++-- frontend/components/Home/UserGrants/index.js | 133 ++++-- frontend/components/shared/RecentActivity.js | 148 +++--- frontend/lib/store/grants.js | 442 ++++++++++++------ 4 files changed, 589 insertions(+), 292 deletions(-) diff --git a/frontend/components/Home/UserGrants/RedeemTokens.js b/frontend/components/Home/UserGrants/RedeemTokens.js index 9864d16..4c006c8 100644 --- a/frontend/components/Home/UserGrants/RedeemTokens.js +++ b/frontend/components/Home/UserGrants/RedeemTokens.js @@ -1,84 +1,160 @@ -import { useState } from 'react'; -import { Heading, Input, Button, FormControl, Flex, Box, FormLabel, Text, Checkbox, Grid, LightMode } from '@chakra-ui/react' -import { Icon } from '@chakra-ui/icons' -import { BsCash } from 'react-icons/bs' -import { ethers } from 'ethers' -import { useRecoilState } from 'recoil' -import { getGrant, redeemGrant } from '../../../lib/store/grants' -import { getEventsByTokenId } from '../../../lib/store/events' +import { Icon } from "@chakra-ui/icons"; +import { + Box, + Button, + Checkbox, + Flex, + FormControl, + FormLabel, + Grid, + Heading, + Input, + LightMode, + Text, +} from "@chakra-ui/react"; +import { ethers } from "ethers"; +import { useState } from "react"; +import { BsCash } from "react-icons/bs"; +import { useRecoilState } from "recoil"; +import { getGrant, redeemGrant } from "../../../lib/store/grants"; export default function RedeemTokens({ tokenId }) { const [grant, setGrant] = useRecoilState(getGrant(tokenId)); - const [events, setEvents] = useRecoilState(getEventsByTokenId(tokenId)); const [exchangeMode, setExchangeMode] = useState(false); const [exchangeTokenAmount, setExchangeTokenAmount] = useState(0); const [exchangeTokenAddress, setExchangeTokenAddress] = useState(""); const [loadingRedemption, setLoadingRedemption] = useState(false); - const vested = parseFloat(ethers.utils.formatUnits(grant.amountVested, 18)) - const redeemed = parseFloat(ethers.utils.formatUnits(grant.amountRedeemed, 18)); - const available = parseFloat(ethers.utils.formatUnits(grant.amountAvailable, 18)); + const vested = parseFloat(ethers.utils.formatUnits(grant.amountVested, 18)); + const redeemed = parseFloat( + ethers.utils.formatUnits(grant.amountRedeemed, 18) + ); + const available = parseFloat( + ethers.utils.formatUnits(grant.amountAvailable, 18) + ); const redeem = () => { - setLoadingRedemption(true) - redeemGrant(grant.tokenId, exchangeMode && exchangeTokenAmount, exchangeMode && exchangeTokenAddress, setGrant, setEvents) - .finally(() => { - setLoadingRedemption(false) - }) - } + setLoadingRedemption(true); + redeemGrant( + grant.tokenId, + exchangeMode && exchangeTokenAmount, + exchangeMode && exchangeTokenAddress, + setGrant + ).finally(() => { + setLoadingRedemption(false); + }); + }; return ( - - Redeem {grant.tokenSymbol} + + + + Redeem {grant.tokenSymbol} + - You can redeem available {grant.tokenSymbol}. Available tokens do not expire. + + You can redeem available {grant.tokenSymbol}. Available tokens do + not expire. + - {vested.toLocaleString()} - Vested + + {vested.toLocaleString()} + + + Vested + - - + + - + - {redeemed.toLocaleString()} - Redeemed + + {redeemed.toLocaleString()} + + + Redeemed + - = + + = + - {available.toLocaleString()} - Available + + {available.toLocaleString()} + + + Available + - setExchangeMode(e.target.checked)}>I would like to purchase this {grant.tokenSymbol}. + setExchangeMode(e.target.checked)} + > + I would like to purchase this {grant.tokenSymbol}. + Optional Purchase Price - - setExchangeTokenAmount(e.target.value)} placeholder='Enter Amount' /> - setExchangeTokenAddress(e.target.value)} placeholder='Enter Token Address' /> + + setExchangeTokenAmount(e.target.value)} + placeholder="Enter Amount" + /> + setExchangeTokenAddress(e.target.value)} + placeholder="Enter Token Address" + /> - + - ) + ); } - diff --git a/frontend/components/Home/UserGrants/index.js b/frontend/components/Home/UserGrants/index.js index 6b07857..cfe5e96 100644 --- a/frontend/components/Home/UserGrants/index.js +++ b/frontend/components/Home/UserGrants/index.js @@ -1,56 +1,103 @@ -import { useState, useEffect } from 'react' -import { Box, Text, Spinner } from '@chakra-ui/react' -import { InfoOutlineIcon } from '@chakra-ui/icons' -import GrantStatus from './GrantStatus' -import RedeemTokens from './RedeemTokens' -import RedeemAll from './RedeemAll' -import RecentActivity from '../../shared/RecentActivity' -import EtherscanLink from '../../shared/EtherscanLink' -import { useRecoilState } from 'recoil' -import { getGrantsByUser, fetchGrantsByUser } from '../../../lib/store/grants' -import { eventsState, fetchEvents } from '../../../lib/store/events' -import { useAccount } from 'wagmi' +import { useState, useEffect } from "react"; +import { Box, Text, Spinner } from "@chakra-ui/react"; +import { InfoOutlineIcon } from "@chakra-ui/icons"; +import GrantStatus from "./GrantStatus"; +import RedeemTokens from "./RedeemTokens"; +import RedeemAll from "./RedeemAll"; +import EtherscanLink from "../../shared/EtherscanLink"; +import { useRecoilState } from "recoil"; +import { getGrantsByUser, fetchGrantsByUser } from "../../../lib/store/grants"; +import { useAccount, useNetwork } from "wagmi"; export default function UserGrants() { - const { address } = useAccount() + const { address } = useAccount(); + const { chain } = useNetwork(); + + const networkId = chain.id; const [grants, setGrant] = useRecoilState(getGrantsByUser(address)); - const [events, setEvents] = useRecoilState(eventsState); const [loadingData, setLoadingData] = useState(true); useEffect(() => { - if (address) { - Promise.all([fetchEvents(setEvents), fetchGrantsByUser(setGrant, address)]).finally(() => { - setLoadingData(false) - }) + if (address && networkId) { + fetchGrantsByUser(setGrant, address, networkId).finally(() => { + setLoadingData(false); + }); } - }, [address]) + }, [address, networkId]); const makeGrantElement = (grant, ind) => { - return ( - Grant #{grant.tokenId.toNumber()} - - {grant.cancelled ? "" : } - - Each grant is an NFT at the contract address {process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS} - ) - } - - const noGrantsText = There are no grants associated with this wallet. - - const numNonZeroAvailable = grants.length ? grants.filter(g => g.amountAvailable.gt(0)).length : 0; - - return loadingData ? (address ? : Connect a wallet to view grants) : - (grants.length ?
+ return ( + + + Grant #{grant.tokenId.toNumber()} + + + {grant.cancelled ? "" : } + + {" "} + Each grant is an NFT at the contract address{" "} + + {process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS} + + + + ); + }; + + const noGrantsText = ( + + There are no grants associated with this wallet. + + ); + + const numNonZeroAvailable = grants.length + ? grants.filter((g) => g.amountAvailable.gt(0)).length + : 0; + + return loadingData ? ( + address ? ( + + ) : ( + + Connect a wallet to view grants + + ) + ) : grants.length ? ( +
{numNonZeroAvailable > 1 ? : ""} {[...grants].reverse().map(makeGrantElement)} -
: noGrantsText) - +
+ ) : ( + noGrantsText + ); } diff --git a/frontend/components/shared/RecentActivity.js b/frontend/components/shared/RecentActivity.js index 610d825..7da7ab1 100644 --- a/frontend/components/shared/RecentActivity.js +++ b/frontend/components/shared/RecentActivity.js @@ -1,61 +1,99 @@ -import { Heading, Flex, Box, Text, Link } from '@chakra-ui/react' -import { Icon, TimeIcon } from '@chakra-ui/icons' -import { BsCalendarWeek, BsAward, BsSquare } from 'react-icons/bs' -import { ethers } from 'ethers' -import { formatDistanceToNow } from 'date-fns' -import { useRecoilState } from 'recoil' -import { getEventsByTokenId, getEvents } from '../../lib/store/events' -import EtherscanLink from './EtherscanLink' +import { Heading, Flex, Box, Text, Link } from "@chakra-ui/react"; +import { Icon, TimeIcon } from "@chakra-ui/icons"; +import { BsCalendarWeek, BsAward, BsSquare } from "react-icons/bs"; +import { ethers } from "ethers"; +import { formatDistanceToNow } from "date-fns"; +import { useRecoilState } from "recoil"; +import { getEvents } from "../../lib/store/events"; +import EtherscanLink from "./EtherscanLink"; -export default function RecentActivity({ tokenId }) { - const [events] = useRecoilState(tokenId != undefined ? getEventsByTokenId(tokenId) : getEvents); +export default function RecentActivity() { + const [events] = useRecoilState(getEvents); return ( - - Recent Activity - {events.length ? events.slice().sort((a, b) => (b.blockNumber - a.blockNumber)).map((event, ind) => { - return ( - - - {event.type} - - - {tokenId == undefined && event.tokenId && - Grant #{event.tokenId.toNumber()} - } + + + + Recent Activity + + {events.length ? ( + events + .slice() + .sort((a, b) => b.blockNumber - a.blockNumber) + .map((event, ind) => { + return ( -   - Block {event.blockNumber.toLocaleString()} - - {formatDistanceToNow(new Date(event.timestamp * 1000))} ago - - - - {event.type == "Redemption" && {parseFloat(ethers.utils.formatUnits(event.amount, 18)).toLocaleString()} {event.tokenSymbol} redeemed by {event.redeemerAddress}.} + borderBottom={ + ind + 1 != events.length && "1px solid rgba(255,255,255,0.1)" + } + py={4} + key={ind} + > + + + {event.type} + + + {tokenId == undefined && event.tokenId && ( + + {" "} + Grant #{event.tokenId.toNumber()} + + )} + + +   + + Block {event.blockNumber.toLocaleString()} + + + + {" "} + {formatDistanceToNow(new Date(event.timestamp * 1000))}{" "} + ago + + + - ) - }) : ( - No activity found for this grant. - )} - - ) + {event.type == "Redemption" && ( + + {parseFloat( + ethers.utils.formatUnits(event.amount, 18) + ).toLocaleString()}{" "} + {event.tokenSymbol} redeemed by {event.redeemerAddress}. + + )} +
+ ); + }) + ) : ( + + No activity found for this grant. + + )} + + ); } diff --git a/frontend/lib/store/grants.js b/frontend/lib/store/grants.js index 60d4223..0c2e8ce 100644 --- a/frontend/lib/store/grants.js +++ b/frontend/lib/store/grants.js @@ -1,56 +1,67 @@ import { atom, selectorFamily } from "recoil"; -import { ethers } from 'ethers' -import vesterAbi from '../../abis/Vester.json' -import erc20Abi from '../../abis/SampleToken.json' -import multicall3Abi from '../../abis/Multicall3.json' -import { parseErrorMessage } from '../../lib/utils/helpers' -import { createStandaloneToast } from '@chakra-ui/react' -import theme from '../../styles/theme' -import { fetchEvents } from "./events"; +import { ethers } from "ethers"; +import vesterAbi from "../../abis/Vester.json"; +import erc20Abi from "../../abis/SampleToken.json"; +import multicall3Abi from "../../abis/Multicall3.json"; +import { parseErrorMessage } from "../../lib/utils/helpers"; +import { createStandaloneToast } from "@chakra-ui/react"; +import theme from "../../styles/theme"; -const toast = createStandaloneToast({ theme }) +const toast = createStandaloneToast({ theme }); /**** STATE ****/ export const grantsState = atom({ - key: 'grantsState', - default: {}, + key: "grantsState", + default: {}, }); export const getGrants = selectorFamily({ - key: 'getGrants', - get: (address) => ({ get }) => { - return Object.values(get(grantsState)) + key: "getGrants", + get: + (address) => + ({ get }) => { + return Object.values(get(grantsState)); + }, + set: + () => + ({ get, set }, newValue) => { + let wrappedNewValue = {}; + wrappedNewValue[newValue.tokenId] = newValue; + set(grantsState, Object.assign({}, get(grantsState), wrappedNewValue)); }, - set: () => ({ get, set }, newValue) => { - let wrappedNewValue = {} - wrappedNewValue[newValue.tokenId] = newValue - set(grantsState, Object.assign({}, get(grantsState), wrappedNewValue)) - } }); export const getGrant = selectorFamily({ - key: 'getGrant', - get: (tokenId) => ({ get }) => { - return get(grantsState)[tokenId]; + key: "getGrant", + get: + (tokenId) => + ({ get }) => { + return get(grantsState)[tokenId]; + }, + set: + (tokenId) => + ({ get, set }, newValue) => { + let wrappedNewValue = {}; + wrappedNewValue[tokenId] = newValue; + set(grantsState, Object.assign({}, get(grantsState), wrappedNewValue)); }, - set: (tokenId) => ({ get, set }, newValue) => { - let wrappedNewValue = {} - wrappedNewValue[tokenId] = newValue - set(grantsState, Object.assign({}, get(grantsState), wrappedNewValue)) - } }); export const getGrantsByUser = selectorFamily({ - key: 'getGrantsByUser', - get: (address) => ({ get }) => { - return Object.values(get(grantsState)).filter((g) => g.owner == address) + key: "getGrantsByUser", + get: + (address) => + ({ get }) => { + return Object.values(get(grantsState)).filter((g) => g.owner == address); + }, + set: + () => + ({ get, set }, newValue) => { + let wrappedNewValue = {}; + wrappedNewValue[newValue.tokenId] = newValue; + set(grantsState, Object.assign({}, get(grantsState), wrappedNewValue)); }, - set: () => ({ get, set }, newValue) => { - let wrappedNewValue = {} - wrappedNewValue[newValue.tokenId] = newValue - set(grantsState, Object.assign({}, get(grantsState), wrappedNewValue)) - } }); const networkIdToName = { @@ -70,20 +81,78 @@ export const fetchGrant = async (setGrant, tokenId, networkId) => { url: `https://${infuraName}.infura.io/v3/8abb2592d8d344daafc5362ddd33efd1`, skipFetchSetup: true, }); + let vesterInterface = new ethers.utils.Interface(vesterAbi.abi); + let multicallArgs = [ + { + target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + callData: vesterInterface.encodeFunctionData("grants", [tokenId]), + allowFailure: true, + value: 0, + }, + { + target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + callData: vesterInterface.encodeFunctionData("amountVested", [tokenId]), + allowFailure: true, + value: 0, + }, + { + target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + callData: vesterInterface.encodeFunctionData("availableForRedemption", [ + tokenId, + ]), + allowFailure: true, + value: 0, + }, + { + target: process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + callData: vesterInterface.encodeFunctionData("ownerOf", [tokenId]), + allowFailure: true, + value: 0, + }, + ]; + const multicallContract = new ethers.Contract( + process.env.NEXT_PUBLIC_MULTICALL_ADDRESS, + multicall3Abi.abi, + provider + ); + const resp = await multicallContract.callStatic.aggregate3Value( + multicallArgs + ); + const grantData = vesterInterface.decodeFunctionResult( + "grants", + resp[0].returnData + ); + const erc20Contract = new ethers.Contract( + grantData.tokenAddress, + erc20Abi.abi, + provider + ); + const tokenSymbol = await erc20Contract.symbol(); - try { - setGrant({ - tokenId, - ...grantData, - amountVested: vesterInterface.decodeFunctionResult("amountVested", resp[1].returnData)[0], - amountAvailable: vesterInterface.decodeFunctionResult("availableForRedemption", resp[2].returnData)[0], - owner: vesterInterface.decodeFunctionResult("ownerOf", resp[3].returnData)[0], - tokenSymbol: tokenSymbol - }) - } catch { } + try { + setGrant({ + tokenId, + ...grantData, + amountVested: vesterInterface.decodeFunctionResult( + "amountVested", + resp[1].returnData + )[0], + amountAvailable: vesterInterface.decodeFunctionResult( + "availableForRedemption", + resp[2].returnData + )[0], + owner: vesterInterface.decodeFunctionResult( + "ownerOf", + resp[3].returnData + )[0], + tokenSymbol: tokenSymbol, + }); + } catch { + console.log("set grant failed"); + } - return resp -} + return resp; +}; export const fetchGrants = async (setGrant, networkId) => { const infuraName = networkIdToName[networkId]; @@ -96,115 +165,182 @@ export const fetchGrants = async (setGrant, networkId) => { const provider = new ethers.providers.JsonRpcProvider( `https://${infuraName}.infura.io/v3/8c6bfe963db94518b16b17114e29e628` ); + const vesterContract = new ethers.Contract( + process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + vesterAbi.abi, + provider + ); + console.log("fetching totalSupply"); + + const totalSupply = await vesterContract.totalSupply(); + console.log("fetching grants, totalSuypply", totalSupply.toNumber()); + let promises = []; + for (let i = 0; i < totalSupply.toNumber(); i++) { + promises.push(await fetchGrant(setGrant, i, networkId)); + } + + return Promise.all(promises); +}; + +export const fetchGrantsByUser = async (setGrant, owner, networkId) => { + const infuraName = networkIdToName[networkId]; + + if (!infuraName) { + console.error(`Invalid network id ${networkId}, check events.js`); + throw Error("Invalid network id:" + networkId); + } + // Always use infura for fetching events, provider from wallet can be really slow + const provider = new ethers.providers.JsonRpcProvider({ + url: `https://${infuraName}.infura.io/v3/8abb2592d8d344daafc5362ddd33efd1`, + skipFetchSetup: true, + }); + + const vesterContract = new ethers.Contract( + process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + vesterAbi.abi, + provider + ); + let promises = []; + + const totalSupply = await vesterContract.balanceOf(owner); + for (let i = 0; i < totalSupply.toNumber(); i++) { + const grantId = await vesterContract.tokenOfOwnerByIndex(owner, i); + promises.push(await fetchGrant(setGrant, grantId, networkId)); + } + + return Promise.all(promises); +}; + +export const redeemGrant = async ( + tokenId, + exchangeTokenAmount, + exchangeTokenAddress, + setGrant +) => { + const provider = new ethers.providers.Web3Provider(window?.ethereum); + + const vesterContract = new ethers.Contract( + process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + vesterAbi.abi, + provider + ); + + const submitToastEvent = () => { + toast({ + title: "Redemption Submitted", + description: + "A notice will appear here after the redemption has been successfully processed. Refer to your wallet for the latest status.", + status: "info", + position: "top", + duration: 10000, + isClosable: true, + }); + }; + + const errorToastEvent = (error) => { + toast({ + title: "Error", + description: parseErrorMessage(error), + status: "error", + position: "top", + isClosable: true, + }); + }; - const totalSupply = await vesterContract.totalSupply(); - for (let i = 0; i < totalSupply.toNumber(); i++) { - promises.push(await fetchGrant(setGrant, i)) - } - - return Promise.all(promises) -} - -export const fetchGrantsByUser = async (setGrant, owner) => { - const provider = new ethers.providers.Web3Provider(window?.ethereum) - const vesterContract = new ethers.Contract(process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, vesterAbi.abi, provider); - let promises = [] - - const totalSupply = await vesterContract.balanceOf(owner); - for (let i = 0; i < totalSupply.toNumber(); i++) { - const grantId = await vesterContract.tokenOfOwnerByIndex(owner, i); - promises.push(await fetchGrant(setGrant, grantId)) - } - - return Promise.all(promises) -} - -export const redeemGrant = async (tokenId, exchangeTokenAmount, exchangeTokenAddress, setGrant, setEvents) => { - const provider = new ethers.providers.Web3Provider(window?.ethereum) - const vesterContract = new ethers.Contract(process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, vesterAbi.abi, provider); - - const submitToastEvent = () => { - toast({ - title: 'Redemption Submitted', - description: - 'A notice will appear here after the redemption has been successfully processed. Refer to your wallet for the latest status.', - status: 'info', - position: 'top', + provider.once("block", () => { + // Unsure about this wrapping? Originally added to prevent redemptions from old blocks rendering. + vesterContract.once( + "Redemption", + async (redeemedTokenId, address, amount) => { + if (tokenId.toNumber() == redeemedTokenId.toNumber()) { + toast({ + title: "Redemption Successful", + description: `You have redeemed ${( + amount / + 10 ** 18 + ).toLocaleString()} tokens.`, + status: "success", + position: "top", duration: 10000, isClosable: true, - }) - } - - const errorToastEvent = (error) => { - toast({ - title: 'Error', - description: parseErrorMessage(error), - status: 'error', - position: 'top', - isClosable: true, - }) - } - - provider.once("block", () => { // Unsure about this wrapping? Originally added to prevent redemptions from old blocks rendering. - vesterContract.once('Redemption', async (redeemedTokenId, address, amount) => { - if (tokenId.toNumber() == redeemedTokenId.toNumber()) { - toast({ - title: 'Redemption Successful', - description: `You have redeemed ${(amount / 10 ** 18).toLocaleString()} tokens.`, - status: 'success', - position: 'top', - duration: 10000, - isClosable: true, - }) - } - await fetchGrant(setGrant, tokenId) - await fetchEvents(setEvents, tokenId) - }) - }) - - if (exchangeTokenAmount) { - const exchangeTokenAmountParsed = ethers.utils.parseEther(exchangeTokenAmount.toString()) - const exchangeTokenAddressParsed = ethers.utils.getAddress(exchangeTokenAddress) - - const erc20Contract = new ethers.Contract(exchangeTokenAddressParsed, erc20Abi.abi, provider); - return await erc20Contract.connect(provider.getSigner()).approve(process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, exchangeTokenAmountParsed).then(async () => { - return await vesterContract.connect(provider.getSigner()).redeemWithTransfer(tokenId, exchangeTokenAddressParsed, exchangeTokenAmountParsed) - .then(submitToastEvent) - .catch(errorToastEvent) - }) - } else { - return await vesterContract.connect(provider.getSigner()).redeem(tokenId) - .then(submitToastEvent) - .catch(errorToastEvent) - } -} + }); + } + await fetchGrant(setGrant, tokenId, provider.network.chainId); + } + ); + }); + + if (exchangeTokenAmount) { + const exchangeTokenAmountParsed = ethers.utils.parseEther( + exchangeTokenAmount.toString() + ); + const exchangeTokenAddressParsed = + ethers.utils.getAddress(exchangeTokenAddress); + + const erc20Contract = new ethers.Contract( + exchangeTokenAddressParsed, + erc20Abi.abi, + provider + ); + return await erc20Contract + .connect(provider.getSigner()) + .approve( + process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + exchangeTokenAmountParsed + ) + .then(async () => { + return await vesterContract + .connect(provider.getSigner()) + .redeemWithTransfer( + tokenId, + exchangeTokenAddressParsed, + exchangeTokenAmountParsed + ) + .then(submitToastEvent) + .catch(errorToastEvent); + }); + } else { + return await vesterContract + .connect(provider.getSigner()) + .redeem(tokenId) + .then(submitToastEvent) + .catch(errorToastEvent); + } +}; export const redeemAll = async () => { - const provider = new ethers.providers.Web3Provider(window?.ethereum) //or should this be passed in? - const vesterContract = new ethers.Contract(process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, vesterAbi.abi, provider); - - const submitToastEvent = () => { - toast({ - title: 'RedeemAll Submitted', - description: 'Refer to your wallet for the latest status, and refresh page for updated data.', - status: 'info', - position: 'top', - duration: 10000, - isClosable: true, - }) - } - - const errorToastEvent = (error) => { - toast({ - title: 'Error', - description: parseErrorMessage(error), - status: 'error', - position: 'top', - isClosable: true, - }) - } + const provider = new ethers.providers.Web3Provider(window?.ethereum); //or should this be passed in? + const vesterContract = new ethers.Contract( + process.env.NEXT_PUBLIC_VESTER_CONTRACT_ADDRESS, + vesterAbi.abi, + provider + ); - return await vesterContract.connect(provider.getSigner()).redeemAll() - .then(submitToastEvent) - .catch(errorToastEvent) -} + const submitToastEvent = () => { + toast({ + title: "RedeemAll Submitted", + description: + "Refer to your wallet for the latest status, and refresh page for updated data.", + status: "info", + position: "top", + duration: 10000, + isClosable: true, + }); + }; + + const errorToastEvent = (error) => { + toast({ + title: "Error", + description: parseErrorMessage(error), + status: "error", + position: "top", + isClosable: true, + }); + }; + + return await vesterContract + .connect(provider.getSigner()) + .redeemAll() + .then(submitToastEvent) + .catch(errorToastEvent); +}; From a0fce4c7b7a3590838999afe53dc3d07b68707c2 Mon Sep 17 00:00:00 2001 From: Joey Date: Mon, 27 May 2024 12:01:35 +1000 Subject: [PATCH 8/8] Make sure admin panel passes in network id --- frontend/components/Admin/AdminPanel/index.js | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/frontend/components/Admin/AdminPanel/index.js b/frontend/components/Admin/AdminPanel/index.js index ca1b511..8d195af 100644 --- a/frontend/components/Admin/AdminPanel/index.js +++ b/frontend/components/Admin/AdminPanel/index.js @@ -1,28 +1,36 @@ -import { useState, useEffect } from 'react' -import { Spinner } from '@chakra-ui/react' -import Grants from './Grants' -import TokenBalance from './TokenBalance' -import RecentActivity from '../../shared/RecentActivity' -import { useRecoilState } from 'recoil' -import { getGrants, fetchGrants } from '../../../lib/store/grants' -import { eventsState, fetchEvents } from '../../../lib/store/events' +import { useState, useEffect } from "react"; +import { Spinner } from "@chakra-ui/react"; +import Grants from "./Grants"; +import TokenBalance from "./TokenBalance"; +import RecentActivity from "../../shared/RecentActivity"; +import { useRecoilState } from "recoil"; +import { getGrants, fetchGrants } from "../../../lib/store/grants"; +import { eventsState, fetchEvents } from "../../../lib/store/events"; export default function AdminPanel() { const [grants, setGrant] = useRecoilState(getGrants()); const [events, setEvents] = useRecoilState(eventsState); const [loadingData, setLoadingData] = useState(true); + const { chain } = useNetwork(); + const networkId = chain.id; useEffect(() => { - Promise.all([fetchEvents(setEvents), fetchGrants(setGrant)]).finally(() => { - setLoadingData(false) - }) - }, []) - - return loadingData ? : <> - - - - - + if (!networkId) return; + Promise.all([ + fetchEvents(setEvents, networkId), + fetchGrants(setGrant, networkId), + ]).finally(() => { + setLoadingData(false); + }); + }, [networkId]); + return loadingData ? ( + + ) : ( + <> + + + + + ); }