diff --git a/client/src/App.jsx b/client/src/App.jsx index 7cc82eb..0a0d891 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -8,8 +8,8 @@ import DAOArtifact from './assets/DAO.json'; const contracts = { '0x539': { // Hardhat - DAO: '0x7209aa5b0B91700615bA982e4E4F1Eb967E31cf1', - Work1: '0x4a3f03f50b542BD27DbcaDAF9A3d608AE4f5AACc', + DAO: '0x8d914D38dD301FC4606f5aa9fEcF8A76389020d3', + Work1: '0x050C420Cc4995B41217Eba1B54B82Fd5687e9139', }, '0xaa36a7': { // Sepolia DAO: '0x8d914D38dD301FC4606f5aa9fEcF8A76389020d3', @@ -28,9 +28,8 @@ function App() { const [balanceEther, setBalanceEther] = useState(); const [reputation, setReputation] = useState(); const [totalReputation, setTotalReputation] = useState(); - const [validationPoolCount, setValidationPoolCount] = useState(); - const [latestPoolIndex, setLatestPoolIndex] = useState(); - const [votePasses, setVotePasses] = useState(); + const [posts, setPosts] = useState([]); + const [validationPools, setValidationPools] = useState([]); // const watchReputationToken = useCallback(async () => { // await provider.request({ @@ -57,31 +56,47 @@ function App() { // }; const fetchReputation = async () => { - console.log(`fetchReputation, account: ${account}`); setReputation(await DAOContract.methods.balanceOf(account).call()); setTotalReputation(await DAOContract.methods.totalSupply().call()); }; - const fetchValidationPoolCount = async () => { - setValidationPoolCount(await DAOContract.methods.validationPoolCount().call()); + const fetchPosts = async () => { + const count = await DAOContract.methods.postCount().call(); + const promises = []; + for (let i = 0; i < count; i += 1) { + promises.push(DAOContract.methods.posts(i).call()); + } + const fetchedPosts = await Promise.all(promises); + setPosts(fetchedPosts); + }; + + const fetchValidationPools = async () => { + const count = await DAOContract.methods.validationPoolCount().call(); + const promises = []; + for (let i = 0; i < count; i += 1) { + promises.push(DAOContract.methods.validationPools(i).call()); + } + const pools = await Promise.all(promises); + setValidationPools(pools); }; // fetchPrice(); fetchReputation(); - fetchValidationPoolCount(); + fetchPosts(); + fetchValidationPools(); // setWork1(work1Contract); setDAO(DAOContract); DAOContract.events.ValidationPoolInitiated({ fromBlock: 'latest' }).on('data', (event) => { console.log('event: validation pool initiated', event); - setLatestPoolIndex(event.returnValues.poolIndex); - fetchValidationPoolCount(); + fetchPosts(); + fetchValidationPools(); }); DAOContract.events.ValidationPoolResolved({ fromBlock: 'latest' }).on('data', (event) => { console.log('event: validation pool resolved', event); - setVotePasses(event.returnValues.votePasses); fetchReputation(); + fetchValidationPools(); }); }, [provider, account, chainId]); @@ -107,17 +122,24 @@ function App() { } }; - const initiateValidationPool = async () => { + const addPost = async () => { + await DAO.methods.addPost(account).send({ + from: account, + gas: 1000000, + }); + }; + + const initiateValidationPool = async (postIndex) => { const poolDuration = 0; - await DAO.methods.initiateValidationPool(account, poolDuration).send({ + await DAO.methods.initiateValidationPool(postIndex, poolDuration).send({ from: account, gas: 1000000, value: 100, }); }; - const evaluateOutcome = async () => { - await DAO.methods.evaluateOutcome(latestPoolIndex).send({ + const evaluateOutcome = async (poolIndex) => { + await DAO.methods.evaluateOutcome(poolIndex).send({ from: account, gas: 1000000, }); @@ -165,16 +187,75 @@ function App() {
- {`Validation Pool Count: ${validationPoolCount}`} + {`Posts count: ${posts.length}`}
- + + + + + + + + + + {posts.map((post) => ( + + + + + + ))} + +
IDAuthorActions
{post.id.toString()}{post.author} + +
- +
- {`Outcome: ${votePasses}`} + {`Validation Pool Count: ${validationPools.length}`} +
+
+ + + + + + + + + + + + + + {validationPools.map((pool) => ( + + + + + + + + + + ))} + +
IDPost IDFeeDurationEnd TimeStatusActions
{pool.id.toString()}{pool.postIndex.toString()}{pool.fee.toString()}{pool.duration.toString()}{new Date(Number(pool.endTime) * 1000).toLocaleString()} + {pool.resolved && (pool.outcome ? 'Accepted' : 'Rejected')} + {!pool.resolved && new Date() < new Date(Number(pool.endTime) * 1000) && 'In Progress'} + {!pool.resolved && new Date() >= new Date(Number(pool.endTime) * 1000) && 'Ready to Evaluate'} + + {!pool.resolved && ( + + )} +
{ /* `Work1 Price: ${work1Price} ETH` */ } diff --git a/client/src/assets/DAO.json b/client/src/assets/DAO.json index e4e155d..9aa0a66 100644 --- a/client/src/assets/DAO.json +++ b/client/src/assets/DAO.json @@ -155,6 +155,12 @@ { "anonymous": false, "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "poolIndex", + "type": "uint256" + }, { "indexed": false, "internalType": "bool", @@ -165,6 +171,25 @@ "name": "ValidationPoolResolved", "type": "event" }, + { + "inputs": [ + { + "internalType": "address", + "name": "author", + "type": "address" + } + ], + "name": "addPost", + "outputs": [ + { + "internalType": "uint256", + "name": "postIndex", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -267,9 +292,9 @@ { "inputs": [ { - "internalType": "address", - "name": "author", - "type": "address" + "internalType": "uint256", + "name": "postIndex", + "type": "uint256" }, { "internalType": "uint256", @@ -352,6 +377,48 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "postCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "posts", + "outputs": [ + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "author", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -375,6 +442,35 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "stakeAvailability", + "outputs": [ + { + "internalType": "bool", + "name": "transferred", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "symbol", @@ -479,13 +575,18 @@ "outputs": [ { "internalType": "uint256", - "name": "stakeCount", + "name": "id", "type": "uint256" }, { - "internalType": "address", - "name": "author", - "type": "address" + "internalType": "uint256", + "name": "postIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stakeCount", + "type": "uint256" }, { "internalType": "uint256", @@ -527,8 +628,8 @@ "type": "function" } ], - "bytecode": "0x60806040523480156200001157600080fd5b506040518060400160405280600a81526020017f52657075746174696f6e000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f524550000000000000000000000000000000000000000000000000000000000081525081600390816200008f919062000324565b508060049081620000a1919062000324565b5050506200040b565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200012c57607f821691505b602082108103620001425762000141620000e4565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620001ac7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200016d565b620001b886836200016d565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000205620001ff620001f984620001d0565b620001da565b620001d0565b9050919050565b6000819050919050565b6200022183620001e4565b6200023962000230826200020c565b8484546200017a565b825550505050565b600090565b6200025062000241565b6200025d81848462000216565b505050565b5b8181101562000285576200027960008262000246565b60018101905062000263565b5050565b601f821115620002d4576200029e8162000148565b620002a9846200015d565b81016020851015620002b9578190505b620002d1620002c8856200015d565b83018262000262565b50505b505050565b600082821c905092915050565b6000620002f960001984600802620002d9565b1980831691505092915050565b6000620003148383620002e6565b9150826002028217905092915050565b6200032f82620000aa565b67ffffffffffffffff8111156200034b576200034a620000b5565b5b62000357825462000113565b6200036482828562000289565b600060209050601f8311600181146200039c576000841562000387578287015190505b62000393858262000306565b86555062000403565b601f198416620003ac8662000148565b60005b82811015620003d657848901518255600182019150602085019450602081019050620003af565b86831015620003f65784890151620003f2601f891682620002e6565b8355505b6001600288020188555050505b505050505050565b611d8b806200041b6000396000f3fe6080604052600436106100fe5760003560e01c80635daf08ca1161009557806395d89b411161006457806395d89b4114610364578063a230c5241461038f578063a2336279146103cc578063a9059cbb14610411578063dd62ed3e1461044e576100fe565b80635daf08ca1461028f57806360780cd7146102cc578063642b5bfb146102fc57806370a0823114610327576100fe565b806318160ddd116100d157806318160ddd146101d357806323b872dd146101fe578063313ce5671461023b578063561b246314610266576100fe565b806306fdde0314610103578063095ea7b31461012e57806311aee3801461016b57806317c1821714610196575b600080fd5b34801561010f57600080fd5b5061011861048b565b60405161012591906115c0565b60405180910390f35b34801561013a57600080fd5b506101556004803603810190610150919061167b565b61051d565b60405161016291906116d6565b60405180910390f35b34801561017757600080fd5b50610180610540565b60405161018d9190611700565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b8919061171b565b610546565b6040516101ca91906116d6565b60405180910390f35b3480156101df57600080fd5b506101e8610a02565b6040516101f59190611700565b60405180910390f35b34801561020a57600080fd5b5061022560048036038101906102209190611748565b610a0c565b60405161023291906116d6565b60405180910390f35b34801561024757600080fd5b50610250610a3b565b60405161025d91906117b7565b60405180910390f35b34801561027257600080fd5b5061028d600480360381019061028891906117fe565b610a44565b005b34801561029b57600080fd5b506102b660048036038101906102b1919061171b565b610a6d565b6040516102c39190611860565b60405180910390f35b6102e660048036038101906102e1919061167b565b610aa0565b6040516102f39190611700565b60405180910390f35b34801561030857600080fd5b50610311610bf7565b60405161031e9190611700565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061187b565b610bfd565b60405161035b9190611700565b60405180910390f35b34801561037057600080fd5b50610379610c45565b60405161038691906115c0565b60405180910390f35b34801561039b57600080fd5b506103b660048036038101906103b1919061187b565b610cd7565b6040516103c391906116d6565b60405180910390f35b3480156103d857600080fd5b506103f360048036038101906103ee919061171b565b610cf7565b604051610408999897969594939291906118a8565b60405180910390f35b34801561041d57600080fd5b506104386004803603810190610433919061167b565b610d7f565b60405161044591906116d6565b60405180910390f35b34801561045a57600080fd5b5061047560048036038101906104709190611935565b610da2565b6040516104829190611700565b60405180910390f35b60606003805461049a906119a4565b80601f01602080910402602001604051908101604052809291908181526020018280546104c6906119a4565b80156105135780601f106104e857610100808354040283529160200191610513565b820191906000526020600020905b8154815290600101906020018083116104f657829003601f168201915b5050505050905090565b600080610528610e29565b9050610535818585610e31565b600191505092915050565b60065481565b600080600860008481526020019081526020016000209050806007015442116105a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059b90611a47565b60405180910390fd5b600015158160080160009054906101000a900460ff161515146105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390611ab3565b60405180910390fd5b600080600080600090505b84600101548110156106785784600001600082815260200190815260200160002091508160000160009054906101000a900460ff1615610658578160010154846106519190611b02565b935061066b565b8160010154836106689190611b02565b92505b8080600101915050610607565b508183101594508480156106fa5750600760008560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15610808578360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006006600081548092919061073b90611b36565b91905055815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60018460080160006101000a81548160ff0219169083151502179055507f9f3584cbb084f56a98b2b581e13f64e4ec315e59157d67dc65497890e85558658560405161085491906116d6565b60405180910390a1600085610869578261086b565b835b905060008661087a578461087c565b835b905060005b866001015481101561092c5786600001600082815260200190815260200160002093508360000160009054906101000a900460ff1615158815150361091f576000838560010154846108d39190611b7e565b6108dd9190611bef565b905061091d308660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168388600101546109189190611b02565b610e43565b505b8080600101915050610881565b5060005b6006548110156109f65760006005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600061097c610a02565b61098583610bfd565b8a600301546109949190611b7e565b61099e9190611bef565b90508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156109e6573d6000803e3d6000fd5b5050508080600101915050610930565b50505050505050919050565b6000600254905090565b600080610a17610e29565b9050610a24858285610f37565b610a2f858585610e43565b60019150509392505050565b60006012905090565b6000600860008581526020019081526020016000209050610a6781338585610fcb565b50505050565b60056020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000803411610ae4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adb90611c92565b60405180910390fd5b60096000815480929190610af790611b36565b9190505590506000600860008381526020019081526020016000209050838160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503481600301819055508281600601819055508242610b759190611b02565b8160070181905550610b8730346110b2565b610ba08185600234610b999190611bef565b6001610fcb565b610bb98185600234610bb29190611bef565b6000610fcb565b7f6e5c598b821d7fa8550e5fea58ab6e27c59e1cbe1df75a8591aa0c453b49e10a82604051610be89190611700565b60405180910390a15092915050565b60095481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054610c54906119a4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c80906119a4565b8015610ccd5780601f10610ca257610100808354040283529160200191610ccd565b820191906000526020600020905b815481529060010190602001808311610cb057829003601f168201915b5050505050905090565b60076020528060005260406000206000915054906101000a900460ff1681565b60086020528060005260406000206000915090508060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030154908060040154908060050154908060060154908060070154908060080160009054906101000a900460ff16908060080160019054906101000a900460ff16905089565b600080610d8a610e29565b9050610d97818585610e43565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610e3e8383836001611134565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610eb55760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610eac9190611860565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f275760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610f1e9190611860565b60405180910390fd5b610f3283838361130b565b505050565b6000610f438484610da2565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610fc55781811015610fb5578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fac93929190611cb2565b60405180910390fd5b610fc484848484036000611134565b5b50505050565b8360070154421115611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990611d35565b60405180910390fd5b600084600001600086600101600081548092919061102f90611b36565b9190505581526020019081526020016000209050838160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818160000160006101000a81548160ff0219169083151502179055508281600101819055505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111245760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161111b9190611860565b60405180910390fd5b6111306000838361130b565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036111a65760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161119d9190611860565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112185760006040517f94280d6200000000000000000000000000000000000000000000000000000000815260040161120f9190611860565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508015611305578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516112fc9190611700565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361135d5780600260008282546113519190611b02565b92505081905550611430565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156113e9578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016113e093929190611cb2565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361147957806002600082825403925050819055506114c6565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115239190611700565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561156a57808201518184015260208101905061154f565b60008484015250505050565b6000601f19601f8301169050919050565b600061159282611530565b61159c818561153b565b93506115ac81856020860161154c565b6115b581611576565b840191505092915050565b600060208201905081810360008301526115da8184611587565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611612826115e7565b9050919050565b61162281611607565b811461162d57600080fd5b50565b60008135905061163f81611619565b92915050565b6000819050919050565b61165881611645565b811461166357600080fd5b50565b6000813590506116758161164f565b92915050565b60008060408385031215611692576116916115e2565b5b60006116a085828601611630565b92505060206116b185828601611666565b9150509250929050565b60008115159050919050565b6116d0816116bb565b82525050565b60006020820190506116eb60008301846116c7565b92915050565b6116fa81611645565b82525050565b600060208201905061171560008301846116f1565b92915050565b600060208284031215611731576117306115e2565b5b600061173f84828501611666565b91505092915050565b600080600060608486031215611761576117606115e2565b5b600061176f86828701611630565b935050602061178086828701611630565b925050604061179186828701611666565b9150509250925092565b600060ff82169050919050565b6117b18161179b565b82525050565b60006020820190506117cc60008301846117a8565b92915050565b6117db816116bb565b81146117e657600080fd5b50565b6000813590506117f8816117d2565b92915050565b600080600060608486031215611817576118166115e2565b5b600061182586828701611666565b935050602061183686828701611666565b9250506040611847868287016117e9565b9150509250925092565b61185a81611607565b82525050565b60006020820190506118756000830184611851565b92915050565b600060208284031215611891576118906115e2565b5b600061189f84828501611630565b91505092915050565b6000610120820190506118be600083018c6116f1565b6118cb602083018b611851565b6118d8604083018a6116f1565b6118e560608301896116f1565b6118f260808301886116f1565b6118ff60a08301876116f1565b61190c60c08301866116f1565b61191960e08301856116c7565b6119276101008301846116c7565b9a9950505050505050505050565b6000806040838503121561194c5761194b6115e2565b5b600061195a85828601611630565b925050602061196b85828601611630565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806119bc57607f821691505b6020821081036119cf576119ce611975565b5b50919050565b7f506f6f6c20656e642074696d6520686173206e6f74207965742061727269766560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b6000611a3160218361153b565b9150611a3c826119d5565b604082019050919050565b60006020820190508181036000830152611a6081611a24565b9050919050565b7f506f6f6c20697320616c7265616479207265736f6c7665640000000000000000600082015250565b6000611a9d60188361153b565b9150611aa882611a67565b602082019050919050565b60006020820190508181036000830152611acc81611a90565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611b0d82611645565b9150611b1883611645565b9250828201905080821115611b3057611b2f611ad3565b5b92915050565b6000611b4182611645565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b7357611b72611ad3565b5b600182019050919050565b6000611b8982611645565b9150611b9483611645565b9250828202611ba281611645565b91508282048414831517611bb957611bb8611ad3565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611bfa82611645565b9150611c0583611645565b925082611c1557611c14611bc0565b5b828204905092915050565b7f46656520697320726571756972656420746f20696e6974696174652076616c6960008201527f646174696f6e20706f6f6c000000000000000000000000000000000000000000602082015250565b6000611c7c602b8361153b565b9150611c8782611c20565b604082019050919050565b60006020820190508181036000830152611cab81611c6f565b9050919050565b6000606082019050611cc76000830186611851565b611cd460208301856116f1565b611ce160408301846116f1565b949350505050565b7f506f6f6c20656e642074696d6520686173207061737365640000000000000000600082015250565b6000611d1f60188361153b565b9150611d2a82611ce9565b602082019050919050565b60006020820190508181036000830152611d4e81611d12565b905091905056fea2646970667358221220543771aac7aa110b00bb69c10205354a58c1509a944f5ce6bd88adcebb5cf2c264736f6c63430008180033", - "deployedBytecode": "0x6080604052600436106100fe5760003560e01c80635daf08ca1161009557806395d89b411161006457806395d89b4114610364578063a230c5241461038f578063a2336279146103cc578063a9059cbb14610411578063dd62ed3e1461044e576100fe565b80635daf08ca1461028f57806360780cd7146102cc578063642b5bfb146102fc57806370a0823114610327576100fe565b806318160ddd116100d157806318160ddd146101d357806323b872dd146101fe578063313ce5671461023b578063561b246314610266576100fe565b806306fdde0314610103578063095ea7b31461012e57806311aee3801461016b57806317c1821714610196575b600080fd5b34801561010f57600080fd5b5061011861048b565b60405161012591906115c0565b60405180910390f35b34801561013a57600080fd5b506101556004803603810190610150919061167b565b61051d565b60405161016291906116d6565b60405180910390f35b34801561017757600080fd5b50610180610540565b60405161018d9190611700565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b8919061171b565b610546565b6040516101ca91906116d6565b60405180910390f35b3480156101df57600080fd5b506101e8610a02565b6040516101f59190611700565b60405180910390f35b34801561020a57600080fd5b5061022560048036038101906102209190611748565b610a0c565b60405161023291906116d6565b60405180910390f35b34801561024757600080fd5b50610250610a3b565b60405161025d91906117b7565b60405180910390f35b34801561027257600080fd5b5061028d600480360381019061028891906117fe565b610a44565b005b34801561029b57600080fd5b506102b660048036038101906102b1919061171b565b610a6d565b6040516102c39190611860565b60405180910390f35b6102e660048036038101906102e1919061167b565b610aa0565b6040516102f39190611700565b60405180910390f35b34801561030857600080fd5b50610311610bf7565b60405161031e9190611700565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061187b565b610bfd565b60405161035b9190611700565b60405180910390f35b34801561037057600080fd5b50610379610c45565b60405161038691906115c0565b60405180910390f35b34801561039b57600080fd5b506103b660048036038101906103b1919061187b565b610cd7565b6040516103c391906116d6565b60405180910390f35b3480156103d857600080fd5b506103f360048036038101906103ee919061171b565b610cf7565b604051610408999897969594939291906118a8565b60405180910390f35b34801561041d57600080fd5b506104386004803603810190610433919061167b565b610d7f565b60405161044591906116d6565b60405180910390f35b34801561045a57600080fd5b5061047560048036038101906104709190611935565b610da2565b6040516104829190611700565b60405180910390f35b60606003805461049a906119a4565b80601f01602080910402602001604051908101604052809291908181526020018280546104c6906119a4565b80156105135780601f106104e857610100808354040283529160200191610513565b820191906000526020600020905b8154815290600101906020018083116104f657829003601f168201915b5050505050905090565b600080610528610e29565b9050610535818585610e31565b600191505092915050565b60065481565b600080600860008481526020019081526020016000209050806007015442116105a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059b90611a47565b60405180910390fd5b600015158160080160009054906101000a900460ff161515146105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390611ab3565b60405180910390fd5b600080600080600090505b84600101548110156106785784600001600082815260200190815260200160002091508160000160009054906101000a900460ff1615610658578160010154846106519190611b02565b935061066b565b8160010154836106689190611b02565b92505b8080600101915050610607565b508183101594508480156106fa5750600760008560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15610808578360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006006600081548092919061073b90611b36565b91905055815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60018460080160006101000a81548160ff0219169083151502179055507f9f3584cbb084f56a98b2b581e13f64e4ec315e59157d67dc65497890e85558658560405161085491906116d6565b60405180910390a1600085610869578261086b565b835b905060008661087a578461087c565b835b905060005b866001015481101561092c5786600001600082815260200190815260200160002093508360000160009054906101000a900460ff1615158815150361091f576000838560010154846108d39190611b7e565b6108dd9190611bef565b905061091d308660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168388600101546109189190611b02565b610e43565b505b8080600101915050610881565b5060005b6006548110156109f65760006005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600061097c610a02565b61098583610bfd565b8a600301546109949190611b7e565b61099e9190611bef565b90508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156109e6573d6000803e3d6000fd5b5050508080600101915050610930565b50505050505050919050565b6000600254905090565b600080610a17610e29565b9050610a24858285610f37565b610a2f858585610e43565b60019150509392505050565b60006012905090565b6000600860008581526020019081526020016000209050610a6781338585610fcb565b50505050565b60056020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000803411610ae4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adb90611c92565b60405180910390fd5b60096000815480929190610af790611b36565b9190505590506000600860008381526020019081526020016000209050838160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503481600301819055508281600601819055508242610b759190611b02565b8160070181905550610b8730346110b2565b610ba08185600234610b999190611bef565b6001610fcb565b610bb98185600234610bb29190611bef565b6000610fcb565b7f6e5c598b821d7fa8550e5fea58ab6e27c59e1cbe1df75a8591aa0c453b49e10a82604051610be89190611700565b60405180910390a15092915050565b60095481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054610c54906119a4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c80906119a4565b8015610ccd5780601f10610ca257610100808354040283529160200191610ccd565b820191906000526020600020905b815481529060010190602001808311610cb057829003601f168201915b5050505050905090565b60076020528060005260406000206000915054906101000a900460ff1681565b60086020528060005260406000206000915090508060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030154908060040154908060050154908060060154908060070154908060080160009054906101000a900460ff16908060080160019054906101000a900460ff16905089565b600080610d8a610e29565b9050610d97818585610e43565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610e3e8383836001611134565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610eb55760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610eac9190611860565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f275760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610f1e9190611860565b60405180910390fd5b610f3283838361130b565b505050565b6000610f438484610da2565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610fc55781811015610fb5578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610fac93929190611cb2565b60405180910390fd5b610fc484848484036000611134565b5b50505050565b8360070154421115611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990611d35565b60405180910390fd5b600084600001600086600101600081548092919061102f90611b36565b9190505581526020019081526020016000209050838160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818160000160006101000a81548160ff0219169083151502179055508281600101819055505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111245760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161111b9190611860565b60405180910390fd5b6111306000838361130b565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036111a65760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161119d9190611860565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112185760006040517f94280d6200000000000000000000000000000000000000000000000000000000815260040161120f9190611860565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508015611305578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516112fc9190611700565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361135d5780600260008282546113519190611b02565b92505081905550611430565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156113e9578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016113e093929190611cb2565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361147957806002600082825403925050819055506114c6565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115239190611700565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561156a57808201518184015260208101905061154f565b60008484015250505050565b6000601f19601f8301169050919050565b600061159282611530565b61159c818561153b565b93506115ac81856020860161154c565b6115b581611576565b840191505092915050565b600060208201905081810360008301526115da8184611587565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611612826115e7565b9050919050565b61162281611607565b811461162d57600080fd5b50565b60008135905061163f81611619565b92915050565b6000819050919050565b61165881611645565b811461166357600080fd5b50565b6000813590506116758161164f565b92915050565b60008060408385031215611692576116916115e2565b5b60006116a085828601611630565b92505060206116b185828601611666565b9150509250929050565b60008115159050919050565b6116d0816116bb565b82525050565b60006020820190506116eb60008301846116c7565b92915050565b6116fa81611645565b82525050565b600060208201905061171560008301846116f1565b92915050565b600060208284031215611731576117306115e2565b5b600061173f84828501611666565b91505092915050565b600080600060608486031215611761576117606115e2565b5b600061176f86828701611630565b935050602061178086828701611630565b925050604061179186828701611666565b9150509250925092565b600060ff82169050919050565b6117b18161179b565b82525050565b60006020820190506117cc60008301846117a8565b92915050565b6117db816116bb565b81146117e657600080fd5b50565b6000813590506117f8816117d2565b92915050565b600080600060608486031215611817576118166115e2565b5b600061182586828701611666565b935050602061183686828701611666565b9250506040611847868287016117e9565b9150509250925092565b61185a81611607565b82525050565b60006020820190506118756000830184611851565b92915050565b600060208284031215611891576118906115e2565b5b600061189f84828501611630565b91505092915050565b6000610120820190506118be600083018c6116f1565b6118cb602083018b611851565b6118d8604083018a6116f1565b6118e560608301896116f1565b6118f260808301886116f1565b6118ff60a08301876116f1565b61190c60c08301866116f1565b61191960e08301856116c7565b6119276101008301846116c7565b9a9950505050505050505050565b6000806040838503121561194c5761194b6115e2565b5b600061195a85828601611630565b925050602061196b85828601611630565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806119bc57607f821691505b6020821081036119cf576119ce611975565b5b50919050565b7f506f6f6c20656e642074696d6520686173206e6f74207965742061727269766560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b6000611a3160218361153b565b9150611a3c826119d5565b604082019050919050565b60006020820190508181036000830152611a6081611a24565b9050919050565b7f506f6f6c20697320616c7265616479207265736f6c7665640000000000000000600082015250565b6000611a9d60188361153b565b9150611aa882611a67565b602082019050919050565b60006020820190508181036000830152611acc81611a90565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611b0d82611645565b9150611b1883611645565b9250828201905080821115611b3057611b2f611ad3565b5b92915050565b6000611b4182611645565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b7357611b72611ad3565b5b600182019050919050565b6000611b8982611645565b9150611b9483611645565b9250828202611ba281611645565b91508282048414831517611bb957611bb8611ad3565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611bfa82611645565b9150611c0583611645565b925082611c1557611c14611bc0565b5b828204905092915050565b7f46656520697320726571756972656420746f20696e6974696174652076616c6960008201527f646174696f6e20706f6f6c000000000000000000000000000000000000000000602082015250565b6000611c7c602b8361153b565b9150611c8782611c20565b604082019050919050565b60006020820190508181036000830152611cab81611c6f565b9050919050565b6000606082019050611cc76000830186611851565b611cd460208301856116f1565b611ce160408301846116f1565b949350505050565b7f506f6f6c20656e642074696d6520686173207061737365640000000000000000600082015250565b6000611d1f60188361153b565b9150611d2a82611ce9565b602082019050919050565b60006020820190508181036000830152611d4e81611d12565b905091905056fea2646970667358221220543771aac7aa110b00bb69c10205354a58c1509a944f5ce6bd88adcebb5cf2c264736f6c63430008180033", + "bytecode": "0x60806040523480156200001157600080fd5b506040518060400160405280600a81526020017f52657075746174696f6e000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f524550000000000000000000000000000000000000000000000000000000000081525081600390816200008f919062000324565b508060049081620000a1919062000324565b5050506200040b565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200012c57607f821691505b602082108103620001425762000141620000e4565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620001ac7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200016d565b620001b886836200016d565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000205620001ff620001f984620001d0565b620001da565b620001d0565b9050919050565b6000819050919050565b6200022183620001e4565b6200023962000230826200020c565b8484546200017a565b825550505050565b600090565b6200025062000241565b6200025d81848462000216565b505050565b5b8181101562000285576200027960008262000246565b60018101905062000263565b5050565b601f821115620002d4576200029e8162000148565b620002a9846200015d565b81016020851015620002b9578190505b620002d1620002c8856200015d565b83018262000262565b50505b505050565b600082821c905092915050565b6000620002f960001984600802620002d9565b1980831691505092915050565b6000620003148383620002e6565b9150826002028217905092915050565b6200032f82620000aa565b67ffffffffffffffff8111156200034b576200034a620000b5565b5b62000357825462000113565b6200036482828562000289565b600060209050601f8311600181146200039c576000841562000387578287015190505b62000393858262000306565b86555062000403565b601f198416620003ac8662000148565b60005b82811015620003d657848901518255600182019150602085019450602081019050620003af565b86831015620003f65784890151620003f2601f891682620002e6565b8355505b6001600288020188555050505b505050505050565b61237e806200041b6000396000f3fe60806040526004361061012a5760003560e01c8063561b2463116100ab57806395d89b411161006f57806395d89b41146104445780639fcb294b1461046f578063a230c5241461049f578063a2336279146104dc578063a9059cbb14610522578063dd62ed3e1461055f5761012a565b8063561b2463146103395780635daf08ca14610362578063642b5bfb1461039f57806370a08231146103ca57806388380274146104075761012a565b806317c18217116100f257806317c182171461022c57806318160ddd1461026957806323b872dd14610294578063313ce567146102d15780633ff75442146102fc5761012a565b806306fdde031461012f578063095ea7b31461015a5780630b1e7f831461019757806311aee380146101d657806317906c2e14610201575b600080fd5b34801561013b57600080fd5b5061014461059c565b6040516101519190611a11565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190611acc565b61062e565b60405161018e9190611b27565b60405180910390f35b3480156101a357600080fd5b506101be60048036038101906101b99190611b42565b610651565b6040516101cd93929190611b8d565b60405180910390f35b3480156101e257600080fd5b506101eb6106bb565b6040516101f89190611bc4565b60405180910390f35b34801561020d57600080fd5b506102166106c1565b6040516102239190611bc4565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e9190611b42565b6106c7565b6040516102609190611b27565b60405180910390f35b34801561027557600080fd5b5061027e610c1b565b60405161028b9190611bc4565b60405180910390f35b3480156102a057600080fd5b506102bb60048036038101906102b69190611bdf565b610c25565b6040516102c89190611b27565b60405180910390f35b3480156102dd57600080fd5b506102e6610c54565b6040516102f39190611c4e565b60405180910390f35b34801561030857600080fd5b50610323600480360381019061031e9190611c69565b610c5d565b6040516103309190611bc4565b60405180910390f35b34801561034557600080fd5b50610360600480360381019061035b9190611cc2565b610d24565b005b34801561036e57600080fd5b5061038960048036038101906103849190611b42565b610d4d565b6040516103969190611d15565b60405180910390f35b3480156103ab57600080fd5b506103b4610d80565b6040516103c19190611bc4565b60405180910390f35b3480156103d657600080fd5b506103f160048036038101906103ec9190611c69565b610d86565b6040516103fe9190611bc4565b60405180910390f35b34801561041357600080fd5b5061042e60048036038101906104299190611d30565b610dce565b60405161043b9190611b27565b60405180910390f35b34801561045057600080fd5b50610459610e59565b6040516104669190611a11565b60405180910390f35b61048960048036038101906104849190611d83565b610eeb565b6040516104969190611bc4565b60405180910390f35b3480156104ab57600080fd5b506104c660048036038101906104c19190611c69565b611128565b6040516104d39190611b27565b60405180910390f35b3480156104e857600080fd5b5061050360048036038101906104fe9190611b42565b611148565b6040516105199a99989796959493929190611dc3565b60405180910390f35b34801561052e57600080fd5b5061054960048036038101906105449190611acc565b6111b6565b6040516105569190611b27565b60405180910390f35b34801561056b57600080fd5b5061058660048036038101906105819190611e5f565b6111d9565b6040516105939190611bc4565b60405180910390f35b6060600380546105ab90611ece565b80601f01602080910402602001604051908101604052809291908181526020018280546105d790611ece565b80156106245780601f106105f957610100808354040283529160200191610624565b820191906000526020600020905b81548152906001019060200180831161060757829003601f168201915b5050505050905090565b600080610639611260565b9050610646818585611268565b600191505092915050565b600a6020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b60065481565b600b5481565b6000806008600084815260200190815260200160002090506000600a600083600101548152602001908152602001600020905081600801544211610740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073790611f71565b60405180910390fd5b600015158260090160009054906101000a900460ff16151514610798576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078f90611fdd565b60405180910390fd5b600080600080600090505b85600301548110156108145785600201600082815260200190815260200160002091508160010160009054906101000a900460ff16156107f4578160020154846107ed919061202c565b9350610807565b816002015483610804919061202c565b92505b80806001019150506107a3565b508183101595508580156108965750600760008560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156109a4578360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660056000600660008154809291906108d790612060565b91905055815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60018560090160006101000a81548160ff021916908315150217905550858560090160016101000a81548160ff0219169083151502179055507f926ee3a021d24f18cfab444988fa0338bcaa0f1e0d7c2211c07d10cbad6772948787604051610a0e9291906120a8565b60405180910390a1600086610a235782610a25565b835b9050600087610a345784610a36565b835b9050600080600090505b8860030154811015610af95788600201600082815260200190815260200160002094508460010160009054906101000a900460ff1615158a151503610aec57600084866002015485610a9291906120d1565b610a9c9190612142565b9050610adc308760030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838960020154610ad7919061202c565b61127a565b8083610ae8919061202c565b9250505b8080600101915050610a40565b5060008183610b089190612173565b90506000811115610b4357610b42308960020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361127a565b5b60005b600654811015610c0c5760006005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000610b92610c1b565b610b9b83610d86565b8d60040154610baa91906120d1565b610bb49190612142565b90508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610bfc573d6000803e3d6000fd5b5050508080600101915050610b46565b50505050505050505050919050565b6000600254905090565b600080610c30611260565b9050610c3d85828561136e565b610c4885858561127a565b60019150509392505050565b60006012905090565b6000600b6000815480929190610c7290612060565b9190505590506000600a60008381526020019081526020016000209050828160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550338160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081816000018190555050919050565b6000600860008581526020019081526020016000209050610d4781338585611402565b50505050565b60056020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610dda84846111b6565b90508015610e52578373ffffffffffffffffffffffffffffffffffffffff1663216ed6ad3385856040518463ffffffff1660e01b8152600401610e1f939291906121a7565b600060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050505b9392505050565b606060048054610e6890611ece565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9490611ece565b8015610ee15780601f10610eb657610100808354040283529160200191610ee1565b820191906000526020600020905b815481529060010190602001808311610ec457829003601f168201915b5050505050905090565b6000803411610f2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2690612250565b60405180910390fd5b6000600a60008581526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd0906122bc565b60405180910390fd5b60096000815480929190610fec90612060565b91905055915060006008600084815260200190815260200160002090508481600101819055503481600401819055508381600701819055508342611030919061202c565b816008018190555082816000018190555061106f8260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1634611503565b6110ac818360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002346110a59190612142565b6001611402565b6110e9818360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002346110e29190612142565b6000611402565b7f6e5c598b821d7fa8550e5fea58ab6e27c59e1cbe1df75a8591aa0c453b49e10a836040516111189190611bc4565b60405180910390a1505092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b60086020528060005260406000206000915090508060000154908060010154908060030154908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460ff16908060090160019054906101000a900460ff1690508a565b6000806111c1611260565b90506111ce81858561127a565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b6112758383836001611585565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112ec5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016112e39190611d15565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361135e5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016113559190611d15565b60405180910390fd5b61136983838361175c565b505050565b600061137a84846111d9565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146113fc57818110156113ec578281836040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526004016113e3939291906121a7565b60405180910390fd5b6113fb84848484036000611585565b5b50505050565b8360080154421115611449576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144090612328565b60405180910390fd5b61145483308461127a565b600084600301600081548092919061146b90612060565b91905055905060008560020160008381526020019081526020016000209050848160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828160010160006101000a81548160ff021916908315150217905550838160020181905550818160000181905550505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036115755760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161156c9190611d15565b60405180910390fd5b6115816000838361175c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036115f75760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016115ee9190611d15565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116695760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016116609190611d15565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508015611756578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161174d9190611bc4565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ae5780600260008282546117a2919061202c565b92505081905550611881565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561183a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401611831939291906121a7565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118ca5780600260008282540392505081905550611917565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516119749190611bc4565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156119bb5780820151818401526020810190506119a0565b60008484015250505050565b6000601f19601f8301169050919050565b60006119e382611981565b6119ed818561198c565b93506119fd81856020860161199d565b611a06816119c7565b840191505092915050565b60006020820190508181036000830152611a2b81846119d8565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a6382611a38565b9050919050565b611a7381611a58565b8114611a7e57600080fd5b50565b600081359050611a9081611a6a565b92915050565b6000819050919050565b611aa981611a96565b8114611ab457600080fd5b50565b600081359050611ac681611aa0565b92915050565b60008060408385031215611ae357611ae2611a33565b5b6000611af185828601611a81565b9250506020611b0285828601611ab7565b9150509250929050565b60008115159050919050565b611b2181611b0c565b82525050565b6000602082019050611b3c6000830184611b18565b92915050565b600060208284031215611b5857611b57611a33565b5b6000611b6684828501611ab7565b91505092915050565b611b7881611a96565b82525050565b611b8781611a58565b82525050565b6000606082019050611ba26000830186611b6f565b611baf6020830185611b7e565b611bbc6040830184611b7e565b949350505050565b6000602082019050611bd96000830184611b6f565b92915050565b600080600060608486031215611bf857611bf7611a33565b5b6000611c0686828701611a81565b9350506020611c1786828701611a81565b9250506040611c2886828701611ab7565b9150509250925092565b600060ff82169050919050565b611c4881611c32565b82525050565b6000602082019050611c636000830184611c3f565b92915050565b600060208284031215611c7f57611c7e611a33565b5b6000611c8d84828501611a81565b91505092915050565b611c9f81611b0c565b8114611caa57600080fd5b50565b600081359050611cbc81611c96565b92915050565b600080600060608486031215611cdb57611cda611a33565b5b6000611ce986828701611ab7565b9350506020611cfa86828701611ab7565b9250506040611d0b86828701611cad565b9150509250925092565b6000602082019050611d2a6000830184611b7e565b92915050565b600080600060608486031215611d4957611d48611a33565b5b6000611d5786828701611a81565b9350506020611d6886828701611ab7565b9250506040611d7986828701611ab7565b9150509250925092565b60008060408385031215611d9a57611d99611a33565b5b6000611da885828601611ab7565b9250506020611db985828601611ab7565b9150509250929050565b600061014082019050611dd9600083018d611b6f565b611de6602083018c611b6f565b611df3604083018b611b6f565b611e00606083018a611b6f565b611e0d6080830189611b6f565b611e1a60a0830188611b6f565b611e2760c0830187611b6f565b611e3460e0830186611b6f565b611e42610100830185611b18565b611e50610120830184611b18565b9b9a5050505050505050505050565b60008060408385031215611e7657611e75611a33565b5b6000611e8485828601611a81565b9250506020611e9585828601611a81565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611ee657607f821691505b602082108103611ef957611ef8611e9f565b5b50919050565b7f506f6f6c20656e642074696d6520686173206e6f74207965742061727269766560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b6000611f5b60218361198c565b9150611f6682611eff565b604082019050919050565b60006020820190508181036000830152611f8a81611f4e565b9050919050565b7f506f6f6c20697320616c7265616479207265736f6c7665640000000000000000600082015250565b6000611fc760188361198c565b9150611fd282611f91565b602082019050919050565b60006020820190508181036000830152611ff681611fba565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061203782611a96565b915061204283611a96565b925082820190508082111561205a57612059611ffd565b5b92915050565b600061206b82611a96565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361209d5761209c611ffd565b5b600182019050919050565b60006040820190506120bd6000830185611b6f565b6120ca6020830184611b18565b9392505050565b60006120dc82611a96565b91506120e783611a96565b92508282026120f581611a96565b9150828204841483151761210c5761210b611ffd565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061214d82611a96565b915061215883611a96565b92508261216857612167612113565b5b828204905092915050565b600061217e82611a96565b915061218983611a96565b92508282039050818111156121a1576121a0611ffd565b5b92915050565b60006060820190506121bc6000830186611b7e565b6121c96020830185611b6f565b6121d66040830184611b6f565b949350505050565b7f46656520697320726571756972656420746f20696e6974696174652076616c6960008201527f646174696f6e20706f6f6c000000000000000000000000000000000000000000602082015250565b600061223a602b8361198c565b9150612245826121de565b604082019050919050565b600060208201905081810360008301526122698161222d565b9050919050565b7f54617267657420706f7374206e6f7420666f756e640000000000000000000000600082015250565b60006122a660158361198c565b91506122b182612270565b602082019050919050565b600060208201905081810360008301526122d581612299565b9050919050565b7f506f6f6c20656e642074696d6520686173207061737365640000000000000000600082015250565b600061231260188361198c565b915061231d826122dc565b602082019050919050565b6000602082019050818103600083015261234181612305565b905091905056fea26469706673582212205bf3734283409d3522253e6c0d8d80b9bbe048ca1eb009f5b29f5f5fecf1ec0b64736f6c63430008180033", + "deployedBytecode": "0x60806040526004361061012a5760003560e01c8063561b2463116100ab57806395d89b411161006f57806395d89b41146104445780639fcb294b1461046f578063a230c5241461049f578063a2336279146104dc578063a9059cbb14610522578063dd62ed3e1461055f5761012a565b8063561b2463146103395780635daf08ca14610362578063642b5bfb1461039f57806370a08231146103ca57806388380274146104075761012a565b806317c18217116100f257806317c182171461022c57806318160ddd1461026957806323b872dd14610294578063313ce567146102d15780633ff75442146102fc5761012a565b806306fdde031461012f578063095ea7b31461015a5780630b1e7f831461019757806311aee380146101d657806317906c2e14610201575b600080fd5b34801561013b57600080fd5b5061014461059c565b6040516101519190611a11565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190611acc565b61062e565b60405161018e9190611b27565b60405180910390f35b3480156101a357600080fd5b506101be60048036038101906101b99190611b42565b610651565b6040516101cd93929190611b8d565b60405180910390f35b3480156101e257600080fd5b506101eb6106bb565b6040516101f89190611bc4565b60405180910390f35b34801561020d57600080fd5b506102166106c1565b6040516102239190611bc4565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e9190611b42565b6106c7565b6040516102609190611b27565b60405180910390f35b34801561027557600080fd5b5061027e610c1b565b60405161028b9190611bc4565b60405180910390f35b3480156102a057600080fd5b506102bb60048036038101906102b69190611bdf565b610c25565b6040516102c89190611b27565b60405180910390f35b3480156102dd57600080fd5b506102e6610c54565b6040516102f39190611c4e565b60405180910390f35b34801561030857600080fd5b50610323600480360381019061031e9190611c69565b610c5d565b6040516103309190611bc4565b60405180910390f35b34801561034557600080fd5b50610360600480360381019061035b9190611cc2565b610d24565b005b34801561036e57600080fd5b5061038960048036038101906103849190611b42565b610d4d565b6040516103969190611d15565b60405180910390f35b3480156103ab57600080fd5b506103b4610d80565b6040516103c19190611bc4565b60405180910390f35b3480156103d657600080fd5b506103f160048036038101906103ec9190611c69565b610d86565b6040516103fe9190611bc4565b60405180910390f35b34801561041357600080fd5b5061042e60048036038101906104299190611d30565b610dce565b60405161043b9190611b27565b60405180910390f35b34801561045057600080fd5b50610459610e59565b6040516104669190611a11565b60405180910390f35b61048960048036038101906104849190611d83565b610eeb565b6040516104969190611bc4565b60405180910390f35b3480156104ab57600080fd5b506104c660048036038101906104c19190611c69565b611128565b6040516104d39190611b27565b60405180910390f35b3480156104e857600080fd5b5061050360048036038101906104fe9190611b42565b611148565b6040516105199a99989796959493929190611dc3565b60405180910390f35b34801561052e57600080fd5b5061054960048036038101906105449190611acc565b6111b6565b6040516105569190611b27565b60405180910390f35b34801561056b57600080fd5b5061058660048036038101906105819190611e5f565b6111d9565b6040516105939190611bc4565b60405180910390f35b6060600380546105ab90611ece565b80601f01602080910402602001604051908101604052809291908181526020018280546105d790611ece565b80156106245780601f106105f957610100808354040283529160200191610624565b820191906000526020600020905b81548152906001019060200180831161060757829003601f168201915b5050505050905090565b600080610639611260565b9050610646818585611268565b600191505092915050565b600a6020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b60065481565b600b5481565b6000806008600084815260200190815260200160002090506000600a600083600101548152602001908152602001600020905081600801544211610740576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073790611f71565b60405180910390fd5b600015158260090160009054906101000a900460ff16151514610798576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078f90611fdd565b60405180910390fd5b600080600080600090505b85600301548110156108145785600201600082815260200190815260200160002091508160010160009054906101000a900460ff16156107f4578160020154846107ed919061202c565b9350610807565b816002015483610804919061202c565b92505b80806001019150506107a3565b508183101595508580156108965750600760008560020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156109a4578360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660056000600660008154809291906108d790612060565b91905055815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b60018560090160006101000a81548160ff021916908315150217905550858560090160016101000a81548160ff0219169083151502179055507f926ee3a021d24f18cfab444988fa0338bcaa0f1e0d7c2211c07d10cbad6772948787604051610a0e9291906120a8565b60405180910390a1600086610a235782610a25565b835b9050600087610a345784610a36565b835b9050600080600090505b8860030154811015610af95788600201600082815260200190815260200160002094508460010160009054906101000a900460ff1615158a151503610aec57600084866002015485610a9291906120d1565b610a9c9190612142565b9050610adc308760030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838960020154610ad7919061202c565b61127a565b8083610ae8919061202c565b9250505b8080600101915050610a40565b5060008183610b089190612173565b90506000811115610b4357610b42308960020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361127a565b5b60005b600654811015610c0c5760006005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000610b92610c1b565b610b9b83610d86565b8d60040154610baa91906120d1565b610bb49190612142565b90508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610bfc573d6000803e3d6000fd5b5050508080600101915050610b46565b50505050505050505050919050565b6000600254905090565b600080610c30611260565b9050610c3d85828561136e565b610c4885858561127a565b60019150509392505050565b60006012905090565b6000600b6000815480929190610c7290612060565b9190505590506000600a60008381526020019081526020016000209050828160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550338160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081816000018190555050919050565b6000600860008581526020019081526020016000209050610d4781338585611402565b50505050565b60056020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610dda84846111b6565b90508015610e52578373ffffffffffffffffffffffffffffffffffffffff1663216ed6ad3385856040518463ffffffff1660e01b8152600401610e1f939291906121a7565b600060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050505b9392505050565b606060048054610e6890611ece565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9490611ece565b8015610ee15780601f10610eb657610100808354040283529160200191610ee1565b820191906000526020600020905b815481529060010190602001808311610ec457829003601f168201915b5050505050905090565b6000803411610f2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2690612250565b60405180910390fd5b6000600a60008581526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610fd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd0906122bc565b60405180910390fd5b60096000815480929190610fec90612060565b91905055915060006008600084815260200190815260200160002090508481600101819055503481600401819055508381600701819055508342611030919061202c565b816008018190555082816000018190555061106f8260020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1634611503565b6110ac818360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002346110a59190612142565b6001611402565b6110e9818360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002346110e29190612142565b6000611402565b7f6e5c598b821d7fa8550e5fea58ab6e27c59e1cbe1df75a8591aa0c453b49e10a836040516111189190611bc4565b60405180910390a1505092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b60086020528060005260406000206000915090508060000154908060010154908060030154908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460ff16908060090160019054906101000a900460ff1690508a565b6000806111c1611260565b90506111ce81858561127a565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b6112758383836001611585565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112ec5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016112e39190611d15565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361135e5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016113559190611d15565b60405180910390fd5b61136983838361175c565b505050565b600061137a84846111d9565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146113fc57818110156113ec578281836040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526004016113e3939291906121a7565b60405180910390fd5b6113fb84848484036000611585565b5b50505050565b8360080154421115611449576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144090612328565b60405180910390fd5b61145483308461127a565b600084600301600081548092919061146b90612060565b91905055905060008560020160008381526020019081526020016000209050848160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828160010160006101000a81548160ff021916908315150217905550838160020181905550818160000181905550505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036115755760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161156c9190611d15565b60405180910390fd5b6115816000838361175c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036115f75760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016115ee9190611d15565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036116695760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016116609190611d15565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508015611756578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161174d9190611bc4565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036117ae5780600260008282546117a2919061202c565b92505081905550611881565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561183a578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401611831939291906121a7565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118ca5780600260008282540392505081905550611917565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516119749190611bc4565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156119bb5780820151818401526020810190506119a0565b60008484015250505050565b6000601f19601f8301169050919050565b60006119e382611981565b6119ed818561198c565b93506119fd81856020860161199d565b611a06816119c7565b840191505092915050565b60006020820190508181036000830152611a2b81846119d8565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a6382611a38565b9050919050565b611a7381611a58565b8114611a7e57600080fd5b50565b600081359050611a9081611a6a565b92915050565b6000819050919050565b611aa981611a96565b8114611ab457600080fd5b50565b600081359050611ac681611aa0565b92915050565b60008060408385031215611ae357611ae2611a33565b5b6000611af185828601611a81565b9250506020611b0285828601611ab7565b9150509250929050565b60008115159050919050565b611b2181611b0c565b82525050565b6000602082019050611b3c6000830184611b18565b92915050565b600060208284031215611b5857611b57611a33565b5b6000611b6684828501611ab7565b91505092915050565b611b7881611a96565b82525050565b611b8781611a58565b82525050565b6000606082019050611ba26000830186611b6f565b611baf6020830185611b7e565b611bbc6040830184611b7e565b949350505050565b6000602082019050611bd96000830184611b6f565b92915050565b600080600060608486031215611bf857611bf7611a33565b5b6000611c0686828701611a81565b9350506020611c1786828701611a81565b9250506040611c2886828701611ab7565b9150509250925092565b600060ff82169050919050565b611c4881611c32565b82525050565b6000602082019050611c636000830184611c3f565b92915050565b600060208284031215611c7f57611c7e611a33565b5b6000611c8d84828501611a81565b91505092915050565b611c9f81611b0c565b8114611caa57600080fd5b50565b600081359050611cbc81611c96565b92915050565b600080600060608486031215611cdb57611cda611a33565b5b6000611ce986828701611ab7565b9350506020611cfa86828701611ab7565b9250506040611d0b86828701611cad565b9150509250925092565b6000602082019050611d2a6000830184611b7e565b92915050565b600080600060608486031215611d4957611d48611a33565b5b6000611d5786828701611a81565b9350506020611d6886828701611ab7565b9250506040611d7986828701611ab7565b9150509250925092565b60008060408385031215611d9a57611d99611a33565b5b6000611da885828601611ab7565b9250506020611db985828601611ab7565b9150509250929050565b600061014082019050611dd9600083018d611b6f565b611de6602083018c611b6f565b611df3604083018b611b6f565b611e00606083018a611b6f565b611e0d6080830189611b6f565b611e1a60a0830188611b6f565b611e2760c0830187611b6f565b611e3460e0830186611b6f565b611e42610100830185611b18565b611e50610120830184611b18565b9b9a5050505050505050505050565b60008060408385031215611e7657611e75611a33565b5b6000611e8485828601611a81565b9250506020611e9585828601611a81565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611ee657607f821691505b602082108103611ef957611ef8611e9f565b5b50919050565b7f506f6f6c20656e642074696d6520686173206e6f74207965742061727269766560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b6000611f5b60218361198c565b9150611f6682611eff565b604082019050919050565b60006020820190508181036000830152611f8a81611f4e565b9050919050565b7f506f6f6c20697320616c7265616479207265736f6c7665640000000000000000600082015250565b6000611fc760188361198c565b9150611fd282611f91565b602082019050919050565b60006020820190508181036000830152611ff681611fba565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061203782611a96565b915061204283611a96565b925082820190508082111561205a57612059611ffd565b5b92915050565b600061206b82611a96565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361209d5761209c611ffd565b5b600182019050919050565b60006040820190506120bd6000830185611b6f565b6120ca6020830184611b18565b9392505050565b60006120dc82611a96565b91506120e783611a96565b92508282026120f581611a96565b9150828204841483151761210c5761210b611ffd565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061214d82611a96565b915061215883611a96565b92508261216857612167612113565b5b828204905092915050565b600061217e82611a96565b915061218983611a96565b92508282039050818111156121a1576121a0611ffd565b5b92915050565b60006060820190506121bc6000830186611b7e565b6121c96020830185611b6f565b6121d66040830184611b6f565b949350505050565b7f46656520697320726571756972656420746f20696e6974696174652076616c6960008201527f646174696f6e20706f6f6c000000000000000000000000000000000000000000602082015250565b600061223a602b8361198c565b9150612245826121de565b604082019050919050565b600060208201905081810360008301526122698161222d565b9050919050565b7f54617267657420706f7374206e6f7420666f756e640000000000000000000000600082015250565b60006122a660158361198c565b91506122b182612270565b602082019050919050565b600060208201905081810360008301526122d581612299565b9050919050565b7f506f6f6c20656e642074696d6520686173207061737365640000000000000000600082015250565b600061231260188361198c565b915061231d826122dc565b602082019050919050565b6000602082019050818103600083015261234181612305565b905091905056fea26469706673582212205bf3734283409d3522253e6c0d8d80b9bbe048ca1eb009f5b29f5f5fecf1ec0b64736f6c63430008180033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/client/src/assets/Work1.json b/client/src/assets/Work1.json index 8bc16ca..63761d1 100644 --- a/client/src/assets/Work1.json +++ b/client/src/assets/Work1.json @@ -38,37 +38,57 @@ "name": "WorkAssigned", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "requestIndex", + "type": "uint256" + } + ], + "name": "WorkEvidenceSubmitted", + "type": "event" + }, { "inputs": [ { "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "from", + "name": "sender", "type": "address" }, { "internalType": "uint256", - "name": "tokenId", + "name": "amount", "type": "uint256" }, { - "internalType": "bytes", - "name": "", - "type": "bytes" + "internalType": "uint256", + "name": "duration", + "type": "uint256" } ], - "name": "onERC721Received", - "outputs": [ + "name": "acceptAvailability", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { - "internalType": "bytes4", - "name": "", - "type": "bytes4" + "internalType": "uint256", + "name": "stakeIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" } ], + "name": "extendAvailability", + "outputs": [], "stateMutability": "nonpayable", "type": "function" }, @@ -85,6 +105,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeIndex", + "type": "uint256" + } + ], + "name": "reclaimAvailability", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "requestCount", @@ -149,6 +182,58 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "stakeCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "stakes", + "outputs": [ + { + "internalType": "address", + "name": "worker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "assigned", + "type": "bool" + }, + { + "internalType": "bool", + "name": "reclaimed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -181,8 +266,8 @@ "type": "function" } ], - "bytecode": "0x60c06040523480156200001157600080fd5b50604051620010bf380380620010bf833981810160405281019062000037919062000134565b8173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508060a0818152505050506200017b565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000ad8262000080565b9050919050565b6000620000c182620000a0565b9050919050565b620000d381620000b4565b8114620000df57600080fd5b50565b600081519050620000f381620000c8565b92915050565b6000819050919050565b6200010e81620000f9565b81146200011a57600080fd5b50565b6000815190506200012e8162000103565b92915050565b600080604083850312156200014e576200014d6200007b565b5b60006200015e85828601620000e2565b925050602062000171858286016200011d565b9150509250929050565b60805160a051610f10620001af600039600081816102d901526105da01526000818161022101526105070152610f106000f3fe6080604052600436106100705760003560e01c806381d12c581161004e57806381d12c58146100e7578063854b6a4f14610129578063a035b1fe14610152578063c4a325911461017d57610070565b8063150b7a02146100755780634b8b194c146100b25780635badbe4c146100bc575b600080fd5b34801561008157600080fd5b5061009c600480360381019061009791906109d8565b6101a6565b6040516100a99190610a9b565b60405180910390f35b6100ba6102d7565b005b3480156100c857600080fd5b506100d16103cd565b6040516100de9190610ac5565b60405180910390f35b3480156100f357600080fd5b5061010e60048036038101906101099190610ae0565b6103d3565b60405161012096959493929190610bae565b60405180910390f35b34801561013557600080fd5b50610150600480360381019061014b9190610c3b565b610449565b005b34801561015e57600080fd5b506101676105d8565b6040516101749190610ac5565b60405180910390f35b34801561018957600080fd5b506101a4600480360381019061019f9190610ae0565b6105fc565b005b600080600080600160008154809291906101bf90610caa565b9190505581526020019081526020016000209050858160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508481600101819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663249cfda987876040518363ffffffff1660e01b815260040161027a929190610cf2565b602060405180830381865afa158015610297573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bb9190610d30565b816002018190555063150b7a0260e01b91505095945050505050565b7f000000000000000000000000000000000000000000000000000000000000000034101561033a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033190610dba565b60405180910390fd5b60006003600081548092919061034f90610caa565b9190505590506000600260008381526020019081526020016000209050338160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503481600101819055506103c1826106fd565b81600301819055505050565b60035481565b60026020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900460ff16908060030154908060040160009054906101000a900460ff16908060050154905086565b60006002600084815260200190815260200160002090506001600381111561047457610473610b1c565b5b8160020160009054906101000a900460ff16600381111561049857610497610b1c565b5b146104a257600080fd5b600080600083600301548152602001908152602001600020905060028260020160006101000a81548160ff021916908360038111156104e4576104e3610b1c565b5b0217905550828260040160006101000a81548160ff0219169083151502179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166360780cd78260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16620151806040518363ffffffff1660e01b8152600401610587929190610cf2565b6020604051808303816000875af11580156105a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ca9190610d30565b826005018190555050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006002600083815260200190815260200160002090506000600381111561062757610626610b1c565b5b8160020160009054906101000a900460ff16600381111561064b5761064a610b1c565b5b1461065557600080fd5b60008060008360030154815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106cb57600080fd5b60018260020160006101000a81548160ff021916908360038111156106f3576106f2610b1c565b5b0217905550505050565b600061070761079f565b90506000806000838152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055507f429f9327062651dbcecaca0d28b9929067489d32d2c1133ec207c965f1f0ab198160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051610791929190610cf2565b60405180910390a150919050565b60008060005b6001548110156108075760008082815260200190815260200160002060030160009054906101000a900460ff166107fa5760008082815260200190815260200160002060020154826107f79190610dda565b91505b80806001019150506107a5565b50600081446108169190610e3d565b9050600080600090505b6001548110156108965760008082815260200190815260200160002060030160009054906101000a900460ff166108895760008082815260200190815260200160002060020154826108729190610dda565b91508282111561088857809450505050506108d2565b5b8080600101915050610820565b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c990610eba565b60405180910390fd5b90565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061090a826108df565b9050919050565b61091a816108ff565b811461092557600080fd5b50565b60008135905061093781610911565b92915050565b6000819050919050565b6109508161093d565b811461095b57600080fd5b50565b60008135905061096d81610947565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261099857610997610973565b5b8235905067ffffffffffffffff8111156109b5576109b4610978565b5b6020830191508360018202830111156109d1576109d061097d565b5b9250929050565b6000806000806000608086880312156109f4576109f36108d5565b5b6000610a0288828901610928565b9550506020610a1388828901610928565b9450506040610a248882890161095e565b935050606086013567ffffffffffffffff811115610a4557610a446108da565b5b610a5188828901610982565b92509250509295509295909350565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610a9581610a60565b82525050565b6000602082019050610ab06000830184610a8c565b92915050565b610abf8161093d565b82525050565b6000602082019050610ada6000830184610ab6565b92915050565b600060208284031215610af657610af56108d5565b5b6000610b048482850161095e565b91505092915050565b610b16816108ff565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110610b5c57610b5b610b1c565b5b50565b6000819050610b6d82610b4b565b919050565b6000610b7d82610b5f565b9050919050565b610b8d81610b72565b82525050565b60008115159050919050565b610ba881610b93565b82525050565b600060c082019050610bc36000830189610b0d565b610bd06020830188610ab6565b610bdd6040830187610b84565b610bea6060830186610ab6565b610bf76080830185610b9f565b610c0460a0830184610ab6565b979650505050505050565b610c1881610b93565b8114610c2357600080fd5b50565b600081359050610c3581610c0f565b92915050565b60008060408385031215610c5257610c516108d5565b5b6000610c608582860161095e565b9250506020610c7185828601610c26565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610cb58261093d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ce757610ce6610c7b565b5b600182019050919050565b6000604082019050610d076000830185610b0d565b610d146020830184610ab6565b9392505050565b600081519050610d2a81610947565b92915050565b600060208284031215610d4657610d456108d5565b5b6000610d5484828501610d1b565b91505092915050565b600082825260208201905092915050565b7f496e73756666696369656e742066656500000000000000000000000000000000600082015250565b6000610da4601083610d5d565b9150610daf82610d6e565b602082019050919050565b60006020820190508181036000830152610dd381610d97565b9050919050565b6000610de58261093d565b9150610df08361093d565b9250828201905080821115610e0857610e07610c7b565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000610e488261093d565b9150610e538361093d565b925082610e6357610e62610e0e565b5b828206905092915050565b7f4661696c656420746f2073656c65637420776f726b6572000000000000000000600082015250565b6000610ea4601783610d5d565b9150610eaf82610e6e565b602082019050919050565b60006020820190508181036000830152610ed381610e97565b905091905056fea264697066735822122030793d0a35ab8bb52990ae8bb18c165008c47e470d0ec7e48c14bab67f9c1b5d64736f6c63430008180033", - "deployedBytecode": "0x6080604052600436106100705760003560e01c806381d12c581161004e57806381d12c58146100e7578063854b6a4f14610129578063a035b1fe14610152578063c4a325911461017d57610070565b8063150b7a02146100755780634b8b194c146100b25780635badbe4c146100bc575b600080fd5b34801561008157600080fd5b5061009c600480360381019061009791906109d8565b6101a6565b6040516100a99190610a9b565b60405180910390f35b6100ba6102d7565b005b3480156100c857600080fd5b506100d16103cd565b6040516100de9190610ac5565b60405180910390f35b3480156100f357600080fd5b5061010e60048036038101906101099190610ae0565b6103d3565b60405161012096959493929190610bae565b60405180910390f35b34801561013557600080fd5b50610150600480360381019061014b9190610c3b565b610449565b005b34801561015e57600080fd5b506101676105d8565b6040516101749190610ac5565b60405180910390f35b34801561018957600080fd5b506101a4600480360381019061019f9190610ae0565b6105fc565b005b600080600080600160008154809291906101bf90610caa565b9190505581526020019081526020016000209050858160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508481600101819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663249cfda987876040518363ffffffff1660e01b815260040161027a929190610cf2565b602060405180830381865afa158015610297573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bb9190610d30565b816002018190555063150b7a0260e01b91505095945050505050565b7f000000000000000000000000000000000000000000000000000000000000000034101561033a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033190610dba565b60405180910390fd5b60006003600081548092919061034f90610caa565b9190505590506000600260008381526020019081526020016000209050338160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503481600101819055506103c1826106fd565b81600301819055505050565b60035481565b60026020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900460ff16908060030154908060040160009054906101000a900460ff16908060050154905086565b60006002600084815260200190815260200160002090506001600381111561047457610473610b1c565b5b8160020160009054906101000a900460ff16600381111561049857610497610b1c565b5b146104a257600080fd5b600080600083600301548152602001908152602001600020905060028260020160006101000a81548160ff021916908360038111156104e4576104e3610b1c565b5b0217905550828260040160006101000a81548160ff0219169083151502179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166360780cd78260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16620151806040518363ffffffff1660e01b8152600401610587929190610cf2565b6020604051808303816000875af11580156105a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ca9190610d30565b826005018190555050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006002600083815260200190815260200160002090506000600381111561062757610626610b1c565b5b8160020160009054906101000a900460ff16600381111561064b5761064a610b1c565b5b1461065557600080fd5b60008060008360030154815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106cb57600080fd5b60018260020160006101000a81548160ff021916908360038111156106f3576106f2610b1c565b5b0217905550505050565b600061070761079f565b90506000806000838152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055507f429f9327062651dbcecaca0d28b9929067489d32d2c1133ec207c965f1f0ab198160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051610791929190610cf2565b60405180910390a150919050565b60008060005b6001548110156108075760008082815260200190815260200160002060030160009054906101000a900460ff166107fa5760008082815260200190815260200160002060020154826107f79190610dda565b91505b80806001019150506107a5565b50600081446108169190610e3d565b9050600080600090505b6001548110156108965760008082815260200190815260200160002060030160009054906101000a900460ff166108895760008082815260200190815260200160002060020154826108729190610dda565b91508282111561088857809450505050506108d2565b5b8080600101915050610820565b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c990610eba565b60405180910390fd5b90565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061090a826108df565b9050919050565b61091a816108ff565b811461092557600080fd5b50565b60008135905061093781610911565b92915050565b6000819050919050565b6109508161093d565b811461095b57600080fd5b50565b60008135905061096d81610947565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261099857610997610973565b5b8235905067ffffffffffffffff8111156109b5576109b4610978565b5b6020830191508360018202830111156109d1576109d061097d565b5b9250929050565b6000806000806000608086880312156109f4576109f36108d5565b5b6000610a0288828901610928565b9550506020610a1388828901610928565b9450506040610a248882890161095e565b935050606086013567ffffffffffffffff811115610a4557610a446108da565b5b610a5188828901610982565b92509250509295509295909350565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b610a9581610a60565b82525050565b6000602082019050610ab06000830184610a8c565b92915050565b610abf8161093d565b82525050565b6000602082019050610ada6000830184610ab6565b92915050565b600060208284031215610af657610af56108d5565b5b6000610b048482850161095e565b91505092915050565b610b16816108ff565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110610b5c57610b5b610b1c565b5b50565b6000819050610b6d82610b4b565b919050565b6000610b7d82610b5f565b9050919050565b610b8d81610b72565b82525050565b60008115159050919050565b610ba881610b93565b82525050565b600060c082019050610bc36000830189610b0d565b610bd06020830188610ab6565b610bdd6040830187610b84565b610bea6060830186610ab6565b610bf76080830185610b9f565b610c0460a0830184610ab6565b979650505050505050565b610c1881610b93565b8114610c2357600080fd5b50565b600081359050610c3581610c0f565b92915050565b60008060408385031215610c5257610c516108d5565b5b6000610c608582860161095e565b9250506020610c7185828601610c26565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610cb58261093d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ce757610ce6610c7b565b5b600182019050919050565b6000604082019050610d076000830185610b0d565b610d146020830184610ab6565b9392505050565b600081519050610d2a81610947565b92915050565b600060208284031215610d4657610d456108d5565b5b6000610d5484828501610d1b565b91505092915050565b600082825260208201905092915050565b7f496e73756666696369656e742066656500000000000000000000000000000000600082015250565b6000610da4601083610d5d565b9150610daf82610d6e565b602082019050919050565b60006020820190508181036000830152610dd381610d97565b9050919050565b6000610de58261093d565b9150610df08361093d565b9250828201905080821115610e0857610e07610c7b565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000610e488261093d565b9150610e538361093d565b925082610e6357610e62610e0e565b5b828206905092915050565b7f4661696c656420746f2073656c65637420776f726b6572000000000000000000600082015250565b6000610ea4601783610d5d565b9150610eaf82610e6e565b602082019050919050565b60006020820190508181036000830152610ed381610e97565b905091905056fea264697066735822122030793d0a35ab8bb52990ae8bb18c165008c47e470d0ec7e48c14bab67f9c1b5d64736f6c63430008180033", + "bytecode": "0x60c06040523480156200001157600080fd5b50604051620019a6380380620019a6833981810160405281019062000037919062000134565b8173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508060a0818152505050506200017b565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000ad8262000080565b9050919050565b6000620000c182620000a0565b9050919050565b620000d381620000b4565b8114620000df57600080fd5b50565b600081519050620000f381620000c8565b92915050565b6000819050919050565b6200010e81620000f9565b81146200011a57600080fd5b50565b6000815190506200012e8162000103565b92915050565b600080604083850312156200014e576200014d6200007b565b5b60006200015e85828601620000e2565b925050602062000171858286016200011d565b9150509250929050565b60805160a0516117f0620001b66000396000818161031001526108f10152600081816105690152818161077a015261083c01526117f06000f3fe60806040526004361061009c5760003560e01c8063854b6a4f11610064578063854b6a4f1461016a578063a035b1fe14610193578063b5b20c00146101be578063c4a32591146101e7578063c4a9e11614610210578063d5a44f861461023b5761009c565b8063216ed6ad146100a15780634b8b194c146100ca5780635badbe4c146100d45780638150d507146100ff57806381d12c5814610128575b600080fd5b3480156100ad57600080fd5b506100c860048036038101906100c39190610e9e565b61027c565b005b6100d261030e565b005b3480156100e057600080fd5b506100e9610404565b6040516100f69190610f00565b60405180910390f35b34801561010b57600080fd5b5061012660048036038101906101219190610f1b565b61040a565b005b34801561013457600080fd5b5061014f600480360381019061014a9190610f1b565b61060e565b60405161016196959493929190610fe9565b60405180910390f35b34801561017657600080fd5b50610191600480360381019061018c9190611076565b610684565b005b34801561019f57600080fd5b506101a86108ef565b6040516101b59190610f00565b60405180910390f35b3480156101ca57600080fd5b506101e560048036038101906101e091906110b6565b610913565b005b3480156101f357600080fd5b5061020e60048036038101906102099190610f1b565b6109d4565b005b34801561021c57600080fd5b50610225610b78565b6040516102329190610f00565b60405180910390f35b34801561024757600080fd5b50610262600480360381019061025d9190610f1b565b610b7e565b6040516102739594939291906110f6565b60405180910390f35b60008060006001600081548092919061029490611178565b9190505581526020019081526020016000209050838160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828160010181905550814261030091906111c0565b816002018190555050505050565b7f0000000000000000000000000000000000000000000000000000000000000000341015610371576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036890611251565b60405180910390fd5b60006003600081548092919061038690611178565b9190505590506000600260008381526020019081526020016000209050338160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503481600101819055506103f882610bee565b81600301819055505050565b60035481565b600080600083815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a9906112e3565b60405180910390fd5b806002015442116104f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ef90611375565b60405180910390fd5b8060030160019054906101000a900460ff161561054a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610541906113e1565b60405180910390fd5b60018160030160016101000a81548160ff0219169083151502179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383600101546040518363ffffffff1660e01b81526004016105c6929190611401565b6020604051808303816000875af11580156105e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610609919061143f565b505050565b60026020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900460ff16908060030154908060040160009054906101000a900460ff16908060050154905086565b6000600260008481526020019081526020016000209050600160038111156106af576106ae610f57565b5b8160020160009054906101000a900460ff1660038111156106d3576106d2610f57565b5b14610713576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070a906114b8565b60405180910390fd5b600080600083600301548152602001908152602001600020905060028260020160006101000a81548160ff0219169083600381111561075557610754610f57565b5b0217905550828260040160006101000a81548160ff02191690831515021790555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633ff754428360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b81526004016107f591906114d8565b6020604051808303816000875af1158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190611508565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639fcb294b846001015483620151806040518463ffffffff1660e01b815260040161089d929190611535565b60206040518083038185885af11580156108bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108e09190611508565b83600501819055505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080600084815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b2906115d0565b60405180910390fd5b81426109c791906111c0565b8160020181905550505050565b6000600260008381526020019081526020016000209050600060038111156109ff576109fe610f57565b5b8160020160009054906101000a900460ff166003811115610a2357610a22610f57565b5b14610a63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5a9061163c565b60405180910390fd5b60008060008360030154815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b06906116ce565b60405180910390fd5b60018260020160006101000a81548160ff02191690836003811115610b3757610b36610f57565b5b02179055507ffaecd3b4db089bf25a48306100dd5fb2152e3887c7815b2b221dbb7da2f8e8dc83604051610b6b9190610f00565b60405180910390a1505050565b60015481565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030160009054906101000a900460ff16908060030160019054906101000a900460ff16905085565b6000610bf8610c90565b90506000806000838152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055507f429f9327062651dbcecaca0d28b9929067489d32d2c1133ec207c965f1f0ab198160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051610c82929190611401565b60405180910390a150919050565b60008060005b600154811015610d145760008082815260200190815260200160002060030160009054906101000a900460ff16610d0757600080828152602001908152602001600020600201544211610d07576000808281526020019081526020016000206001015482610d0491906111c0565b91505b8080600101915050610c96565b5060008111610d58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4f9061173a565b60405180910390fd5b60008144610d669190611789565b9050600080600090505b600154811015610dfe5760008082815260200190815260200160002060030160009054906101000a900460ff16610df157600080828152602001908152602001600020600201544211610df1576000808281526020019081526020016000206001015482610dde91906111c0565b915082821115610df057809450610dfe565b5b8080600101915050610d70565b5050505090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610e3582610e0a565b9050919050565b610e4581610e2a565b8114610e5057600080fd5b50565b600081359050610e6281610e3c565b92915050565b6000819050919050565b610e7b81610e68565b8114610e8657600080fd5b50565b600081359050610e9881610e72565b92915050565b600080600060608486031215610eb757610eb6610e05565b5b6000610ec586828701610e53565b9350506020610ed686828701610e89565b9250506040610ee786828701610e89565b9150509250925092565b610efa81610e68565b82525050565b6000602082019050610f156000830184610ef1565b92915050565b600060208284031215610f3157610f30610e05565b5b6000610f3f84828501610e89565b91505092915050565b610f5181610e2a565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110610f9757610f96610f57565b5b50565b6000819050610fa882610f86565b919050565b6000610fb882610f9a565b9050919050565b610fc881610fad565b82525050565b60008115159050919050565b610fe381610fce565b82525050565b600060c082019050610ffe6000830189610f48565b61100b6020830188610ef1565b6110186040830187610fbf565b6110256060830186610ef1565b6110326080830185610fda565b61103f60a0830184610ef1565b979650505050505050565b61105381610fce565b811461105e57600080fd5b50565b6000813590506110708161104a565b92915050565b6000806040838503121561108d5761108c610e05565b5b600061109b85828601610e89565b92505060206110ac85828601611061565b9150509250929050565b600080604083850312156110cd576110cc610e05565b5b60006110db85828601610e89565b92505060206110ec85828601610e89565b9150509250929050565b600060a08201905061110b6000830188610f48565b6111186020830187610ef1565b6111256040830186610ef1565b6111326060830185610fda565b61113f6080830184610fda565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061118382610e68565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036111b5576111b4611149565b5b600182019050919050565b60006111cb82610e68565b91506111d683610e68565b92508282019050808211156111ee576111ed611149565b5b92915050565b600082825260208201905092915050565b7f496e73756666696369656e742066656500000000000000000000000000000000600082015250565b600061123b6010836111f4565b915061124682611205565b602082019050919050565b6000602082019050818103600083015261126a8161122e565b9050919050565b7f576f726b65722063616e206f6e6c79207265636c61696d207468656972206f7760008201527f6e20617661696c6162696c697479207374616b65000000000000000000000000602082015250565b60006112cd6034836111f4565b91506112d882611271565b604082019050919050565b600060208201905081810360008301526112fc816112c0565b9050919050565b7f5374616b65206475726174696f6e20686173206e6f742079657420656c61707360008201527f6564000000000000000000000000000000000000000000000000000000000000602082015250565b600061135f6022836111f4565b915061136a82611303565b604082019050919050565b6000602082019050818103600083015261138e81611352565b9050919050565b7f5374616b652068617320616c7265616479206265656e207265636c61696d6564600082015250565b60006113cb6020836111f4565b91506113d682611395565b602082019050919050565b600060208201905081810360008301526113fa816113be565b9050919050565b60006040820190506114166000830185610f48565b6114236020830184610ef1565b9392505050565b6000815190506114398161104a565b92915050565b60006020828403121561145557611454610e05565b5b60006114638482850161142a565b91505092915050565b7f537461747573206d7573742062652045766964656e63655375626d6974746564600082015250565b60006114a26020836111f4565b91506114ad8261146c565b602082019050919050565b600060208201905081810360008301526114d181611495565b9050919050565b60006020820190506114ed6000830184610f48565b92915050565b60008151905061150281610e72565b92915050565b60006020828403121561151e5761151d610e05565b5b600061152c848285016114f3565b91505092915050565b600060408201905061154a6000830185610ef1565b6115576020830184610ef1565b9392505050565b7f576f726b65722063616e206f6e6c7920657874656e64207468656972206f776e60008201527f20617661696c6162696c697479207374616b6500000000000000000000000000602082015250565b60006115ba6033836111f4565b91506115c58261155e565b604082019050919050565b600060208201905081810360008301526115e9816115ad565b9050919050565b7f537461747573206d757374206265205265717565737465640000000000000000600082015250565b60006116266018836111f4565b9150611631826115f0565b602082019050919050565b6000602082019050818103600083015261165581611619565b9050919050565b7f576f726b65722063616e206f6e6c79207375626d69742065766964656e63652060008201527f666f7220776f726b2074686579206172652061737369676e6564000000000000602082015250565b60006116b8603a836111f4565b91506116c38261165c565b604082019050919050565b600060208201905081810360008301526116e7816116ab565b9050919050565b7f4e6f20617661696c61626c6520776f726b6572207374616b6573000000000000600082015250565b6000611724601a836111f4565b915061172f826116ee565b602082019050919050565b6000602082019050818103600083015261175381611717565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061179482610e68565b915061179f83610e68565b9250826117af576117ae61175a565b5b82820690509291505056fea2646970667358221220222921ff67786706a1b0d1108e8562ef2151aa425705261c72af54655338018764736f6c63430008180033", + "deployedBytecode": "0x60806040526004361061009c5760003560e01c8063854b6a4f11610064578063854b6a4f1461016a578063a035b1fe14610193578063b5b20c00146101be578063c4a32591146101e7578063c4a9e11614610210578063d5a44f861461023b5761009c565b8063216ed6ad146100a15780634b8b194c146100ca5780635badbe4c146100d45780638150d507146100ff57806381d12c5814610128575b600080fd5b3480156100ad57600080fd5b506100c860048036038101906100c39190610e9e565b61027c565b005b6100d261030e565b005b3480156100e057600080fd5b506100e9610404565b6040516100f69190610f00565b60405180910390f35b34801561010b57600080fd5b5061012660048036038101906101219190610f1b565b61040a565b005b34801561013457600080fd5b5061014f600480360381019061014a9190610f1b565b61060e565b60405161016196959493929190610fe9565b60405180910390f35b34801561017657600080fd5b50610191600480360381019061018c9190611076565b610684565b005b34801561019f57600080fd5b506101a86108ef565b6040516101b59190610f00565b60405180910390f35b3480156101ca57600080fd5b506101e560048036038101906101e091906110b6565b610913565b005b3480156101f357600080fd5b5061020e60048036038101906102099190610f1b565b6109d4565b005b34801561021c57600080fd5b50610225610b78565b6040516102329190610f00565b60405180910390f35b34801561024757600080fd5b50610262600480360381019061025d9190610f1b565b610b7e565b6040516102739594939291906110f6565b60405180910390f35b60008060006001600081548092919061029490611178565b9190505581526020019081526020016000209050838160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828160010181905550814261030091906111c0565b816002018190555050505050565b7f0000000000000000000000000000000000000000000000000000000000000000341015610371576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036890611251565b60405180910390fd5b60006003600081548092919061038690611178565b9190505590506000600260008381526020019081526020016000209050338160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503481600101819055506103f882610bee565b81600301819055505050565b60035481565b600080600083815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a9906112e3565b60405180910390fd5b806002015442116104f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ef90611375565b60405180910390fd5b8060030160019054906101000a900460ff161561054a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610541906113e1565b60405180910390fd5b60018160030160016101000a81548160ff0219169083151502179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383600101546040518363ffffffff1660e01b81526004016105c6929190611401565b6020604051808303816000875af11580156105e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610609919061143f565b505050565b60026020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020160009054906101000a900460ff16908060030154908060040160009054906101000a900460ff16908060050154905086565b6000600260008481526020019081526020016000209050600160038111156106af576106ae610f57565b5b8160020160009054906101000a900460ff1660038111156106d3576106d2610f57565b5b14610713576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070a906114b8565b60405180910390fd5b600080600083600301548152602001908152602001600020905060028260020160006101000a81548160ff0219169083600381111561075557610754610f57565b5b0217905550828260040160006101000a81548160ff02191690831515021790555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633ff754428360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b81526004016107f591906114d8565b6020604051808303816000875af1158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190611508565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639fcb294b846001015483620151806040518463ffffffff1660e01b815260040161089d929190611535565b60206040518083038185885af11580156108bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108e09190611508565b83600501819055505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080600084815260200190815260200160002090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b2906115d0565b60405180910390fd5b81426109c791906111c0565b8160020181905550505050565b6000600260008381526020019081526020016000209050600060038111156109ff576109fe610f57565b5b8160020160009054906101000a900460ff166003811115610a2357610a22610f57565b5b14610a63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5a9061163c565b60405180910390fd5b60008060008360030154815260200190815260200160002090503373ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b06906116ce565b60405180910390fd5b60018260020160006101000a81548160ff02191690836003811115610b3757610b36610f57565b5b02179055507ffaecd3b4db089bf25a48306100dd5fb2152e3887c7815b2b221dbb7da2f8e8dc83604051610b6b9190610f00565b60405180910390a1505050565b60015481565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030160009054906101000a900460ff16908060030160019054906101000a900460ff16905085565b6000610bf8610c90565b90506000806000838152602001908152602001600020905060018160030160006101000a81548160ff0219169083151502179055507f429f9327062651dbcecaca0d28b9929067489d32d2c1133ec207c965f1f0ab198160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684604051610c82929190611401565b60405180910390a150919050565b60008060005b600154811015610d145760008082815260200190815260200160002060030160009054906101000a900460ff16610d0757600080828152602001908152602001600020600201544211610d07576000808281526020019081526020016000206001015482610d0491906111c0565b91505b8080600101915050610c96565b5060008111610d58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4f9061173a565b60405180910390fd5b60008144610d669190611789565b9050600080600090505b600154811015610dfe5760008082815260200190815260200160002060030160009054906101000a900460ff16610df157600080828152602001908152602001600020600201544211610df1576000808281526020019081526020016000206001015482610dde91906111c0565b915082821115610df057809450610dfe565b5b8080600101915050610d70565b5050505090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610e3582610e0a565b9050919050565b610e4581610e2a565b8114610e5057600080fd5b50565b600081359050610e6281610e3c565b92915050565b6000819050919050565b610e7b81610e68565b8114610e8657600080fd5b50565b600081359050610e9881610e72565b92915050565b600080600060608486031215610eb757610eb6610e05565b5b6000610ec586828701610e53565b9350506020610ed686828701610e89565b9250506040610ee786828701610e89565b9150509250925092565b610efa81610e68565b82525050565b6000602082019050610f156000830184610ef1565b92915050565b600060208284031215610f3157610f30610e05565b5b6000610f3f84828501610e89565b91505092915050565b610f5181610e2a565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110610f9757610f96610f57565b5b50565b6000819050610fa882610f86565b919050565b6000610fb882610f9a565b9050919050565b610fc881610fad565b82525050565b60008115159050919050565b610fe381610fce565b82525050565b600060c082019050610ffe6000830189610f48565b61100b6020830188610ef1565b6110186040830187610fbf565b6110256060830186610ef1565b6110326080830185610fda565b61103f60a0830184610ef1565b979650505050505050565b61105381610fce565b811461105e57600080fd5b50565b6000813590506110708161104a565b92915050565b6000806040838503121561108d5761108c610e05565b5b600061109b85828601610e89565b92505060206110ac85828601611061565b9150509250929050565b600080604083850312156110cd576110cc610e05565b5b60006110db85828601610e89565b92505060206110ec85828601610e89565b9150509250929050565b600060a08201905061110b6000830188610f48565b6111186020830187610ef1565b6111256040830186610ef1565b6111326060830185610fda565b61113f6080830184610fda565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061118382610e68565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036111b5576111b4611149565b5b600182019050919050565b60006111cb82610e68565b91506111d683610e68565b92508282019050808211156111ee576111ed611149565b5b92915050565b600082825260208201905092915050565b7f496e73756666696369656e742066656500000000000000000000000000000000600082015250565b600061123b6010836111f4565b915061124682611205565b602082019050919050565b6000602082019050818103600083015261126a8161122e565b9050919050565b7f576f726b65722063616e206f6e6c79207265636c61696d207468656972206f7760008201527f6e20617661696c6162696c697479207374616b65000000000000000000000000602082015250565b60006112cd6034836111f4565b91506112d882611271565b604082019050919050565b600060208201905081810360008301526112fc816112c0565b9050919050565b7f5374616b65206475726174696f6e20686173206e6f742079657420656c61707360008201527f6564000000000000000000000000000000000000000000000000000000000000602082015250565b600061135f6022836111f4565b915061136a82611303565b604082019050919050565b6000602082019050818103600083015261138e81611352565b9050919050565b7f5374616b652068617320616c7265616479206265656e207265636c61696d6564600082015250565b60006113cb6020836111f4565b91506113d682611395565b602082019050919050565b600060208201905081810360008301526113fa816113be565b9050919050565b60006040820190506114166000830185610f48565b6114236020830184610ef1565b9392505050565b6000815190506114398161104a565b92915050565b60006020828403121561145557611454610e05565b5b60006114638482850161142a565b91505092915050565b7f537461747573206d7573742062652045766964656e63655375626d6974746564600082015250565b60006114a26020836111f4565b91506114ad8261146c565b602082019050919050565b600060208201905081810360008301526114d181611495565b9050919050565b60006020820190506114ed6000830184610f48565b92915050565b60008151905061150281610e72565b92915050565b60006020828403121561151e5761151d610e05565b5b600061152c848285016114f3565b91505092915050565b600060408201905061154a6000830185610ef1565b6115576020830184610ef1565b9392505050565b7f576f726b65722063616e206f6e6c7920657874656e64207468656972206f776e60008201527f20617661696c6162696c697479207374616b6500000000000000000000000000602082015250565b60006115ba6033836111f4565b91506115c58261155e565b604082019050919050565b600060208201905081810360008301526115e9816115ad565b9050919050565b7f537461747573206d757374206265205265717565737465640000000000000000600082015250565b60006116266018836111f4565b9150611631826115f0565b602082019050919050565b6000602082019050818103600083015261165581611619565b9050919050565b7f576f726b65722063616e206f6e6c79207375626d69742065766964656e63652060008201527f666f7220776f726b2074686579206172652061737369676e6564000000000000602082015250565b60006116b8603a836111f4565b91506116c38261165c565b604082019050919050565b600060208201905081810360008301526116e7816116ab565b9050919050565b7f4e6f20617661696c61626c6520776f726b6572207374616b6573000000000000600082015250565b6000611724601a836111f4565b915061172f826116ee565b602082019050919050565b6000602082019050818103600083015261175381611717565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061179482610e68565b915061179f83610e68565b9250826117af576117ae61175a565b5b82820690509291505056fea2646970667358221220222921ff67786706a1b0d1108e8562ef2151aa425705261c72af54655338018764736f6c63430008180033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/ethereum/contracts/DAO.sol b/ethereum/contracts/DAO.sol index c4ced44..337e63b 100644 --- a/ethereum/contracts/DAO.sol +++ b/ethereum/contracts/DAO.sol @@ -7,18 +7,21 @@ import "./IAcceptAvailability.sol"; import "hardhat/console.sol"; struct Post { + uint id; address sender; address author; } struct Stake { + uint id; bool inFavor; uint256 amount; address sender; } struct ValidationPool { - Post post; + uint id; + uint postIndex; mapping(uint => Stake) stakes; uint stakeCount; uint256 fee; @@ -62,6 +65,7 @@ contract DAO is ERC20("Reputation", "REP") { Post storage post = posts[postIndex]; post.author = author; post.sender = msg.sender; + post.id = postIndex; } /// Accept fee to initiate a validation pool @@ -72,22 +76,25 @@ contract DAO is ERC20("Reputation", "REP") { uint duration ) public payable returns (uint poolIndex) { require(msg.value > 0, "Fee is required to initiate validation pool"); + Post storage post = posts[postIndex]; + require(post.author != address(0), "Target post not found"); poolIndex = validationPoolCount++; ValidationPool storage pool = validationPools[poolIndex]; - pool.post = posts[postIndex]; + pool.postIndex = postIndex; pool.fee = msg.value; pool.duration = duration; pool.endTime = block.timestamp + duration; + pool.id = poolIndex; // Because we need to stake part of the mited value for the pool an part against, // we mint two new tokens. // Here we assume a minting ratio of 1, and a stakeForAuthor ratio of 0.5 // Implementing this with adjustable parameters will require more advanced fixed point math. // TODO: Make minting ratio an adjustable parameter // TODO: Make stakeForAuthor an adjustable parameter - _mint(pool.post.author, msg.value); + _mint(post.author, msg.value); // TODO: We need a way to exclude this pending reputation from the total supply when computing fee distribution - _stake(pool, pool.post.author, msg.value / 2, true); - _stake(pool, pool.post.author, msg.value / 2, false); + _stake(pool, post.author, msg.value / 2, true); + _stake(pool, post.author, msg.value / 2, false); emit ValidationPoolInitiated(poolIndex); } @@ -100,10 +107,12 @@ contract DAO is ERC20("Reputation", "REP") { ) internal { require(block.timestamp <= pool.endTime, "Pool end time has passed"); _transfer(sender, address(this), amount); - Stake storage s = pool.stakes[pool.stakeCount++]; + uint stakeIndex = pool.stakeCount++; + Stake storage s = pool.stakes[stakeIndex]; s.sender = sender; s.inFavor = inFavor; s.amount = amount; + s.id = stakeIndex; } /// Accept reputation stakes toward a validation pool @@ -115,6 +124,7 @@ contract DAO is ERC20("Reputation", "REP") { /// Evaluate outcome of a validation pool function evaluateOutcome(uint poolIndex) public returns (bool votePasses) { ValidationPool storage pool = validationPools[poolIndex]; + Post storage post = posts[pool.postIndex]; require( block.timestamp > pool.endTime, "Pool end time has not yet arrived" @@ -137,11 +147,12 @@ contract DAO is ERC20("Reputation", "REP") { // This is especially important so that the DAO's first pool can pass, // when no reputation has yet been minted. votePasses = stakedFor >= stakedAgainst; - if (votePasses && !isMember[pool.post.author]) { - members[memberCount++] = pool.post.author; - isMember[pool.post.author] = true; + if (votePasses && !isMember[post.author]) { + members[memberCount++] = post.author; + isMember[post.author] = true; } pool.resolved = true; + pool.outcome = votePasses; emit ValidationPoolResolved(poolIndex, votePasses); // Value of losing stakes should be di stributed among winners, in proportion to their stakes uint256 amountFromWinners = votePasses ? stakedFor : stakedAgainst; @@ -159,7 +170,7 @@ contract DAO is ERC20("Reputation", "REP") { // Due to rounding, there may be some reward left over. Include this as a reward to the author. uint256 remainder = amountFromLosers - totalRewards; if (remainder > 0) { - _transfer(address(this), pool.post.author, remainder); + _transfer(address(this), post.author, remainder); } // Distribute fee proportionatly among all reputation holders for (uint i = 0; i < memberCount; i++) { diff --git a/ethereum/test/DAO.js b/ethereum/test/DAO.js index dcd8319..71ac9f1 100644 --- a/ethereum/test/DAO.js +++ b/ethereum/test/DAO.js @@ -73,6 +73,8 @@ describe('DAO', () => { const pool = await dao.validationPools(0); expect(pool).to.exist; expect(pool.duration).to.equal(POOL_DURATION); + expect(pool.postIndex).to.equal(0); + expect(pool.resolved).to.be.false; }); }); @@ -86,6 +88,9 @@ describe('DAO', () => { await expect(dao.evaluateOutcome(0)).to.emit(dao, 'ValidationPoolResolved').withArgs(0, true); expect(await dao.memberCount()).to.equal(1); expect(await dao.balanceOf(account1)).to.equal(100); + const pool = await dao.validationPools(0); + expect(pool.resolved).to.be.true; + expect(pool.outcome).to.be.true; }); it('should not be able to evaluate outcome more than once', async () => { @@ -139,6 +144,8 @@ describe('DAO', () => { await expect(dao.evaluateOutcome(1)).to.emit(dao, 'ValidationPoolResolved').withArgs(1, false); expect(await dao.balanceOf(dao.target)).to.equal(0); expect(await dao.balanceOf(account1)).to.equal(200); + const pool = await dao.validationPools(1); + expect(pool.outcome).to.be.false; }); }); });