dogethereum-contracts
dogethereum-contracts copied to clipboard
Unlock tx are forced to have a change output
DogeTx.parseTransaction() fails for an unlock tx if the tx does not contains a change output sending doges to an operator. DogeToken.processTransaction() needs to know the value sent to the operator, no matter it is a lock or unlock tx. if there is no change, that value should be 0. unlock txs should be detected by DogeToken.processTransaction() by checking the inputs are signed by the operator.
Workaround that is currently implemented: On the agent isReleaseTx() returns false for unlock tx that don't have change. To relay those tx is just usefule to prevent the operator from being penalized for not doing un unlock. Since penalization is not implemented yet, the workaround works.
Another hack that might solve this: DogeToken should make sure there is always change. When it select utxos, it should make sure there is change. This just require changing ">=" by ">"
Contracts were updated to accept the case with no output to the operator a24d3d64fc2176cc5b8766e8c4b80413a1813067