erc20-transfer-authorization

Simple approval escrow for ERC20 spending
Log | Files | Refs

commit 40231e18dac09460700678fef2039d675312cae3
parent 19eb21569b7d4dca8e92ee17a0a9c12fdcd6c2f7
Author: nolash <dev@holbrook.no>
Date:   Tue, 16 Feb 2021 10:25:27 +0100

WIP Add new quorum tests

Diffstat:
Mpython/erc20_approval_escrow/data/TransferApproval.bin | 4++--
Mpython/tests/test_quorum.py | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msolidity/TransferApproval.bin | 4++--
Msolidity/TransferApproval.sol | 2++
4 files changed, 85 insertions(+), 4 deletions(-)

diff --git a/python/erc20_approval_escrow/data/TransferApproval.bin b/python/erc20_approval_escrow/data/TransferApproval.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016003819055506001600481905550600160068190555060016008819055506200008760016000620000a060201b60201c565b5062000099336200012b60201b60201c565b50620003d2565b6000600854831115620000b257600080fd5b60008311620000c057600080fd5b600854821115620000d057600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516200011993929190620002da565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146200018857600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514620001e657600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190620002539062000355565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2482604051620002899190620002bd565b60405180910390a16008549050919050565b620002a68162000317565b82525050565b620002b7816200034b565b82525050565b6000602082019050620002d460008301846200029b565b92915050565b6000606082019050620002f16000830186620002ac565b620003006020830185620002ac565b6200030f6040830184620002ac565b949350505050565b600062000324826200032b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000362826200034b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620003985762000397620003a3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611ae280620003e26000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80636e417c6911610097578063b0addede11610066578063b0addede146102e2578063bac911ac14610312578063e3064a7714610342578063eb12d61e1461037257610100565b80636e417c691461022b578063736c0d5b1461025b57806381d12c581461028b5780638da5cb5b146102c457610100565b80634797569a116100d35780634797569a1461018f57806357ec347a146101bf57806358d71f82146101dd578063614f427f1461020d57610100565b806306661abd1461010557806308ae6377146101235780630e316ab7146101415780631703a01814610171575b600080fd5b61010d6103a2565b60405161011a91906117e2565b60405180910390f35b61012b6103a8565b60405161013891906117e2565b60405180910390f35b61015b60048036038101906101569190611554565b6103d3565b60405161016891906117e2565b60405180910390f35b6101796105ce565b60405161018691906117e2565b60405180910390f35b6101a960048036038101906101a491906115cc565b6105d4565b6040516101b691906117e2565b60405180910390f35b6101c761083e565b6040516101d491906117e2565b60405180910390f35b6101f760048036038101906101f291906115cc565b610854565b60405161020491906117e2565b60405180910390f35b610215610a0c565b60405161022291906117e2565b60405180910390f35b610245600480360381019061024091906115cc565b610a12565b6040516102529190611787565b60405180910390f35b61027560048036038101906102709190611554565b610ceb565b6040516102829190611787565b60405180910390f35b6102a560048036038101906102a091906115cc565b610d0b565b6040516102bb9a999897969594939291906117fd565b60405180910390f35b6102cc610dcc565b6040516102d99190611735565b60405180910390f35b6102fc60048036038101906102f7919061157d565b610df2565b60405161030991906117e2565b60405180910390f35b61032c600480360381019061032791906115cc565b6110e7565b60405161033991906117e2565b60405180910390f35b61035c600480360381019061035791906115f5565b611166565b6040516103699190611787565b60405180910390f35b61038c60048036038101906103879190611554565b6111ec565b60405161039991906117e2565b60405180910390f35b60055481565b6000806004546003546103bb9190611920565b14156103ca57600090506103d0565b60045490505b90565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561043057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806104b757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6104c057600080fd5b60011515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461051d57600080fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190610588906119dc565b91905055507f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b826040516105bc9190611735565b60405180910390a16008549050919050565b60065481565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461060d57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b1461067957600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff1602179055508060080160008154809291906106fa90611a06565b9190505550806005015481600801546008546107169190611920565b1415610798577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff1602179055507f94064f919a02d0565c6790e0615fb4ba6cf1be1dd679f0161be914613a1b9bb58360405161078b91906117e2565b60405180910390a1610831565b600081600601541180156107b3575080600601548160080154145b15610830577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff1602179055507f2ae00ba9813199478b6f22f0c9b606daa70f8efc319c8d2fa6af63f66ea317638360405161082791906117e2565b60405180910390a15b5b8060080154915050919050565b6000600160035461084f9190611920565b905090565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461088d57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b146108f957600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff16021790555080600701600081548092919061097a90611a06565b9190505550806005015481600701546008546109969190611920565b14156109ff5760018160090160006101000a81548160ff021916908360000b60ff1602179055507f3ad93af63cb7967b23e4fb500b7d7d28b07516325dcf341f88bebf959d82c1cb836040516109ec91906117e2565b60405180910390a16109fd83610a12565b505b8060070154915050919050565b60075481565b6000806002600084815260200190815260200160002090506000816000015411610a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a68906117a2565b60405180910390fd5b60018160090160009054906101000a900460000b60000b14610ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abf906117c2565b60405180910390fd5b60028160090160006101000a81548160ff021916908360000b60ff1602179055506000808260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560040154604051602401610b8893929190611750565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610c12919061171e565b6000604051808303816000865af19150503d8060008114610c4f576040519150601f19603f3d011682016040523d82523d6000602084013e610c54565b606091505b5091509150610c668360000154611356565b8115610ca8577fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6785604051610c9b91906117e2565b60405180910390a1610ce0565b7fdab20a0fcd702cf875c2d715d5c3fc99af66a716c94b3405408c94b7311c99eb85604051610cd791906117e2565b60405180910390a15b819350505050919050565b60096020528060005260406000206000915054906101000a900460ff1681565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460000b90508a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610dfc611493565b60035481600001818152505084816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505033816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083816060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828160800181815250506006548160a0018181525050806002600060035481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015561010082015181600801556101208201518160090160006101000a81548160ff021916908360000b60ff1602179055509050506005600081548092919061102990611a06565b91905055506003600081548092919061104190611a06565b9190505550806060015173ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff167fb609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c846080015185600001516040516110d0929190611899565b60405180910390a480600001519150509392505050565b600080600060045490505b60035481101561115a57600060026000838152602001908152602001600020905060008160000154111561114657848314156111375780600001549350505050611161565b828061114290611a06565b9350505b50808061115290611a06565b9150506110f2565b5060009150505b919050565b600060085483111561117757600080fd5b6000831161118457600080fd5b60085482111561119357600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516111da939291906118c2565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461124857600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146112a557600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008600081548092919061131090611a06565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f24826040516113449190611735565b60405180910390a16008549050919050565b600260008281526020019081526020016000206000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556003820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600482016000905560058201600090556006820160009055600782016000905560088201600090556009820160006101000a81549060ff0219169055505060056000815480929190611438906119dc565b9190505550600060055411156114865760045481141561148157600061145e60006110e7565b905060008114156114775760035460048190555061147f565b806004819055505b505b611490565b6003546004819055505b50565b60405180610140016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000800b81525090565b60008135905061153981611a7e565b92915050565b60008135905061154e81611a95565b92915050565b60006020828403121561156657600080fd5b60006115748482850161152a565b91505092915050565b60008060006060848603121561159257600080fd5b60006115a08682870161152a565b93505060206115b18682870161152a565b92505060406115c28682870161153f565b9150509250925092565b6000602082840312156115de57600080fd5b60006115ec8482850161153f565b91505092915050565b6000806040838503121561160857600080fd5b60006116168582860161153f565b92505060206116278582860161153f565b9150509250929050565b61163a81611954565b82525050565b61164981611966565b82525050565b600061165a826118f9565b6116648185611904565b93506116748185602086016119a9565b80840191505092915050565b61168981611972565b82525050565b600061169c60138361190f565b91507f4552525f494e56414c49445f52455155455354000000000000000000000000006000830152602082019050919050565b60006116dc60108361190f565b91507f4552525f4e4f545f454e444f52534544000000000000000000000000000000006000830152602082019050919050565b6117188161199f565b82525050565b600061172a828461164f565b915081905092915050565b600060208201905061174a6000830184611631565b92915050565b60006060820190506117656000830186611631565b6117726020830185611631565b61177f604083018461170f565b949350505050565b600060208201905061179c6000830184611640565b92915050565b600060208201905081810360008301526117bb8161168f565b9050919050565b600060208201905081810360008301526117db816116cf565b9050919050565b60006020820190506117f7600083018461170f565b92915050565b600061014082019050611813600083018d61170f565b611820602083018c611631565b61182d604083018b611631565b61183a606083018a611631565b611847608083018961170f565b61185460a083018861170f565b61186160c083018761170f565b61186e60e083018661170f565b61187c61010083018561170f565b61188a610120830184611680565b9b9a5050505050505050505050565b60006040820190506118ae600083018561170f565b6118bb602083018461170f565b9392505050565b60006060820190506118d7600083018661170f565b6118e4602083018561170f565b6118f1604083018461170f565b949350505050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600061192b8261199f565b91506119368361199f565b92508282101561194957611948611a4f565b5b828203905092915050565b600061195f8261197f565b9050919050565b60008115159050919050565b60008160000b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156119c75780820151818401526020810190506119ac565b838111156119d6576000848401525b50505050565b60006119e78261199f565b915060008214156119fb576119fa611a4f565b5b600182039050919050565b6000611a118261199f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a4457611a43611a4f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611a8781611954565b8114611a9257600080fd5b50565b611a9e8161199f565b8114611aa957600080fd5b5056fea2646970667358221220bb3ffd404eab5da5b2ec1981c136a2879accb2c218a5a3d6bd9c9adcd5f8744e64736f6c63430008000033 -\ No newline at end of file +60806040523480156200001157600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016003819055506001600481905550600160068190555060016008819055506200008760016000620000a060201b60201c565b5062000099336200012b60201b60201c565b50620003d2565b6000600854831115620000b257600080fd5b60008311620000c057600080fd5b600854821115620000d057600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516200011993929190620002da565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146200018857600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514620001e657600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190620002539062000355565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2482604051620002899190620002bd565b60405180910390a16008549050919050565b620002a68162000317565b82525050565b620002b7816200034b565b82525050565b6000602082019050620002d460008301846200029b565b92915050565b6000606082019050620002f16000830186620002ac565b620003006020830185620002ac565b6200030f6040830184620002ac565b949350505050565b600062000324826200032b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000362826200034b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620003985762000397620003a3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611af480620003e26000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80636e417c6911610097578063b0addede11610066578063b0addede146102e2578063bac911ac14610312578063e3064a7714610342578063eb12d61e1461037257610100565b80636e417c691461022b578063736c0d5b1461025b57806381d12c581461028b5780638da5cb5b146102c457610100565b80634797569a116100d35780634797569a1461018f57806357ec347a146101bf57806358d71f82146101dd578063614f427f1461020d57610100565b806306661abd1461010557806308ae6377146101235780630e316ab7146101415780631703a01814610171575b600080fd5b61010d6103a2565b60405161011a91906117f4565b60405180910390f35b61012b6103a8565b60405161013891906117f4565b60405180910390f35b61015b60048036038101906101569190611566565b6103d3565b60405161016891906117f4565b60405180910390f35b6101796105ce565b60405161018691906117f4565b60405180910390f35b6101a960048036038101906101a491906115de565b6105d4565b6040516101b691906117f4565b60405180910390f35b6101c7610850565b6040516101d491906117f4565b60405180910390f35b6101f760048036038101906101f291906115de565b610866565b60405161020491906117f4565b60405180910390f35b610215610a1e565b60405161022291906117f4565b60405180910390f35b610245600480360381019061024091906115de565b610a24565b6040516102529190611799565b60405180910390f35b61027560048036038101906102709190611566565b610cfd565b6040516102829190611799565b60405180910390f35b6102a560048036038101906102a091906115de565b610d1d565b6040516102bb9a9998979695949392919061180f565b60405180910390f35b6102cc610dde565b6040516102d99190611747565b60405180910390f35b6102fc60048036038101906102f7919061158f565b610e04565b60405161030991906117f4565b60405180910390f35b61032c600480360381019061032791906115de565b6110f9565b60405161033991906117f4565b60405180910390f35b61035c60048036038101906103579190611607565b611178565b6040516103699190611799565b60405180910390f35b61038c60048036038101906103879190611566565b6111fe565b60405161039991906117f4565b60405180910390f35b60055481565b6000806004546003546103bb9190611932565b14156103ca57600090506103d0565b60045490505b90565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561043057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806104b757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6104c057600080fd5b60011515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461051d57600080fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190610588906119ee565b91905055507f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b826040516105bc9190611747565b60405180910390a16008549050919050565b60065481565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461060d57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b1461067957600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff1602179055508060080160008154809291906106fa90611a18565b9190505550806005015481600801546008546107169190611932565b14156107a1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff16021790555061076583611368565b7f94064f919a02d0565c6790e0615fb4ba6cf1be1dd679f0161be914613a1b9bb58360405161079491906117f4565b60405180910390a1610843565b600081600601541180156107bc575080600601548160080154145b15610842577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff16021790555061080a83611368565b7f2ae00ba9813199478b6f22f0c9b606daa70f8efc319c8d2fa6af63f66ea317638360405161083991906117f4565b60405180910390a15b5b8060080154915050919050565b600060016003546108619190611932565b905090565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461089f57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b1461090b57600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff16021790555080600701600081548092919061098c90611a18565b9190505550806005015481600701546008546109a89190611932565b1415610a115760018160090160006101000a81548160ff021916908360000b60ff1602179055507f3ad93af63cb7967b23e4fb500b7d7d28b07516325dcf341f88bebf959d82c1cb836040516109fe91906117f4565b60405180910390a1610a0f83610a24565b505b8060070154915050919050565b60075481565b6000806002600084815260200190815260200160002090506000816000015411610a83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7a906117b4565b60405180910390fd5b60018160090160009054906101000a900460000b60000b14610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906117d4565b60405180910390fd5b60028160090160006101000a81548160ff021916908360000b60ff1602179055506000808260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560040154604051602401610b9a93929190611762565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610c249190611730565b6000604051808303816000865af19150503d8060008114610c61576040519150601f19603f3d011682016040523d82523d6000602084013e610c66565b606091505b5091509150610c788360000154611368565b8115610cba577fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6785604051610cad91906117f4565b60405180910390a1610cf2565b7fdab20a0fcd702cf875c2d715d5c3fc99af66a716c94b3405408c94b7311c99eb85604051610ce991906117f4565b60405180910390a15b819350505050919050565b60096020528060005260406000206000915054906101000a900460ff1681565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460000b90508a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610e0e6114a5565b60035481600001818152505084816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505033816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083816060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828160800181815250506006548160a0018181525050806002600060035481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015561010082015181600801556101208201518160090160006101000a81548160ff021916908360000b60ff1602179055509050506005600081548092919061103b90611a18565b91905055506003600081548092919061105390611a18565b9190505550806060015173ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff167fb609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c846080015185600001516040516110e29291906118ab565b60405180910390a480600001519150509392505050565b600080600060045490505b60035481101561116c57600060026000838152602001908152602001600020905060008160000154111561115857848314156111495780600001549350505050611173565b828061115490611a18565b9350505b50808061116490611a18565b915050611104565b5060009150505b919050565b600060085483111561118957600080fd5b6000831161119657600080fd5b6008548211156111a557600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516111ec939291906118d4565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461125a57600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146112b757600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008600081548092919061132290611a18565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f24826040516113569190611747565b60405180910390a16008549050919050565b600260008281526020019081526020016000206000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556003820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600482016000905560058201600090556006820160009055600782016000905560088201600090556009820160006101000a81549060ff021916905550506005600081548092919061144a906119ee565b9190505550600060055411156114985760045481141561149357600061147060006110f9565b9050600081141561148957600354600481905550611491565b806004819055505b505b6114a2565b6003546004819055505b50565b60405180610140016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000800b81525090565b60008135905061154b81611a90565b92915050565b60008135905061156081611aa7565b92915050565b60006020828403121561157857600080fd5b60006115868482850161153c565b91505092915050565b6000806000606084860312156115a457600080fd5b60006115b28682870161153c565b93505060206115c38682870161153c565b92505060406115d486828701611551565b9150509250925092565b6000602082840312156115f057600080fd5b60006115fe84828501611551565b91505092915050565b6000806040838503121561161a57600080fd5b600061162885828601611551565b925050602061163985828601611551565b9150509250929050565b61164c81611966565b82525050565b61165b81611978565b82525050565b600061166c8261190b565b6116768185611916565b93506116868185602086016119bb565b80840191505092915050565b61169b81611984565b82525050565b60006116ae601383611921565b91507f4552525f494e56414c49445f52455155455354000000000000000000000000006000830152602082019050919050565b60006116ee601083611921565b91507f4552525f4e4f545f454e444f52534544000000000000000000000000000000006000830152602082019050919050565b61172a816119b1565b82525050565b600061173c8284611661565b915081905092915050565b600060208201905061175c6000830184611643565b92915050565b60006060820190506117776000830186611643565b6117846020830185611643565b6117916040830184611721565b949350505050565b60006020820190506117ae6000830184611652565b92915050565b600060208201905081810360008301526117cd816116a1565b9050919050565b600060208201905081810360008301526117ed816116e1565b9050919050565b60006020820190506118096000830184611721565b92915050565b600061014082019050611825600083018d611721565b611832602083018c611643565b61183f604083018b611643565b61184c606083018a611643565b6118596080830189611721565b61186660a0830188611721565b61187360c0830187611721565b61188060e0830186611721565b61188e610100830185611721565b61189c610120830184611692565b9b9a5050505050505050505050565b60006040820190506118c06000830185611721565b6118cd6020830184611721565b9392505050565b60006060820190506118e96000830186611721565b6118f66020830185611721565b6119036040830184611721565b949350505050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600061193d826119b1565b9150611948836119b1565b92508282101561195b5761195a611a61565b5b828203905092915050565b600061197182611991565b9050919050565b60008115159050919050565b60008160000b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156119d95780820151818401526020810190506119be565b838111156119e8576000848401525b50505050565b60006119f9826119b1565b91506000821415611a0d57611a0c611a61565b5b600182039050919050565b6000611a23826119b1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a5657611a55611a61565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611a9981611966565b8114611aa457600080fd5b50565b611ab0816119b1565b8114611abb57600080fd5b5056fea2646970667358221220989e15437637b2784d71c40db502cba46cee9c1b27adaec2d1865049b91b754764736f6c63430008000033 +\ No newline at end of file diff --git a/python/tests/test_quorum.py b/python/tests/test_quorum.py @@ -10,6 +10,48 @@ logg = logging.getLogger() class ERC20TransferAuthorizationQuorumTest(TestBase): + + def test_vote_access(self): + w = self.w3.eth.contract(abi=self.abi_wallet, address=self.address_wallet) + t = self.w3.eth.contract(abi=self.abi_token, address=self.address_token) + + t.functions.approve(w.address, 10).transact({'from': self.w3.eth.accounts[2]}) + self.eth_tester.mine_block() + + w.functions.addSigner(self.w3.eth.accounts[5]).transact({'from': self.w3.eth.accounts[0]}) + self.eth_tester.mine_block() + + tx_hash = w.functions.createRequest(self.w3.eth.accounts[3], t.address, 10).transact({'from': self.w3.eth.accounts[2]}) + r = self.w3.eth.getTransactionReceipt(tx_hash) + + topic_match = 'b609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c' + log = r.logs[0] + topic = log.topics[0] + self.assertEqual(topic.hex()[2:], topic_match) + serial = int(log.data[66:], 16) + logg.debug('mined with serial {}'.format(serial)) + + # only signers may vote + with self.assertRaises(Exception): + tx_hashh = w.functions.yay(serial).transact({'from': self.w3.eth.accounts[2]}) + + # only signers may vote + with self.assertRaises(Exception): + tx_hashh = w.functions.nay(serial).transact({'from': self.w3.eth.accounts[2]}) + + w.functions.yay(serial).transact({'from': self.w3.eth.accounts[0]}) + + # may not vote twice + with self.assertRaises(Exception): + tx_hashh = w.functions.yay(serial).transact({'from': self.w3.eth.accounts[0]}) + + # may not change vote + with self.assertRaises(Exception): + tx_hashh = w.functions.nay(serial).transact({'from': self.w3.eth.accounts[0]}) + + tx_hashh = w.functions.nay(serial).transact({'from': self.w3.eth.accounts[5]}) + + @unittest.skip('wip') def test_minimal_quorum(self): w = self.w3.eth.contract(abi=self.abi_wallet, address=self.address_wallet) @@ -31,6 +73,10 @@ class ERC20TransferAuthorizationQuorumTest(TestBase): with self.assertRaises(Exception): w.functions.executeRequest(serial).transact({'from': self.w3.eth.accounts[0]}) + # only signers may vote + with self.assertRaises(Exception): + tx_hashh = w.functions.yay(serial).transact({'from': self.w3.eth.accounts[2]}) + tx_hashh = w.functions.yay(serial).transact({'from': self.w3.eth.accounts[0]}) r = self.w3.eth.getTransactionReceipt(tx_hashh) @@ -44,6 +90,7 @@ class ERC20TransferAuthorizationQuorumTest(TestBase): self.assertEqual(t.functions.balanceOf(self.w3.eth.accounts[3]).call(), 10) + @unittest.skip('wip') def test_simple_quorum(self): w = self.w3.eth.contract(abi=self.abi_wallet, address=self.address_wallet) t = self.w3.eth.contract(abi=self.abi_token, address=self.address_token) @@ -86,5 +133,37 @@ class ERC20TransferAuthorizationQuorumTest(TestBase): self.assertEqual(t.functions.balanceOf(self.w3.eth.accounts[3]).call(), 10) + @unittest.skip('wip') + def test_simple_rejection(self): + w = self.w3.eth.contract(abi=self.abi_wallet, address=self.address_wallet) + t = self.w3.eth.contract(abi=self.abi_token, address=self.address_token) + + t.functions.approve(w.address, 10).transact({'from': self.w3.eth.accounts[2]}) + self.eth_tester.mine_block() + + w.functions.addSigner(self.w3.eth.accounts[5]).transact({'from': self.w3.eth.accounts[0]}) + w.functions.addSigner(self.w3.eth.accounts[6]).transact({'from': self.w3.eth.accounts[0]}) + w.functions.setThresholds(2, 0).transact({'from': self.w3.eth.accounts[0]}) + + tx_hash = w.functions.createRequest(self.w3.eth.accounts[3], t.address, 10).transact({'from': self.w3.eth.accounts[2]}) + r = self.w3.eth.getTransactionReceipt(tx_hash) + + topic_match = 'b609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c' + log = r.logs[0] + topic = log.topics[0] + self.assertEqual(topic.hex()[2:], topic_match) + serial = int(log.data[66:], 16) + logg.debug('mined with serial {}'.format(serial)) + + tx_hashh = w.functions.nay(serial).transact({'from': self.w3.eth.accounts[0]}) + r = self.w3.eth.getTransactionReceipt(tx_hashh) + self.assertEqual(len(r.logs), 0) + + # verify we cannot vote nay twice + with self.assertRaises(Exception): + w.functions.nay(serial).transact({'from': self.w3.eth.accounts[0]}) + + tx_hashh = w.functions.nay(serial).transact({'from': self.w3.eth.accounts[5]}) + if __name__ == '__main__': unittest.main() diff --git a/solidity/TransferApproval.bin b/solidity/TransferApproval.bin @@ -1 +1 @@ -60806040523480156200001157600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016003819055506001600481905550600160068190555060016008819055506200008760016000620000a060201b60201c565b5062000099336200012b60201b60201c565b50620003d2565b6000600854831115620000b257600080fd5b60008311620000c057600080fd5b600854821115620000d057600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516200011993929190620002da565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146200018857600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514620001e657600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190620002539062000355565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2482604051620002899190620002bd565b60405180910390a16008549050919050565b620002a68162000317565b82525050565b620002b7816200034b565b82525050565b6000602082019050620002d460008301846200029b565b92915050565b6000606082019050620002f16000830186620002ac565b620003006020830185620002ac565b6200030f6040830184620002ac565b949350505050565b600062000324826200032b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000362826200034b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620003985762000397620003a3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611ae280620003e26000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80636e417c6911610097578063b0addede11610066578063b0addede146102e2578063bac911ac14610312578063e3064a7714610342578063eb12d61e1461037257610100565b80636e417c691461022b578063736c0d5b1461025b57806381d12c581461028b5780638da5cb5b146102c457610100565b80634797569a116100d35780634797569a1461018f57806357ec347a146101bf57806358d71f82146101dd578063614f427f1461020d57610100565b806306661abd1461010557806308ae6377146101235780630e316ab7146101415780631703a01814610171575b600080fd5b61010d6103a2565b60405161011a91906117e2565b60405180910390f35b61012b6103a8565b60405161013891906117e2565b60405180910390f35b61015b60048036038101906101569190611554565b6103d3565b60405161016891906117e2565b60405180910390f35b6101796105ce565b60405161018691906117e2565b60405180910390f35b6101a960048036038101906101a491906115cc565b6105d4565b6040516101b691906117e2565b60405180910390f35b6101c761083e565b6040516101d491906117e2565b60405180910390f35b6101f760048036038101906101f291906115cc565b610854565b60405161020491906117e2565b60405180910390f35b610215610a0c565b60405161022291906117e2565b60405180910390f35b610245600480360381019061024091906115cc565b610a12565b6040516102529190611787565b60405180910390f35b61027560048036038101906102709190611554565b610ceb565b6040516102829190611787565b60405180910390f35b6102a560048036038101906102a091906115cc565b610d0b565b6040516102bb9a999897969594939291906117fd565b60405180910390f35b6102cc610dcc565b6040516102d99190611735565b60405180910390f35b6102fc60048036038101906102f7919061157d565b610df2565b60405161030991906117e2565b60405180910390f35b61032c600480360381019061032791906115cc565b6110e7565b60405161033991906117e2565b60405180910390f35b61035c600480360381019061035791906115f5565b611166565b6040516103699190611787565b60405180910390f35b61038c60048036038101906103879190611554565b6111ec565b60405161039991906117e2565b60405180910390f35b60055481565b6000806004546003546103bb9190611920565b14156103ca57600090506103d0565b60045490505b90565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561043057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806104b757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6104c057600080fd5b60011515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461051d57600080fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190610588906119dc565b91905055507f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b826040516105bc9190611735565b60405180910390a16008549050919050565b60065481565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461060d57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b1461067957600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff1602179055508060080160008154809291906106fa90611a06565b9190505550806005015481600801546008546107169190611920565b1415610798577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff1602179055507f94064f919a02d0565c6790e0615fb4ba6cf1be1dd679f0161be914613a1b9bb58360405161078b91906117e2565b60405180910390a1610831565b600081600601541180156107b3575080600601548160080154145b15610830577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff1602179055507f2ae00ba9813199478b6f22f0c9b606daa70f8efc319c8d2fa6af63f66ea317638360405161082791906117e2565b60405180910390a15b5b8060080154915050919050565b6000600160035461084f9190611920565b905090565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461088d57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b146108f957600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff16021790555080600701600081548092919061097a90611a06565b9190505550806005015481600701546008546109969190611920565b14156109ff5760018160090160006101000a81548160ff021916908360000b60ff1602179055507f3ad93af63cb7967b23e4fb500b7d7d28b07516325dcf341f88bebf959d82c1cb836040516109ec91906117e2565b60405180910390a16109fd83610a12565b505b8060070154915050919050565b60075481565b6000806002600084815260200190815260200160002090506000816000015411610a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a68906117a2565b60405180910390fd5b60018160090160009054906101000a900460000b60000b14610ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abf906117c2565b60405180910390fd5b60028160090160006101000a81548160ff021916908360000b60ff1602179055506000808260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560040154604051602401610b8893929190611750565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610c12919061171e565b6000604051808303816000865af19150503d8060008114610c4f576040519150601f19603f3d011682016040523d82523d6000602084013e610c54565b606091505b5091509150610c668360000154611356565b8115610ca8577fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6785604051610c9b91906117e2565b60405180910390a1610ce0565b7fdab20a0fcd702cf875c2d715d5c3fc99af66a716c94b3405408c94b7311c99eb85604051610cd791906117e2565b60405180910390a15b819350505050919050565b60096020528060005260406000206000915054906101000a900460ff1681565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460000b90508a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610dfc611493565b60035481600001818152505084816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505033816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083816060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828160800181815250506006548160a0018181525050806002600060035481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015561010082015181600801556101208201518160090160006101000a81548160ff021916908360000b60ff1602179055509050506005600081548092919061102990611a06565b91905055506003600081548092919061104190611a06565b9190505550806060015173ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff167fb609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c846080015185600001516040516110d0929190611899565b60405180910390a480600001519150509392505050565b600080600060045490505b60035481101561115a57600060026000838152602001908152602001600020905060008160000154111561114657848314156111375780600001549350505050611161565b828061114290611a06565b9350505b50808061115290611a06565b9150506110f2565b5060009150505b919050565b600060085483111561117757600080fd5b6000831161118457600080fd5b60085482111561119357600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516111da939291906118c2565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461124857600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146112a557600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008600081548092919061131090611a06565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f24826040516113449190611735565b60405180910390a16008549050919050565b600260008281526020019081526020016000206000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556003820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600482016000905560058201600090556006820160009055600782016000905560088201600090556009820160006101000a81549060ff0219169055505060056000815480929190611438906119dc565b9190505550600060055411156114865760045481141561148157600061145e60006110e7565b905060008114156114775760035460048190555061147f565b806004819055505b505b611490565b6003546004819055505b50565b60405180610140016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000800b81525090565b60008135905061153981611a7e565b92915050565b60008135905061154e81611a95565b92915050565b60006020828403121561156657600080fd5b60006115748482850161152a565b91505092915050565b60008060006060848603121561159257600080fd5b60006115a08682870161152a565b93505060206115b18682870161152a565b92505060406115c28682870161153f565b9150509250925092565b6000602082840312156115de57600080fd5b60006115ec8482850161153f565b91505092915050565b6000806040838503121561160857600080fd5b60006116168582860161153f565b92505060206116278582860161153f565b9150509250929050565b61163a81611954565b82525050565b61164981611966565b82525050565b600061165a826118f9565b6116648185611904565b93506116748185602086016119a9565b80840191505092915050565b61168981611972565b82525050565b600061169c60138361190f565b91507f4552525f494e56414c49445f52455155455354000000000000000000000000006000830152602082019050919050565b60006116dc60108361190f565b91507f4552525f4e4f545f454e444f52534544000000000000000000000000000000006000830152602082019050919050565b6117188161199f565b82525050565b600061172a828461164f565b915081905092915050565b600060208201905061174a6000830184611631565b92915050565b60006060820190506117656000830186611631565b6117726020830185611631565b61177f604083018461170f565b949350505050565b600060208201905061179c6000830184611640565b92915050565b600060208201905081810360008301526117bb8161168f565b9050919050565b600060208201905081810360008301526117db816116cf565b9050919050565b60006020820190506117f7600083018461170f565b92915050565b600061014082019050611813600083018d61170f565b611820602083018c611631565b61182d604083018b611631565b61183a606083018a611631565b611847608083018961170f565b61185460a083018861170f565b61186160c083018761170f565b61186e60e083018661170f565b61187c61010083018561170f565b61188a610120830184611680565b9b9a5050505050505050505050565b60006040820190506118ae600083018561170f565b6118bb602083018461170f565b9392505050565b60006060820190506118d7600083018661170f565b6118e4602083018561170f565b6118f1604083018461170f565b949350505050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600061192b8261199f565b91506119368361199f565b92508282101561194957611948611a4f565b5b828203905092915050565b600061195f8261197f565b9050919050565b60008115159050919050565b60008160000b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156119c75780820151818401526020810190506119ac565b838111156119d6576000848401525b50505050565b60006119e78261199f565b915060008214156119fb576119fa611a4f565b5b600182039050919050565b6000611a118261199f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a4457611a43611a4f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611a8781611954565b8114611a9257600080fd5b50565b611a9e8161199f565b8114611aa957600080fd5b5056fea2646970667358221220bb3ffd404eab5da5b2ec1981c136a2879accb2c218a5a3d6bd9c9adcd5f8744e64736f6c63430008000033 -\ No newline at end of file +60806040523480156200001157600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016003819055506001600481905550600160068190555060016008819055506200008760016000620000a060201b60201c565b5062000099336200012b60201b60201c565b50620003d2565b6000600854831115620000b257600080fd5b60008311620000c057600080fd5b600854821115620000d057600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516200011993929190620002da565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146200018857600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514620001e657600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190620002539062000355565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2482604051620002899190620002bd565b60405180910390a16008549050919050565b620002a68162000317565b82525050565b620002b7816200034b565b82525050565b6000602082019050620002d460008301846200029b565b92915050565b6000606082019050620002f16000830186620002ac565b620003006020830185620002ac565b6200030f6040830184620002ac565b949350505050565b600062000324826200032b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000362826200034b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620003985762000397620003a3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611af480620003e26000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80636e417c6911610097578063b0addede11610066578063b0addede146102e2578063bac911ac14610312578063e3064a7714610342578063eb12d61e1461037257610100565b80636e417c691461022b578063736c0d5b1461025b57806381d12c581461028b5780638da5cb5b146102c457610100565b80634797569a116100d35780634797569a1461018f57806357ec347a146101bf57806358d71f82146101dd578063614f427f1461020d57610100565b806306661abd1461010557806308ae6377146101235780630e316ab7146101415780631703a01814610171575b600080fd5b61010d6103a2565b60405161011a91906117f4565b60405180910390f35b61012b6103a8565b60405161013891906117f4565b60405180910390f35b61015b60048036038101906101569190611566565b6103d3565b60405161016891906117f4565b60405180910390f35b6101796105ce565b60405161018691906117f4565b60405180910390f35b6101a960048036038101906101a491906115de565b6105d4565b6040516101b691906117f4565b60405180910390f35b6101c7610850565b6040516101d491906117f4565b60405180910390f35b6101f760048036038101906101f291906115de565b610866565b60405161020491906117f4565b60405180910390f35b610215610a1e565b60405161022291906117f4565b60405180910390f35b610245600480360381019061024091906115de565b610a24565b6040516102529190611799565b60405180910390f35b61027560048036038101906102709190611566565b610cfd565b6040516102829190611799565b60405180910390f35b6102a560048036038101906102a091906115de565b610d1d565b6040516102bb9a9998979695949392919061180f565b60405180910390f35b6102cc610dde565b6040516102d99190611747565b60405180910390f35b6102fc60048036038101906102f7919061158f565b610e04565b60405161030991906117f4565b60405180910390f35b61032c600480360381019061032791906115de565b6110f9565b60405161033991906117f4565b60405180910390f35b61035c60048036038101906103579190611607565b611178565b6040516103699190611799565b60405180910390f35b61038c60048036038101906103879190611566565b6111fe565b60405161039991906117f4565b60405180910390f35b60055481565b6000806004546003546103bb9190611932565b14156103ca57600090506103d0565b60045490505b90565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561043057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806104b757508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6104c057600080fd5b60011515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461051d57600080fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190610588906119ee565b91905055507f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b826040516105bc9190611747565b60405180910390a16008549050919050565b60065481565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461060d57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b1461067957600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff1602179055508060080160008154809291906106fa90611a18565b9190505550806005015481600801546008546107169190611932565b14156107a1577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff16021790555061076583611368565b7f94064f919a02d0565c6790e0615fb4ba6cf1be1dd679f0161be914613a1b9bb58360405161079491906117f4565b60405180910390a1610843565b600081600601541180156107bc575080600601548160080154145b15610842577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff16021790555061080a83611368565b7f2ae00ba9813199478b6f22f0c9b606daa70f8efc319c8d2fa6af63f66ea317638360405161083991906117f4565b60405180910390a15b5b8060080154915050919050565b600060016003546108619190611932565b905090565b60008060026000848152602001908152602001600020905060008160090160009054906101000a900460000b60000b1461089f57600080fd5b600080600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b1461090b57600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff16021790555080600701600081548092919061098c90611a18565b9190505550806005015481600701546008546109a89190611932565b1415610a115760018160090160006101000a81548160ff021916908360000b60ff1602179055507f3ad93af63cb7967b23e4fb500b7d7d28b07516325dcf341f88bebf959d82c1cb836040516109fe91906117f4565b60405180910390a1610a0f83610a24565b505b8060070154915050919050565b60075481565b6000806002600084815260200190815260200160002090506000816000015411610a83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7a906117b4565b60405180910390fd5b60018160090160009054906101000a900460000b60000b14610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906117d4565b60405180910390fd5b60028160090160006101000a81548160ff021916908360000b60ff1602179055506000808260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560040154604051602401610b9a93929190611762565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610c249190611730565b6000604051808303816000865af19150503d8060008114610c61576040519150601f19603f3d011682016040523d82523d6000602084013e610c66565b606091505b5091509150610c788360000154611368565b8115610cba577fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6785604051610cad91906117f4565b60405180910390a1610cf2565b7fdab20a0fcd702cf875c2d715d5c3fc99af66a716c94b3405408c94b7311c99eb85604051610ce991906117f4565b60405180910390a15b819350505050919050565b60096020528060005260406000206000915054906101000a900460ff1681565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460000b90508a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610e0e6114a5565b60035481600001818152505084816040019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505033816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083816060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828160800181815250506006548160a0018181525050806002600060035481526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015561010082015181600801556101208201518160090160006101000a81548160ff021916908360000b60ff1602179055509050506005600081548092919061103b90611a18565b91905055506003600081548092919061105390611a18565b9190505550806060015173ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff167fb609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c846080015185600001516040516110e29291906118ab565b60405180910390a480600001519150509392505050565b600080600060045490505b60035481101561116c57600060026000838152602001908152602001600020905060008160000154111561115857848314156111495780600001549350505050611173565b828061115490611a18565b9350505b50808061116490611a18565b915050611104565b5060009150505b919050565b600060085483111561118957600080fd5b6000831161119657600080fd5b6008548211156111a557600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516111ec939291906118d4565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461125a57600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146112b757600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506008600081548092919061132290611a18565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f24826040516113569190611747565b60405180910390a16008549050919050565b600260008281526020019081526020016000206000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556003820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600482016000905560058201600090556006820160009055600782016000905560088201600090556009820160006101000a81549060ff021916905550506005600081548092919061144a906119ee565b9190505550600060055411156114985760045481141561149357600061147060006110f9565b9050600081141561148957600354600481905550611491565b806004819055505b505b6114a2565b6003546004819055505b50565b60405180610140016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000800b81525090565b60008135905061154b81611a90565b92915050565b60008135905061156081611aa7565b92915050565b60006020828403121561157857600080fd5b60006115868482850161153c565b91505092915050565b6000806000606084860312156115a457600080fd5b60006115b28682870161153c565b93505060206115c38682870161153c565b92505060406115d486828701611551565b9150509250925092565b6000602082840312156115f057600080fd5b60006115fe84828501611551565b91505092915050565b6000806040838503121561161a57600080fd5b600061162885828601611551565b925050602061163985828601611551565b9150509250929050565b61164c81611966565b82525050565b61165b81611978565b82525050565b600061166c8261190b565b6116768185611916565b93506116868185602086016119bb565b80840191505092915050565b61169b81611984565b82525050565b60006116ae601383611921565b91507f4552525f494e56414c49445f52455155455354000000000000000000000000006000830152602082019050919050565b60006116ee601083611921565b91507f4552525f4e4f545f454e444f52534544000000000000000000000000000000006000830152602082019050919050565b61172a816119b1565b82525050565b600061173c8284611661565b915081905092915050565b600060208201905061175c6000830184611643565b92915050565b60006060820190506117776000830186611643565b6117846020830185611643565b6117916040830184611721565b949350505050565b60006020820190506117ae6000830184611652565b92915050565b600060208201905081810360008301526117cd816116a1565b9050919050565b600060208201905081810360008301526117ed816116e1565b9050919050565b60006020820190506118096000830184611721565b92915050565b600061014082019050611825600083018d611721565b611832602083018c611643565b61183f604083018b611643565b61184c606083018a611643565b6118596080830189611721565b61186660a0830188611721565b61187360c0830187611721565b61188060e0830186611721565b61188e610100830185611721565b61189c610120830184611692565b9b9a5050505050505050505050565b60006040820190506118c06000830185611721565b6118cd6020830184611721565b9392505050565b60006060820190506118e96000830186611721565b6118f66020830185611721565b6119036040830184611721565b949350505050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600061193d826119b1565b9150611948836119b1565b92508282101561195b5761195a611a61565b5b828203905092915050565b600061197182611991565b9050919050565b60008115159050919050565b60008160000b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156119d95780820151818401526020810190506119be565b838111156119e8576000848401525b50505050565b60006119f9826119b1565b91506000821415611a0d57611a0c611a61565b5b600182039050919050565b6000611a23826119b1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a5657611a55611a61565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611a9981611966565b8114611aa457600080fd5b50565b611ab0816119b1565b8114611abb57600080fd5b5056fea2646970667358221220989e15437637b2784d71c40db502cba46cee9c1b27adaec2d1865049b91b754764736f6c63430008000033 +\ No newline at end of file diff --git a/solidity/TransferApproval.sol b/solidity/TransferApproval.sol @@ -173,9 +173,11 @@ contract ERC20ApprovalEscrow { if (signerCount - txx.nay == txx.quorum) { txx.result = -1; + removeItem(_serial); emit Rejected(_serial); } else if (txx.vetoThreshold > 0 && txx.nay == txx.vetoThreshold) { txx.result = -1; + removeItem(_serial); emit Vetoed(_serial); }