text: (this["webpackJsonpdapp-front-end"]=this["webpackJsonpdapp-front-end"]||[]).push([[0],{101:function(e){e.exports=JSON.parse('{"a":[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]}')},172:function(e,t,n){},174:function(e,t){},218:function(e,t){},233:function(e,t,n){"use strict";n.r(t);var a=n(1),i=n.n(a),r=n(54),s=n.n(r),o=(n(172),n(2)),c=n.n(o),l=n(20),u=n(6),d=n(7),p=n(9),y=n(8),b=n(79),m=n(280),x=n(282),h=n(275),f=n(278),v=n(286),T=n(276),j=n(287),g=n(288),D=n(289),k=n(290),w=n(42),C=n(101),O=n(66),S=n(156),B=n(149),F=n.n(B),A=new S.a({bridge:"https://bridge.walletconnect.org",qrcodeModal:F.a}),M=n(5);function P(e){return 56===e?"binance":"ethereum"}function I(e){return new w.a.providers.JsonRpcProvider("binance"===e?"https://bsc-dataseed.binance.org/":"https://mainnet.infura.io/v3/b8bb7a40c9f84aa0aa57ec093318d856")}function H(e,t){return b.filter((function(n){return n.blockchain===e&&n.symbol===t})).pop()}var N=function(e){Object(p.a)(n,e);var t=Object(y.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={connected:!1,account:null,token:H("ethereum","USDT"),wallet:"0xDC9bD464Ab6cf1f8eB0F1a5D22d859e1FC10b65D",network:"ethereum",receiver:"",amount:"",provider:null,proposals:[]},a}return Object(d.a)(n,[{key:"componentDidMount",value:function(){var e=this;A.on("connect",(function(t,n){if(t)throw t;var a=n.params[0],i=a.accounts,r=P(a.chainId);e.setState({connected:!0,account:i[0],network:r,token:H(r,"USDT"),provider:I(r)})})),A.on("disconnect",(function(t,n){if(t)throw t;e.setState({connected:!1,account:""})}));var t=P(A.chainId),n=H(t,"USDT");this.setState({connected:A.connected,account:A.connected?A.accounts[0]:null,network:t,token:n,provider:I(t)})}},{key:"selectTokenHandler",value:function(e){this.setState({token:H(this.state.network,e.target.value)})}},{key:"textReceiverHandler",value:function(e){this.setState({receiver:e.target.value})}},{key:"buttonCreateProposalHandler",value:function(){var e=Object(l.a)(c.a.mark((function e(){var t,n,a,i,r,s,o,l;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.state,n=t.token,a=t.receiver,i=t.wallet,r=t.amount,/0x[0-9a-f]{40}/gi.test(a)){e.next=4;break}return alert("Invalid receiver address"),e.abrupt("return");case 4:s=new w.a.Contract(i,O.a),o=new w.a.Contract(n.address,C.a),l=s.interface.encodeFunctionData("createProposal",[{delegate:!1,expired:0,executed:!1,vote:0,target:n.address,value:0,data:o.interface.encodeFunctionData("transfer",[a,w.a.BigNumber.from(r).mul(w.a.BigNumber.from(10).pow(n.decimal))])}]),this.sendTx(l);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"buttonReloadProposalHandler",value:function(){var e=Object(l.a)(c.a.mark((function e(){var t,n,a,i,r,s,o,l,u,d,p,y,b,m,x,h,f,v,T,j,g,D,k,S;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state,n=t.token,a=t.provider,i=t.wallet,r=new w.a.Contract(i,O.a,a),s=new w.a.Contract(n.address,C.a,a),e.next=5,r.proposalIndex();case 5:o=e.sent.toNumber(),l=o-10>0?o-10:0,u=[],d=o;case 9:if(!(d>l)){e.next=30;break}return e.next=12,r.proposalDetail(d);case 12:return p=e.sent,y=p.vote,b=p.value,m=p.target,x=p.expired,h=p.executed,f=p.delegate,v=p.data,T=s.interface.decodeFunctionData("transfer",v),j=T.amount,g=T.recipient,e.next=23,a.getBlock();case 23:D=e.sent,k=D.timestamp,S=x.sub(k).toNumber(),u.push({index:d,expired:new Date(1e3*x.toNumber()).toLocaleString(),passed:"".concat(new Date(1e3*k).toLocaleString()," - ").concat(S>0?"passing in":"passed"," ").concat(Math.abs(S)," s"),vote:y.toNumber(),amount:j.div(w.a.BigNumber.from(10).pow(n.decimal)).toNumber().toLocaleString(),tokenSymbol:n.symbol,recipient:g,executed:h,delegate:f,value:b.toNumber(),target:m});case 27:d-=1,e.next=9;break;case 30:this.setState({proposals:u});case 31:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"buttonConnectHandler",value:function(){var e;A.connected?A.killSession():A.createSession({chainId:(e=this.state.network,"binance"===e?56:1)})}},{key:"textAmountHandler",value:function(e){var t=parseInt(e.target.value,10);this.setState({amount:Number.isNaN(t)?"":t})}},{key:"selectNetworkHandler",value:function(e){this.setState({network:e.target.value})}},{key:"selectWalletHandler",value:function(e){this.setState({wallet:e.target.value})}},{key:"buttonPositiveHandler",value:function(e){var t=new w.a.Contract(this.state.wallet,O.a).interface.encodeFunctionData("voteProposal",[parseInt(e.target.value,10),!0]);this.sendTx(t)}},{key:"buttonNegativeHandler",value:function(e){var t=new w.a.Contract(this.state.wallet,O.a).interface.encodeFunctionData("voteProposal",[parseInt(e.target.value,10),!1]);this.sendTx(t)}},{key:"buttonExecuteHandler",value:function(e){var t=new w.a.Contract(this.state.wallet,O.a).interface.encodeFunctionData("execute",[parseInt(e.target.value,10)]);this.sendTx(t)}},{key:"sendTx",value:function(e){A.sendTransaction({from:this.state.account,to:this.state.wallet,value:0,data:e}).then((function(e){console.log(e)})).catch((function(e){console.error(e)}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.connected,a=t.account,i=t.receiver,r=t.proposals,s=t.network,o=t.amount;return Object(M.jsxs)(m.a,{container:!0,spacing:2,children:[Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(x.a,{children:n?"Connected wallet: ".concat(a):"Not connected"})}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsxs)(h.a,{defaultValue:"0xDC9bD464Ab6cf1f8eB0F1a5D22d859e1FC10b65D",onChange:this.selectWalletHandler.bind(this),children:[Object(M.jsx)(f.a,{value:"0xDC9bD464Ab6cf1f8eB0F1a5D22d859e1FC10b65D",children:"0xDC9bD464Ab6cf1f8eB0F1a5D22d859e1FC10b65D"}),Object(M.jsx)(f.a,{value:"0xcC527eb38F459882f0efFbAB8fe79B47716DE72F",children:"0xcC527eb38F459882f0efFbAB8fe79B47716DE72F"})]})}),Object(M.jsx)(m.a,{item:!0,xs:2,children:Object(M.jsxs)(h.a,{defaultValue:"ethereum",value:s,onChange:this.selectNetworkHandler.bind(this),disabled:n,children:[Object(M.jsx)(f.a,{value:"ethereum",children:"Ethereum"}),Object(M.jsx)(f.a,{value:"binance",children:"Binance Smart Chain"})]})}),Object(M.jsx)(m.a,{item:!0,xs:2,children:Object(M.jsx)(v.a,{variant:"contained",onClick:this.buttonConnectHandler.bind(this),color:n?"error":"success",children:n?"Disconnect":"Connect"})}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(x.a,{children:"Receiver"})}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(T.a,{variant:"standard",label:"Receiver's Address",fullWidth:!0,onChange:this.textReceiverHandler.bind(this),value:i.trim()})}),Object(M.jsx)(m.a,{item:!0,xs:4}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(x.a,{children:"Token amount"})}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(T.a,{variant:"standard",label:"Amount",fullWidth:!0,onChange:this.textAmountHandler.bind(this),value:o})}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(h.a,{onChange:this.selectTokenHandler.bind(this),defaultValue:"undefined"!==typeof b[0]&&b[0].symbol||"USDT",children:b.filter((function(e){return e.blockchain===s})).map((function(e,t){return Object(M.jsxs)(f.a,{value:e.symbol,children:[e.name," - ",e.blockchain]},"token-list-".concat(t))}))})}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(v.a,{variant:"outlined",onClick:this.buttonCreateProposalHandler.bind(this),children:"Create a new proposal"})}),Object(M.jsx)(m.a,{item:!0,xs:4,children:Object(M.jsx)(v.a,{variant:"outlined",onClick:this.buttonReloadProposalHandler.bind(this),children:"Reload Proposal List"})}),Object(M.jsx)(m.a,{item:!0,xs:12,children:r.map((function(t,n){return Object(M.jsxs)(j.a,{variant:"outlined",style:{marginTop:"10px"},children:[Object(M.jsxs)(g.a,{fullwidth:"true",children:[Object(M.jsxs)(x.a,{variant:"h5",children:["#",t.index]}),Object(M.jsxs)(x.a,{sx:{fontSize:14},color:"text.secondary",gutterBottom:!0,children:["Target token: ",Object(M.jsx)(D.a,{target:"_blank",href:"".concat("binance"===s?"https://bscscan.com/address/":"https://etherscan.io/address/").concat(t.target),children:t.target})," (",s,")"]}),Object(M.jsxs)(x.a,{sx:{fontSize:14},color:"text.secondary",gutterBottom:!0,children:["Transfer: ",Object(M.jsx)(D.a,{target:"_blank",href:"".concat("binance"===s?"https://bscscan.com/address/":"https://etherscan.io/address/").concat(t.recipient),children:t.recipient})]}),Object(M.jsxs)(x.a,{sx:{fontSize:14},color:"text.secondary",gutterBottom:!0,children:["Current block timestamp: ",t.passed]}),Object(M.jsxs)(x.a,{sx:{fontSize:14},color:"text.secondary",gutterBottom:!0,children:["Amount: ",t.amount," ",t.tokenSymbol]})]}),!t.executed&&Object(M.jsxs)(k.a,{children:[Object(M.jsx)(v.a,{variant:"contained",onClick:e.buttonPositiveHandler.bind(e),color:"success",value:t.index,children:"+1"}),Object(M.jsx)(v.a,{variant:"contained",onClick:e.buttonNegativeHandler.bind(e),color:"error",value:t.index,children:"-1"}),Object(M.jsx)(v.a,{variant:"contained",onClick:e.buttonExecuteHandler.bind(e),value:t.index,children:"Execute"})]})]},"key-proposal-".concat(n))}))})]})}}]),n}(i.a.Component),U=N,E=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,291)).then((function(t){var n=t.getCLS,a=t.getFID,i=t.getFCP,r=t.getLCP,s=t.getTTFB;n(e),a(e),i(e),r(e),s(e)}))};s.a.render(Object(M.jsx)(i.a.StrictMode,{children:Object(M.jsx)(U,{})}),document.getElementById("root")),E()},66:function(e){e.exports=JSON.parse('{"a":[{"inputs":[{"internalType":"address[]","name":"owners_","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"expired","type":"uint256"}],"name":"CreateProposal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":true,"internalType":"address","name":"trigger","type":"address"},{"indexed":true,"internalType":"int256","name":"vote","type":"int256"}],"name":"ExecuteProposal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"NegativeVote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"proposalId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"PositiveVote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"TransferOwnership","type":"event"},{"inputs":[{"internalType":"bytes32","name":"c__0xaa0c7a0c","type":"bytes32"}],"name":"c_0xaa0c7a0c","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"int256","name":"vote","type":"int256"},{"internalType":"uint64","name":"expired","type":"uint64"},{"internalType":"bool","name":"executed","type":"bool"},{"internalType":"bool","name":"delegate","type":"bool"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct MultiSig.Proposal","name":"newProposal","type":"tuple"}],"name":"createProposal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"}],"name":"execute","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"isVoted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"proposalDetail","outputs":[{"components":[{"internalType":"int256","name":"vote","type":"int256"},{"internalType":"uint64","name":"expired","type":"uint64"},{"internalType":"bool","name":"executed","type":"bool"},{"internalType":"bool","name":"delegate","type":"bool"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct MultiSig.Proposal","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposalIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"proposalId","type":"uint256"},{"internalType":"bool","name":"positive","type":"bool"}],"name":"voteProposal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]}')},79:function(e){e.exports=JSON.parse('[{"blockchain":"ethereum","name":"Tether USD (USDT)","address":"0xdAC17F958D2ee523a2206206994597C13D831ec7","symbol":"USDT","decimal":6},{"blockchain":"ethereum","name":"Dai Stablecoin (DAI)","address":"0x6B175474E89094C44Da98b954EedeAC495271d0F","symbol":"DAI","decimal":18},{"blockchain":"ethereum","name":"USD Coin (USDC)","address":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","symbol":"USDC","decimal":6},{"blockchain":"ethereum","name":"Binance USD (BUSD)","address":"0x4Fabb145d64652a948d72533023f6E7A623C7C53","symbol":"BUSD","decimal":18},{"blockchain":"binance","name":"Binance-Peg BSC-USD","address":"0x55d398326f99059fF775485246999027B3197955","symbol":"USDT","decimal":18},{"blockchain":"binance","name":"Binance-Peg Dai Token (DAI)","address":"0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3","symbol":"DAI","decimal":18},{"blockchain":"binance","name":"Binance-Peg USD Coin (USDC)","address":"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d","symbol":"USDC","decimal":18},{"blockchain":"binance","name":"Binance-Peg BUSD Token (BUSD)","address":"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56","symbol":"BUSD","decimal":18}]')}},[[233,1,2]]]);
  //# sourceMappingURL=main.cd50ba10.chunk.js.map