commit d78d75d605c67180ea325397e267d03f01535699
parent 001d6b84517289cf3a2dd45a60afc77608aafc8b
Author: nolash <dev@holbrook.no>
Date: Tue, 16 Feb 2021 12:11:57 +0100
Tolerate signer changes in existing requests
Diffstat:
4 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/python/erc20_transfer_authorization/data/ERC20TransferAuthorization.bin b/python/erc20_transfer_authorization/data/ERC20TransferAuthorization.bin
@@ -1 +1 @@
-60806040523480156200001157600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016003819055506001600481905550600160068190555060016008819055506200008760016000620000a060201b60201c565b5062000099336200012b60201b60201c565b50620003d2565b6000600854831115620000b257600080fd5b60008311620000c057600080fd5b600854821115620000d057600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516200011993929190620002da565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146200018857600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514620001e657600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060086000815480929190620002539062000355565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2482604051620002899190620002bd565b60405180910390a16008549050919050565b620002a68162000317565b82525050565b620002b7816200034b565b82525050565b6000602082019050620002d460008301846200029b565b92915050565b6000606082019050620002f16000830186620002ac565b620003006020830185620002ac565b6200030f6040830184620002ac565b949350505050565b600062000324826200032b565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600062000362826200034b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620003985762000397620003a3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611a8c80620003e26000396000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063614f427f116100a25780638da5cb5b116100715780638da5cb5b146102ff578063b0addede1461031d578063bac911ac1461034d578063e3064a771461037d578063eb12d61e146103ad5761010b565b8063614f427f146102485780636e417c6914610266578063736c0d5b1461029657806381d12c58146102c65761010b565b80631703a018116100de5780631703a018146101ac5780634797569a146101ca57806357ec347a146101fa57806358d71f82146102185761010b565b806302d947ef1461011057806306661abd1461014057806308ae63771461015e5780630e316ab71461017c575b600080fd5b61012a60048036038101906101259190611548565b6103dd565b6040516101379190611731565b60405180910390f35b61014861040c565b604051610155919061178c565b60405180910390f35b610166610412565b604051610173919061178c565b60405180910390f35b610196600480360381019061019191906114a7565b61043d565b6040516101a3919061178c565b60405180910390f35b6101b4610638565b6040516101c1919061178c565b60405180910390f35b6101e460048036038101906101df919061151f565b61063e565b6040516101f1919061178c565b60405180910390f35b610202610930565b60405161020f919061178c565b60405180910390f35b610232600480360381019061022d919061151f565b610946565b60405161023f919061178c565b60405180910390f35b610250610b4b565b60405161025d919061178c565b60405180910390f35b610280600480360381019061027b919061151f565b610b51565b60405161028d9190611716565b60405180910390f35b6102b060048036038101906102ab91906114a7565b610e2a565b6040516102bd9190611716565b60405180910390f35b6102e060048036038101906102db919061151f565b610e4a565b6040516102f69a999897969594939291906117a7565b60405180910390f35b610307610f0b565b60405161031491906116c4565b60405180910390f35b610337600480360381019061033291906114d0565b610f31565b604051610344919061178c565b60405180910390f35b6103676004803603810190610362919061151f565b611190565b604051610374919061178c565b60405180910390f35b61039760048036038101906103929190611584565b61121f565b6040516103a49190611716565b60405180910390f35b6103c760048036038101906103c291906114a7565b6112a5565b6040516103d4919061178c565b60405180910390f35b60006020528160005260406000206020528060005260406000206000915091509054906101000a900460000b81565b60055481565b60008060045460035461042591906118ca565b1415610434576000905061043a565b60045490505b90565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561049a57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061052157508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61052a57600080fd5b60011515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461058757600080fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600860008154809291906105f290611986565b91905055507f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b8260405161062691906116c4565b60405180910390a16008549050919050565b60065481565b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661069657600080fd5b600080600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b1461070257600080fd5b600060026000848152602001908152602001600020905060018160090160009054906101000a900460000b60000b1461073a57600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff1602179055508060080160008154809291906107da906119b0565b9190505550806005015481600801546008546107f691906118ca565b1415610881577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff1602179055506108458361140f565b7f94064f919a02d0565c6790e0615fb4ba6cf1be1dd679f0161be914613a1b9bb583604051610874919061178c565b60405180910390a1610923565b6000816006015411801561089c575080600601548160080154145b15610922577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160090160006101000a81548160ff021916908360000b60ff1602179055506108ea8361140f565b7f2ae00ba9813199478b6f22f0c9b606daa70f8efc319c8d2fa6af63f66ea3176383604051610919919061178c565b60405180910390a15b5b8060080154915050919050565b6000600160035461094191906118ca565b905090565b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661099e57600080fd5b600080600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b14610a0a57600080fd5b600060026000848152602001908152602001600020905060018160090160009054906101000a900460000b60000b14610a4257600080fd5b600160008085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff160217905550806007016000815480929190610ac3906119b0565b919050555080600501548160070154600854610adf91906118ca565b1415610b3e5760028160090160006101000a81548160ff021916908360000b60ff1602179055507f3ad93af63cb7967b23e4fb500b7d7d28b07516325dcf341f88bebf959d82c1cb83604051610b35919061178c565b60405180910390a15b8060070154915050919050565b60075481565b6000806002600084815260200190815260200160002090506000816000015411610bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba79061174c565b60405180910390fd5b60028160090160009054906101000a900460000b60000b14610c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfe9061176c565b60405180910390fd5b60008160090160006101000a81548160ff021916908360000b60ff1602179055506000808260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560040154604051602401610cc7939291906116df565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d5191906116ad565b6000604051808303816000865af19150503d8060008114610d8e576040519150601f19603f3d011682016040523d82523d6000602084013e610d93565b606091505b5091509150610da5836000015461140f565b8115610de7577fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6785604051610dda919061178c565b60405180910390a1610e1f565b7fdab20a0fcd702cf875c2d715d5c3fc99af66a716c94b3405408c94b7311c99eb85604051610e16919061178c565b60405180910390a15b819350505050919050565b60096020528060005260406000206000915054906101000a900460ff1681565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460000b90508a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060026000600354815260200190815260200160002090506003548160000181905550848160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550338160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550838160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508281600401819055506006548160050181905550600754816006018190555060018160090160006101000a81548160ff021916908360000b60ff16021790555060056000815480929190611072906119b0565b91905055506003600081548092919061108a906119b0565b91905055508060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c84600401548560000154604051611179929190611843565b60405180910390a480600001549150509392505050565b600080600060045490505b60035481101561121357600060026000838152602001908152602001600020905060008160090160009054906101000a900460000b60000b13156111ff57848314156111f0578060000154935050505061121a565b82806111fb906119b0565b9350505b50808061120b906119b0565b91505061119b565b5060009150505b919050565b600060085483111561123057600080fd5b6000831161123d57600080fd5b60085482111561124c57600080fd5b82600681905550816007819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756006546007546008546040516112939392919061186c565b60405180910390a16001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461130157600080fd5b60001515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461135e57600080fd5b6001600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600860008154809291906113c9906119b0565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f24826040516113fd91906116c4565b60405180910390a16008549050919050565b6005600081548092919061142290611986565b9190505550600060055411156114705760045481141561146b5760006114486000611190565b9050600081141561146157600354600481905550611469565b806004819055505b505b61147a565b6003546004819055505b50565b60008135905061148c81611a28565b92915050565b6000813590506114a181611a3f565b92915050565b6000602082840312156114b957600080fd5b60006114c78482850161147d565b91505092915050565b6000806000606084860312156114e557600080fd5b60006114f38682870161147d565b93505060206115048682870161147d565b925050604061151586828701611492565b9150509250925092565b60006020828403121561153157600080fd5b600061153f84828501611492565b91505092915050565b6000806040838503121561155b57600080fd5b600061156985828601611492565b925050602061157a8582860161147d565b9150509250929050565b6000806040838503121561159757600080fd5b60006115a585828601611492565b92505060206115b685828601611492565b9150509250929050565b6115c9816118fe565b82525050565b6115d881611910565b82525050565b60006115e9826118a3565b6115f381856118ae565b9350611603818560208601611953565b80840191505092915050565b6116188161191c565b82525050565b600061162b6013836118b9565b91507f4552525f494e56414c49445f52455155455354000000000000000000000000006000830152602082019050919050565b600061166b6010836118b9565b91507f4552525f4e4f545f454e444f52534544000000000000000000000000000000006000830152602082019050919050565b6116a781611949565b82525050565b60006116b982846115de565b915081905092915050565b60006020820190506116d960008301846115c0565b92915050565b60006060820190506116f460008301866115c0565b61170160208301856115c0565b61170e604083018461169e565b949350505050565b600060208201905061172b60008301846115cf565b92915050565b6000602082019050611746600083018461160f565b92915050565b600060208201905081810360008301526117658161161e565b9050919050565b600060208201905081810360008301526117858161165e565b9050919050565b60006020820190506117a1600083018461169e565b92915050565b6000610140820190506117bd600083018d61169e565b6117ca602083018c6115c0565b6117d7604083018b6115c0565b6117e4606083018a6115c0565b6117f1608083018961169e565b6117fe60a083018861169e565b61180b60c083018761169e565b61181860e083018661169e565b61182661010083018561169e565b61183461012083018461160f565b9b9a5050505050505050505050565b6000604082019050611858600083018561169e565b611865602083018461169e565b9392505050565b6000606082019050611881600083018661169e565b61188e602083018561169e565b61189b604083018461169e565b949350505050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006118d582611949565b91506118e083611949565b9250828210156118f3576118f26119f9565b5b828203905092915050565b600061190982611929565b9050919050565b60008115159050919050565b60008160000b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611971578082015181840152602081019050611956565b83811115611980576000848401525b50505050565b600061199182611949565b915060008214156119a5576119a46119f9565b5b600182039050919050565b60006119bb82611949565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156119ee576119ed6119f9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611a31816118fe565b8114611a3c57600080fd5b50565b611a4881611949565b8114611a5357600080fd5b5056fea26469706673582212209518b4dc715f5c2253f1cec97d24f2a17c9ec0cf4f89a44b63dee36379f7e3af64736f6c63430008000033
-\ No newline at end of file
+60806040523480156200001157600080fd5b5033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016004819055506001600581905550600160078190555060016009819055506200008760016000620000a060201b60201c565b5062000099336200012b60201b60201c565b506200051b565b6000600954831115620000b257600080fd5b60008311620000c057600080fd5b600954821115620000d057600080fd5b82600781905550816008819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae175600754600854600954604051620001199392919062000412565b60405180910390a16001905092915050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614620001c0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001b790620003ce565b60405180910390fd5b60001515600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151462000256576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200024d90620003f0565b60405180910390fd5b6001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060096000815480929190620002c3906200049e565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f2482604051620002f99190620003b1565b60405180910390a16009549050919050565b620003168162000460565b82525050565b60006200032b600a836200044f565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b60006200036d600c836200044f565b91507f4552525f4e4f54464f554e4400000000000000000000000000000000000000006000830152602082019050919050565b620003ab8162000494565b82525050565b6000602082019050620003c860008301846200030b565b92915050565b60006020820190508181036000830152620003e9816200031c565b9050919050565b600060208201905081810360008301526200040b816200035e565b9050919050565b6000606082019050620004296000830186620003a0565b620004386020830185620003a0565b620004476040830184620003a0565b949350505050565b600082825260208201905092915050565b60006200046d8262000474565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000620004ab8262000494565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415620004e157620004e0620004ec565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611e39806200052b6000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80636e417c69116100ad578063bac911ac11610071578063bac911ac14610361578063e3064a7714610391578063e9f9d28b146103c1578063eb12d61e146103f1578063fba00cbd1461042157610121565b80636e417c691461027c578063736c0d5b146102ac57806381d12c58146102dc5780638da5cb5b14610313578063b0addede1461033157610121565b80631703a018116100f45780631703a018146101c25780634797569a146101e057806357ec347a1461021057806358d71f821461022e578063614f427f1461025e57610121565b806302d947ef1461012657806306661abd1461015657806308ae6377146101745780630e316ab714610192575b600080fd5b610140600480360381019061013b91906117f3565b610451565b60405161014d9190611a9c565b60405180910390f35b61015e610480565b60405161016b9190611b57565b60405180910390f35b61017c610486565b6040516101899190611b57565b60405180910390f35b6101ac60048036038101906101a79190611752565b6104b1565b6040516101b99190611b57565b60405180910390f35b6101ca610712565b6040516101d79190611b57565b60405180910390f35b6101fa60048036038101906101f591906117ca565b610718565b6040516102079190611b57565b60405180910390f35b610218610950565b6040516102259190611b57565b60405180910390f35b610248600480360381019061024391906117ca565b610966565b6040516102559190611b57565b60405180910390f35b610266610b7f565b6040516102739190611b57565b60405180910390f35b610296600480360381019061029191906117ca565b610b85565b6040516102a39190611a81565b60405180910390f35b6102c660048036038101906102c19190611752565b610e5e565b6040516102d39190611a81565b60405180910390f35b6102f660048036038101906102f191906117ca565b610e7e565b60405161030a989796959493929190611b72565b60405180910390f35b61031b610f33565b6040516103289190611a2f565b60405180910390f35b61034b6004803603810190610346919061177b565b610f59565b6040516103589190611b57565b60405180910390f35b61037b600480360381019061037691906117ca565b6111a2565b6040516103889190611b57565b60405180910390f35b6103ab60048036038101906103a6919061182f565b611231565b6040516103b89190611a81565b60405180910390f35b6103db60048036038101906103d691906117ca565b6112b7565b6040516103e89190611a81565b60405180910390f35b61040b60048036038101906104069190611752565b611496565b6040516104189190611b57565b60405180910390f35b61043b6004803603810190610436919061182f565b61166c565b6040516104489190611a2f565b60405180910390f35b60006020528160005260406000206020528060005260406000206000915091509054906101000a900460000b81565b60065481565b6000806005546004546104999190611c77565b14156104a857600090506104ae565b60055490505b90565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061053a57508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090611ad7565b60405180910390fd5b60011515600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060390611af7565b60405180910390fd5b6007546009541180156106225750600854600954115b610661576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065890611ab7565b60405180910390fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600960008154809291906106cc90611d33565b91905055507f3525e22824a8a7df2c9a6029941c824cf95b6447f1e13d5128fd3826d35afe8b826040516107009190611a2f565b60405180910390a16009549050919050565b60075481565b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661077057600080fd5b600080600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b146107dc57600080fd5b600060036000848152602001908152602001600020905060018160070160009054906101000a900460000b60000b1461081457600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000808360000154815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff1602179055506001600082600001548152602001908152602001600020339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600601600081548092919061093090611d5d565b919050555061094281600001546112b7565b508060060154915050919050565b600060016004546109619190611c77565b905090565b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166109be57600080fd5b600080600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460000b60000b14610a2a57600080fd5b600060036000848152602001908152602001600020905060018160070160009054906101000a900460000b60000b14610a6257600080fd5b60016000808360000154815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360000b60ff1602179055506001600082600001548152602001908152602001600020339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806005016000815480929190610b5f90611d5d565b9190505550610b7181600001546112b7565b508060050154915050919050565b60085481565b6000806003600084815260200190815260200160002090506000816000015411610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90611b17565b60405180910390fd5b60028160070160009054906101000a900460000b60000b14610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290611b37565b60405180910390fd5b60008160070160006101000a81548160ff021916908360000b60ff1602179055506000808260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560040154604051602401610cfb93929190611a4a565b6040516020818303038152906040527f23b872dd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610d859190611a18565b6000604051808303816000865af19150503d8060008114610dc2576040519150601f19603f3d011682016040523d82523d6000602084013e610dc7565b606091505b5091509150610dd983600001546116ba565b8115610e1b577fbcf6a68a2f901be4a23a41b53acd7697893a7e34def4e28acba584da75283b6785604051610e0e9190611b57565b60405180910390a1610e53565b7fdab20a0fcd702cf875c2d715d5c3fc99af66a716c94b3405408c94b7311c99eb85604051610e4a9190611b57565b60405180910390a15b819350505050919050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60036020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154908060070160009054906101000a900460000b905088565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060036000600454815260200190815260200160002090506004548160000181905550848160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550338160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550838160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082816004018190555060018160070160006101000a81548160ff021916908360000b60ff1602179055506006600081548092919061108490611d5d565b91905055506004600081548092919061109c90611d5d565b91905055508060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb609ae609609ee99268d05bc1371102cafe8d6b964bf082439ab16be2a01c87c8460040154856000015460405161118b929190611bf0565b60405180910390a480600001549150509392505050565b600080600060055490505b60045481101561122557600060036000838152602001908152602001600020905060008160070160009054906101000a900460000b60000b13156112115784831415611202578060000154935050505061122c565b828061120d90611d5d565b9350505b50808061121d90611d5d565b9150506111ad565b5060009150505b919050565b600060095483111561124257600080fd5b6000831161124f57600080fd5b60095482111561125e57600080fd5b82600781905550816008819055507f9f40cfd22fe91777c78f252bd21a710f3fb007dc2f321876891e7644ba0ae1756007546008546009546040516112a593929190611c19565b60405180910390a16001905092915050565b600080600060036000858152602001908152602001600020905060075481600501546009546112e69190611c77565b141561134d5760028160070160006101000a81548160ff021916908360000b60ff1602179055507f3ad93af63cb7967b23e4fb500b7d7d28b07516325dcf341f88bebf959d82c1cb8460405161133c9190611b57565b60405180910390a16001915061148c565b60075481600601546009546113629190611c77565b14156113ed577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160070160006101000a81548160ff021916908360000b60ff1602179055506113b1846116ba565b7f94064f919a02d0565c6790e0615fb4ba6cf1be1dd679f0161be914613a1b9bb5846040516113e09190611b57565b60405180910390a161148b565b600060085411801561140457506008548160060154145b1561148a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8160070160006101000a81548160ff021916908360000b60ff160217905550611452846116ba565b7f2ae00ba9813199478b6f22f0c9b606daa70f8efc319c8d2fa6af63f66ea31763846040516114819190611b57565b60405180910390a15b5b5b8192505050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611528576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151f90611ad7565b60405180910390fd5b60001515600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146115bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b290611af7565b60405180910390fd5b6001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506009600081548092919061162690611d5d565b91905055507f47d1c22a25bb3a5d4e481b9b1e6944c2eade3181a0a20b495ed61d35b5323f248260405161165a9190611a2f565b60405180910390a16009549050919050565b6001602052816000526040600020818154811061168857600080fd5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660008154809291906116cd90611d33565b91905055506000600654111561171b576005548114156117165760006116f360006111a2565b9050600081141561170c57600454600581905550611714565b806005819055505b505b611725565b6004546005819055505b50565b60008135905061173781611dd5565b92915050565b60008135905061174c81611dec565b92915050565b60006020828403121561176457600080fd5b600061177284828501611728565b91505092915050565b60008060006060848603121561179057600080fd5b600061179e86828701611728565b93505060206117af86828701611728565b92505060406117c08682870161173d565b9150509250925092565b6000602082840312156117dc57600080fd5b60006117ea8482850161173d565b91505092915050565b6000806040838503121561180657600080fd5b60006118148582860161173d565b925050602061182585828601611728565b9150509250929050565b6000806040838503121561184257600080fd5b60006118508582860161173d565b92505060206118618582860161173d565b9150509250929050565b61187481611cab565b82525050565b61188381611cbd565b82525050565b600061189482611c50565b61189e8185611c5b565b93506118ae818560208601611d00565b80840191505092915050565b6118c381611cc9565b82525050565b60006118d6601a83611c66565b91507f4552525f5245445543455f5448524553484f4c445f46495253540000000000006000830152602082019050919050565b6000611916600a83611c66565b91507f4552525f414343455353000000000000000000000000000000000000000000006000830152602082019050919050565b6000611956600c83611c66565b91507f4552525f4e4f54464f554e4400000000000000000000000000000000000000006000830152602082019050919050565b6000611996601383611c66565b91507f4552525f494e56414c49445f52455155455354000000000000000000000000006000830152602082019050919050565b60006119d6601083611c66565b91507f4552525f4e4f545f454e444f52534544000000000000000000000000000000006000830152602082019050919050565b611a1281611cf6565b82525050565b6000611a248284611889565b915081905092915050565b6000602082019050611a44600083018461186b565b92915050565b6000606082019050611a5f600083018661186b565b611a6c602083018561186b565b611a796040830184611a09565b949350505050565b6000602082019050611a96600083018461187a565b92915050565b6000602082019050611ab160008301846118ba565b92915050565b60006020820190508181036000830152611ad0816118c9565b9050919050565b60006020820190508181036000830152611af081611909565b9050919050565b60006020820190508181036000830152611b1081611949565b9050919050565b60006020820190508181036000830152611b3081611989565b9050919050565b60006020820190508181036000830152611b50816119c9565b9050919050565b6000602082019050611b6c6000830184611a09565b92915050565b600061010082019050611b88600083018b611a09565b611b95602083018a61186b565b611ba2604083018961186b565b611baf606083018861186b565b611bbc6080830187611a09565b611bc960a0830186611a09565b611bd660c0830185611a09565b611be360e08301846118ba565b9998505050505050505050565b6000604082019050611c056000830185611a09565b611c126020830184611a09565b9392505050565b6000606082019050611c2e6000830186611a09565b611c3b6020830185611a09565b611c486040830184611a09565b949350505050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000611c8282611cf6565b9150611c8d83611cf6565b925082821015611ca057611c9f611da6565b5b828203905092915050565b6000611cb682611cd6565b9050919050565b60008115159050919050565b60008160000b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611d1e578082015181840152602081019050611d03565b83811115611d2d576000848401525b50505050565b6000611d3e82611cf6565b91506000821415611d5257611d51611da6565b5b600182039050919050565b6000611d6882611cf6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611d9b57611d9a611da6565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611dde81611cab565b8114611de957600080fd5b50565b611df581611cf6565b8114611e0057600080fd5b5056fea2646970667358221220604943dcb457fecebf6a1db2691533b784d976c6e021e0af473f8d8627588eaf64736f6c63430008000033
+\ No newline at end of file
diff --git a/python/erc20_transfer_authorization/data/ERC20TransferAuthorization.json b/python/erc20_transfer_authorization/data/ERC20TransferAuthorization.json
@@ -1 +1 @@
-[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Approved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Executed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"NewRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_quorum","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_vetoThreshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_signerCount","type":"uint256"}],"name":"QuorumSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Rejected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_signer","type":"address"}],"name":"SignerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_signer","type":"address"}],"name":"SignerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"TransferFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Vetoed","type":"event"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"addSigner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"createRequest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"executeRequest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"getSerialAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSerial","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"nay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextSerial","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quorum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"removeSigner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requests","outputs":[{"internalType":"uint256","name":"serial","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"quorum","type":"uint256"},{"internalType":"uint256","name":"vetoThreshold","type":"uint256"},{"internalType":"uint256","name":"yay","type":"uint256"},{"internalType":"uint256","name":"nay","type":"uint256"},{"internalType":"int8","name":"result","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quorum","type":"uint256"},{"internalType":"uint256","name":"_vetoThreshold","type":"uint256"}],"name":"setThresholds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"signers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vetoThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"vote","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"yay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
+[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Approved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Executed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"NewRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_quorum","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_vetoThreshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_signerCount","type":"uint256"}],"name":"QuorumSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Rejected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_signer","type":"address"}],"name":"SignerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_signer","type":"address"}],"name":"SignerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"TransferFail","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"Vetoed","type":"event"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"addSigner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"checkResult","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"count","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"createRequest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"executeRequest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"getSerialAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSerial","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"nay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextSerial","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quorum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"removeSigner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requests","outputs":[{"internalType":"uint256","name":"serial","type":"uint256"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"yay","type":"uint256"},{"internalType":"uint256","name":"nay","type":"uint256"},{"internalType":"int8","name":"result","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quorum","type":"uint256"},{"internalType":"uint256","name":"_vetoThreshold","type":"uint256"}],"name":"setThresholds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"signers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vetoThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"vote","outputs":[{"internalType":"int8","name":"","type":"int8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"voters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_serial","type":"uint256"}],"name":"yay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
diff --git a/python/tests/base.py b/python/tests/base.py
@@ -69,5 +69,3 @@ class TestBase(unittest.TestCase):
def tearDown(self):
pass
-
-
diff --git a/solidity/ERC20TransferAuthorization.sol b/solidity/ERC20TransferAuthorization.sol
@@ -2,21 +2,20 @@ pragma solidity >0.6.11;
// SPDX-License-Identifier: GPL-3.0-or-later
-contract ERC20ApprovalEscrow {
+contract ERC20TransferAuthorization {
struct Transaction {
uint256 serial;
address sender;
address recipient;
address token;
uint256 value;
- uint256 quorum;
- uint256 vetoThreshold;
uint256 yay;
uint256 nay;
int8 result; // -1 rejected/vetoed, 0 = completed, 1 = voting, 2 = approved
}
mapping ( uint256 => mapping ( address => int8 )) public vote;
+ mapping ( uint256 => address[] ) public voters;
address public owner;
mapping(uint256 => Transaction) public requests;
uint256 hi;
@@ -49,8 +48,8 @@ contract ERC20ApprovalEscrow {
}
function addSigner(address _signer) public returns (uint256) {
- require(msg.sender == owner);
- require(signers[_signer] == false);
+ require(msg.sender == owner, 'ERR_ACCESS');
+ require(signers[_signer] == false, 'ERR_NOTFOUND');
signers[_signer] = true;
signerCount++;
@@ -59,9 +58,9 @@ contract ERC20ApprovalEscrow {
}
function removeSigner(address _signer) public returns (uint256) {
- require(_signer != owner);
- require(msg.sender == owner || msg.sender == _signer);
- require(signers[_signer] == true);
+ require(msg.sender == owner || msg.sender == _signer, 'ERR_ACCESS');
+ require(signers[_signer] == true, 'ERR_NOTFOUND');
+ require(signerCount > quorum && signerCount > vetoThreshold, 'ERR_REDUCE_THRESHOLD_FIRST');
signers[_signer] = false;
signerCount--;
@@ -88,8 +87,6 @@ contract ERC20ApprovalEscrow {
txx.sender = msg.sender;
txx.token = _token;
txx.value = _value;
- txx.quorum = quorum;
- txx.vetoThreshold = vetoThreshold;
txx.result = 1;
count++;
@@ -150,13 +147,11 @@ contract ERC20ApprovalEscrow {
Transaction storage txx = requests[_serial];
require(txx.result == 1);
- vote[_serial][msg.sender] = 1;
+ vote[txx.serial][msg.sender] = 1;
+ voters[txx.serial].push(msg.sender);
txx.yay++;
- if (signerCount - txx.yay == txx.quorum) {
- txx.result = 2;
- emit Approved(_serial);
- }
+ checkResult(txx.serial);
return txx.yay;
}
@@ -168,21 +163,33 @@ contract ERC20ApprovalEscrow {
Transaction storage txx = requests[_serial];
require(txx.result == 1);
-
- vote[_serial][msg.sender] = -1;
+ vote[txx.serial][msg.sender] = -1;
+ voters[txx.serial].push(msg.sender);
txx.nay++;
- if (signerCount - txx.nay == txx.quorum) {
+ checkResult(txx.serial);
+
+ return txx.nay;
+ }
+
+ function checkResult(uint256 _serial) public returns (bool) {
+ bool result;
+ Transaction storage txx = requests[_serial];
+
+ if (signerCount - txx.yay == quorum) {
+ txx.result = 2;
+ emit Approved(_serial);
+ result = true;
+ } else if (signerCount - txx.nay == quorum) {
txx.result = -1;
removeItem(_serial);
emit Rejected(_serial);
- } else if (txx.vetoThreshold > 0 && txx.nay == txx.vetoThreshold) {
+ } else if (vetoThreshold > 0 && txx.nay == vetoThreshold) {
txx.result = -1;
removeItem(_serial);
emit Vetoed(_serial);
}
-
- return txx.nay;
+ return result;
}
function executeRequest(uint256 _serial) public returns (bool) {