From 2b4fd73d062b86b5db3a69a53d5a62a8d45bf889 Mon Sep 17 00:00:00 2001 From: Anton Filonenko Date: Thu, 18 Jun 2026 15:10:21 +0300 Subject: [PATCH] feat(evm): add opaque deposit reference to Custody binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Custody.deposit now takes a bytes32 depositReference and the Deposited event carries it (indexed). The reference is opaque and log-only — never validated or stored on-chain — so deposits become filterable per (account, reference) without the contract ascribing sub-account meaning. Regenerated the binding from the refreshed Custody artifact; the SDK depositor passes bytes32(0) (no sub-account). Co-Authored-By: Claude Fable 5 --- pkg/blockchain/evm/artifacts/Custody.abi | 17 +++++- pkg/blockchain/evm/artifacts/Custody.bin | 2 +- pkg/blockchain/evm/custody_abi.go | 75 ++++++++++++------------ pkg/blockchain/evm/depositor.go | 6 +- 4 files changed, 57 insertions(+), 43 deletions(-) diff --git a/pkg/blockchain/evm/artifacts/Custody.abi b/pkg/blockchain/evm/artifacts/Custody.abi index a5d08b1..28bef60 100644 --- a/pkg/blockchain/evm/artifacts/Custody.abi +++ b/pkg/blockchain/evm/artifacts/Custody.abi @@ -37,6 +37,11 @@ "name": "amount", "type": "uint256", "internalType": "uint256" + }, + { + "name": "depositReference", + "type": "bytes32", + "internalType": "bytes32" } ], "outputs": [], @@ -180,15 +185,21 @@ "name": "Deposited", "inputs": [ { - "name": "depositor", + "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "account", - "type": "address", + "name": "depositReference", + "type": "bytes32", "indexed": true, + "internalType": "bytes32" + }, + { + "name": "depositor", + "type": "address", + "indexed": false, "internalType": "address" }, { diff --git a/pkg/blockchain/evm/artifacts/Custody.bin b/pkg/blockchain/evm/artifacts/Custody.bin index d383e92..2636a68 100644 --- a/pkg/blockchain/evm/artifacts/Custody.bin +++ b/pkg/blockchain/evm/artifacts/Custody.bin @@ -1 +1 @@ -60806040523461039c576113a580380380610019816103a0565b928339810160408282031261039c5781516001600160401b03811161039c5782019181601f8401121561039c578251926001600160401b03841161029a578360051b9260206100698186016103a0565b8096815201916020839582010191821161039c57602001915b81831061037c575050506020015160017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055801561033757808351106102f35760038351106102ae575f5b83518110156101fc576001600160a01b036100e882866103c5565b5116156101b75780610126575b6001906001600160a01b0361010a82876103c5565b51165f528160205260405f208260ff19825416179055016100cd565b6001600160a01b0361013882866103c5565b51165f1982018281116101a3576001600160a01b039061015890876103c5565b5116106100f557606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b815260206004820152601360248201527f5a65726f2061646472657373207369676e6572000000000000000000000000006044820152606490fd5b509151906001600160401b03821161029a5768010000000000000000821161029a576004548260045580831061026f575b5060045f5260205f205f5b8381106102525784600255604051610fb790816103ee8239f35b82516001600160a01b031681830155602090920191600101610238565b60045f52828060205f20019103905f5b82811061028d57505061022d565b5f8282015560010161027f565b634e487b7160e01b5f52604160045260245ffd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b82516001600160a01b038116810361039c57815260209283019201610082565b5f80fd5b6040519190601f01601f191682016001600160401b0381118382101761029a57604052565b80518210156103d95760209160051b010190565b634e487b7160e01b5f52603260045260245ffdfe608080604052600436101561001c575b50361561001a575f80fd5b005b5f3560e01c9081630ce8d62214610a9b575080630e2411ac14610674578063191d0a49146103e057806342cde4e8146103c357806346f0975a1461030e5780637df73e27146102d15780638340f549146100b25763a9fcfb3314610080575f61000f565b346100ae5760203660031901126100ae576004355f525f602052602060ff60405f2054166040519015158152f35b5f80fd5b60603660031901126100ae576100c6610ae6565b6100ce610afc565b604435916100da610dfd565b6001600160a01b031691821561029d576100f5811515610bbe565b6001600160a01b038216806101b8575080340361017e576101557f4174a9435a04d04d274c76779cad136a41fde6937c56241c09ab9d3c7064a1a9915b604080516001600160a01b03909516855260208501919091523393918291820190565b0390a360017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055005b60405162461bcd60e51b815260206004820152601260248201527108aa89040ecc2d8eaca40dad2e6dac2e8c6d60731b6044820152606490fd5b34610258576040516323b872dd60e01b5f5233600452306024528260445260205f60648180865af19060015f5114821615610237575b6040525f6060521561022557506101557f4174a9435a04d04d274c76779cad136a41fde6937c56241c09ab9d3c7064a1a991610132565b635274afe760e01b5f5260045260245ffd5b90600181151661024f57823b15153d151616906101ee565b503d5f823e3d90fd5b60405162461bcd60e51b815260206004820152601b60248201527f4554482073656e742077697468204552433230206465706f73697400000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600c60248201526b16995c9bc81858d8dbdd5b9d60a21b6044820152606490fd5b346100ae5760203660031901126100ae576001600160a01b036102f2610ae6565b165f526001602052602060ff60405f2054166040519015158152f35b346100ae575f3660031901126100ae576040518060206004549283815201809260045f525f516020610f975f395f51905f52905f5b8181106103a45750505081610359910382610b64565b604051918291602083019060208452518091526040830191905f5b818110610382575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610374565b82546001600160a01b0316845260209093019260019283019201610343565b346100ae575f3660031901126100ae576020600254604051908152f35b346100ae5760a03660031901126100ae576103f9610ae6565b610401610afc565b6064359060443560843567ffffffffffffffff81116100ae57610428903690600401610ab5565b9490610432610dfd565b845f525f60205260ff60405f20541661063c576001600160a01b038216958615610606576104af90610465851515610bbe565b604051926020840146815230604086015289606086015260018060a01b038816948560808201528760a08201528960c082015260c081526104a760e082610b64565b519020610c14565b845f525f60205260405f20600160ff1982541617905580155f1461058957505f80808481945af13d15610584573d6104e681610bf8565b906104f46040519283610b64565b81525f60203d92013e5b15610549577fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a21915b604080516001600160a01b03909216825260208201929092529081908101610155565b60405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606490fd5b6104fe565b90505f9291925060405163a9059cbb60e01b5f52856004528360245260205f60448180865af19060015f51148216156105ee575b604052156102255750907fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a2191610526565b90600181151661024f57823b15153d151616906105bd565b60405162461bcd60e51b815260206004820152600e60248201526d16995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e48195e1958dd5d195960821b6044820152606490fd5b346100ae5760603660031901126100ae5760043567ffffffffffffffff81116100ae576106a5903690600401610ab5565b906024359160443567ffffffffffffffff81116100ae576106ca903690600401610ab5565b908415610a5657848310610a1257600383106109cd57610764600192604051602081019061070c816106fe8b8a8c87610b12565b03601f198101835282610b64565b5190209260035493604051602081019146835230604083015260a06060830152600d60c08301526c7570646174655369676e65727360981b60e083015260808201528560a082015260e081526104a761010082610b64565b016003555f5b6004548110156107ac575f516020610f975f395f51905f528101546001600160a01b03165f908152600160208190526040909120805460ff191690550161076a565b50905f5b82811061089d575067ffffffffffffffff82116108895768010000000000000000821161088957816004548160045580821061085b575b50508060045f525f5b83811061083357505061082e837feb4dc7fab86d67670d7a4d7443a38860da1aa053f26529c8f41cc68e5d6a93369460025560405193849384610b12565b0390a1005b600190602061084184610baa565b930192815f516020610f975f395f51905f520155016107f0565b035f5b81811061086d578391506107e7565b5f8482015f516020610f975f395f51905f52015560010161085e565b634e487b7160e01b5f52604160045260245ffd5b6001600160a01b036108b86108b3838686610b86565b610baa565b161561099257806108f8575b6001906001600160a01b036108dd6108b3838787610b86565b165f528160205260405f208260ff19825416179055016107b0565b6109066108b3828585610b86565b5f19820182811161097e576001600160a01b0390610929906108b3908787610b86565b166001600160a01b03909116116108c457606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b81526020600482015260136024820152722d32b9379030b2323932b9b99039b4b3b732b960691b6044820152606490fd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b346100ae575f3660031901126100ae576020906003548152f35b9181601f840112156100ae5782359167ffffffffffffffff83116100ae576020808501948460051b0101116100ae57565b600435906001600160a01b03821682036100ae57565b602435906001600160a01b03821682036100ae57565b6040808252810183905293929160608501905f905b808210610b3957505060209150930152565b909183356001600160a01b03811691908290036100ae57908152602093840193019160010190610b27565b90601f8019910116810190811067ffffffffffffffff82111761088957604052565b9190811015610b965760051b0190565b634e487b7160e01b5f52603260045260245ffd5b356001600160a01b03811681036100ae5790565b15610bc557565b60405162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b67ffffffffffffffff811161088957601f01601f191660200190565b9060025490818410610dc6575f948592835b86881015610d72578760051b840135601e19853603018112156100ae5784019081359167ffffffffffffffff83116100ae57602081019083360382136100ae57610c6f84610bf8565b90610c7d6040519283610b64565b84825260208536920101116100ae575f602085610caf96610ca695838601378301015288610e5b565b90939193610e95565b6001600160a01b038281169116811115610d21575f52600160205260ff60405f20541615610ced57935f19811461097e576001978801970193610c26565b60405162461bcd60e51b815260206004820152600c60248201526b2737ba10309039b4b3b732b960a11b6044820152606490fd5b60405162461bcd60e51b815260206004820152602360248201527f5369676e617475726573206e6f74206f726465726564206f72206475706c696360448201526261746560e81b6064820152608490fd5b509450945050905010610d8157565b60405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742076616c6964207369676e6174757265730000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e10995b1bddc81d1a1c995cda1bdb19608a1b6044820152606490fd5b60027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005414610e4c5760027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b633ee5aeb560e01b5f5260045ffd5b8151919060418303610e8b57610e849250602082015190606060408401519301515f1a90610f09565b9192909190565b50505f9160029190565b6004811015610ef55780610ea7575050565b60018103610ebe5763f645eedf60e01b5f5260045ffd5b60028103610ed9575063fce698f760e01b5f5260045260245ffd5b600314610ee35750565b6335e2f38360e21b5f5260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411610f8b579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15610f80575f516001600160a01b03811615610f7657905f905f90565b505f906001905f90565b6040513d5f823e3d90fd5b5050505f916003919056fe8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b \ No newline at end of file +60806040523461039c5761135c80380380610019816103a0565b928339810160408282031261039c5781516001600160401b03811161039c5782019181601f8401121561039c578251926001600160401b03841161029a578360051b9260206100698186016103a0565b8096815201916020839582010191821161039c57602001915b81831061037c575050506020015160017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055801561033757808351106102f35760038351106102ae575f5b83518110156101fc576001600160a01b036100e882866103c5565b5116156101b75780610126575b6001906001600160a01b0361010a82876103c5565b51165f528160205260405f208260ff19825416179055016100cd565b6001600160a01b0361013882866103c5565b51165f1982018281116101a3576001600160a01b039061015890876103c5565b5116106100f557606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b815260206004820152601360248201527f5a65726f2061646472657373207369676e6572000000000000000000000000006044820152606490fd5b509151906001600160401b03821161029a5768010000000000000000821161029a576004548260045580831061026f575b5060045f5260205f205f5b8381106102525784600255604051610f6e90816103ee8239f35b82516001600160a01b031681830155602090920191600101610238565b60045f52828060205f20019103905f5b82811061028d57505061022d565b5f8282015560010161027f565b634e487b7160e01b5f52604160045260245ffd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b82516001600160a01b038116810361039c57815260209283019201610082565b5f80fd5b6040519190601f01601f191682016001600160401b0381118382101761029a57604052565b80518210156103d95760209160051b010190565b634e487b7160e01b5f52603260045260245ffdfe608080604052600436101561001c575b50361561001a575f80fd5b005b5f3560e01c9081630ce8d62214610a58575080630e2411ac14610631578063191d0a491461038f57806342cde4e81461037257806346f0975a146102bd5780637df73e2714610280578063a9fcfb33146102525763c98444f714610080575f61000f565b608036600319011261024e57610094610aa3565b61009c610ab9565b604435916100a8610dba565b6001600160a01b031690811561021a576100c3831515610b7b565b6001600160a01b0316918261016057803403610126575b60405192338452602084015260408301527f29856f6638b9b9b8d4e50e7b837b6bfad87b2ce76577304d1b178e02d6d9eb02606060643593a360015f516020610f4e5f395f51905f5255005b60405162461bcd60e51b815260206004820152601260248201527108aa89040ecc2d8eaca40dad2e6dac2e8c6d60731b6044820152606490fd5b346101d5576040516323b872dd60e01b5f5233600452306024528160445260205f60648180885af19060015f51148216156101b4575b6040525f6060526100da5782635274afe760e01b5f5260045260245ffd5b9060018115166101cc57843b15153d15161690610196565b503d5f823e3d90fd5b60405162461bcd60e51b815260206004820152601b60248201527f4554482073656e742077697468204552433230206465706f73697400000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600c60248201526b16995c9bc81858d8dbdd5b9d60a21b6044820152606490fd5b5f80fd5b3461024e57602036600319011261024e576004355f525f602052602060ff60405f2054166040519015158152f35b3461024e57602036600319011261024e576001600160a01b036102a1610aa3565b165f526001602052602060ff60405f2054166040519015158152f35b3461024e575f36600319011261024e576040518060206004549283815201809260045f525f516020610f2e5f395f51905f52905f5b8181106103535750505081610308910382610b21565b604051918291602083019060208452518091526040830191905f5b818110610331575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610323565b82546001600160a01b03168452602090930192600192830192016102f2565b3461024e575f36600319011261024e576020600254604051908152f35b3461024e5760a036600319011261024e576103a8610aa3565b6103b0610ab9565b6064359060443560843567ffffffffffffffff811161024e576103d7903690600401610a72565b90946103e1610dba565b845f525f60205260ff60405f2054166105f9576001600160a01b0381169586156105c357839261046091610416851515610b7b565b6040519660208801904682523060408a01528a60608a015260018060a01b0316978860808201528660a08201528960c082015260c0815261045860e082610b21565b519020610bd1565b845f525f60205260405f20600160ff1982541617905583155f14610537575f80809381935af13d15610532573d61049681610bb5565b906104a46040519283610b21565b81525f60203d92013e5b156104f7577fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a21916040915b82519182526020820152a360015f516020610f4e5f395f51905f5255005b60405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606490fd5b6104ae565b505060405163a9059cbb60e01b5f52846004528160245260205f60448180875af19060015f51148216156105ab575b60405215610598577fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a21916040916104d9565b50635274afe760e01b5f5260045260245ffd5b9060018115166101cc57833b15153d15161690610566565b60405162461bcd60e51b815260206004820152600e60248201526d16995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e48195e1958dd5d195960821b6044820152606490fd5b3461024e57606036600319011261024e5760043567ffffffffffffffff811161024e57610662903690600401610a72565b906024359160443567ffffffffffffffff811161024e57610687903690600401610a72565b908415610a13578483106109cf576003831061098a5761072160019260405160208101906106c9816106bb8b8a8c87610acf565b03601f198101835282610b21565b5190209260035493604051602081019146835230604083015260a06060830152600d60c08301526c7570646174655369676e65727360981b60e083015260808201528560a082015260e0815261045861010082610b21565b016003555f5b600454811015610769575f516020610f2e5f395f51905f528101546001600160a01b03165f908152600160208190526040909120805460ff1916905501610727565b50905f5b82811061085a575067ffffffffffffffff821161084657680100000000000000008211610846578160045481600455808210610818575b50508060045f525f5b8381106107f05750506107eb837feb4dc7fab86d67670d7a4d7443a38860da1aa053f26529c8f41cc68e5d6a93369460025560405193849384610acf565b0390a1005b60019060206107fe84610b67565b930192815f516020610f2e5f395f51905f520155016107ad565b035f5b81811061082a578391506107a4565b5f8482015f516020610f2e5f395f51905f52015560010161081b565b634e487b7160e01b5f52604160045260245ffd5b6001600160a01b03610875610870838686610b43565b610b67565b161561094f57806108b5575b6001906001600160a01b0361089a610870838787610b43565b165f528160205260405f208260ff198254161790550161076d565b6108c3610870828585610b43565b5f19820182811161093b576001600160a01b03906108e690610870908787610b43565b166001600160a01b039091161161088157606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b81526020600482015260136024820152722d32b9379030b2323932b9b99039b4b3b732b960691b6044820152606490fd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b3461024e575f36600319011261024e576020906003548152f35b9181601f8401121561024e5782359167ffffffffffffffff831161024e576020808501948460051b01011161024e57565b600435906001600160a01b038216820361024e57565b602435906001600160a01b038216820361024e57565b6040808252810183905293929160608501905f905b808210610af657505060209150930152565b909183356001600160a01b038116919082900361024e57908152602093840193019160010190610ae4565b90601f8019910116810190811067ffffffffffffffff82111761084657604052565b9190811015610b535760051b0190565b634e487b7160e01b5f52603260045260245ffd5b356001600160a01b038116810361024e5790565b15610b8257565b60405162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b67ffffffffffffffff811161084657601f01601f191660200190565b9060025490818410610d83575f948592835b86881015610d2f578760051b840135601e198536030181121561024e5784019081359167ffffffffffffffff831161024e576020810190833603821361024e57610c2c84610bb5565b90610c3a6040519283610b21565b848252602085369201011161024e575f602085610c6c96610c6395838601378301015288610df2565b90939193610e2c565b6001600160a01b038281169116811115610cde575f52600160205260ff60405f20541615610caa57935f19811461093b576001978801970193610be3565b60405162461bcd60e51b815260206004820152600c60248201526b2737ba10309039b4b3b732b960a11b6044820152606490fd5b60405162461bcd60e51b815260206004820152602360248201527f5369676e617475726573206e6f74206f726465726564206f72206475706c696360448201526261746560e81b6064820152608490fd5b509450945050905010610d3e57565b60405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742076616c6964207369676e6174757265730000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e10995b1bddc81d1a1c995cda1bdb19608a1b6044820152606490fd5b60025f516020610f4e5f395f51905f525414610de35760025f516020610f4e5f395f51905f5255565b633ee5aeb560e01b5f5260045ffd5b8151919060418303610e2257610e1b9250602082015190606060408401519301515f1a90610ea0565b9192909190565b50505f9160029190565b6004811015610e8c5780610e3e575050565b60018103610e555763f645eedf60e01b5f5260045ffd5b60028103610e70575063fce698f760e01b5f5260045260245ffd5b600314610e7a5750565b6335e2f38360e21b5f5260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411610f22579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15610f17575f516001600160a01b03811615610f0d57905f905f90565b505f906001905f90565b6040513d5f823e3d90fd5b5050505f916003919056fe8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00 \ No newline at end of file diff --git a/pkg/blockchain/evm/custody_abi.go b/pkg/blockchain/evm/custody_abi.go index 53285f6..79f6589 100644 --- a/pkg/blockchain/evm/custody_abi.go +++ b/pkg/blockchain/evm/custody_abi.go @@ -31,8 +31,8 @@ var ( // CustodyMetaData contains all meta data concerning the Custody contract. var CustodyMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"initialSigners\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"initialThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"execute\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"withdrawalId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signatures\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"executed\",\"inputs\":[{\"name\":\"withdrawalId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isSigner\",\"inputs\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"signerNonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"signers\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"threshold\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateSigners\",\"inputs\":[{\"name\":\"newSigners\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"newThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"signatures\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Deposited\",\"inputs\":[{\"name\":\"depositor\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Executed\",\"inputs\":[{\"name\":\"withdrawalId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignersUpdated\",\"inputs\":[{\"name\":\"newSigners\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"newThreshold\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureS\",\"inputs\":[{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x60806040523461039c576113a580380380610019816103a0565b928339810160408282031261039c5781516001600160401b03811161039c5782019181601f8401121561039c578251926001600160401b03841161029a578360051b9260206100698186016103a0565b8096815201916020839582010191821161039c57602001915b81831061037c575050506020015160017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055801561033757808351106102f35760038351106102ae575f5b83518110156101fc576001600160a01b036100e882866103c5565b5116156101b75780610126575b6001906001600160a01b0361010a82876103c5565b51165f528160205260405f208260ff19825416179055016100cd565b6001600160a01b0361013882866103c5565b51165f1982018281116101a3576001600160a01b039061015890876103c5565b5116106100f557606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b815260206004820152601360248201527f5a65726f2061646472657373207369676e6572000000000000000000000000006044820152606490fd5b509151906001600160401b03821161029a5768010000000000000000821161029a576004548260045580831061026f575b5060045f5260205f205f5b8381106102525784600255604051610fb790816103ee8239f35b82516001600160a01b031681830155602090920191600101610238565b60045f52828060205f20019103905f5b82811061028d57505061022d565b5f8282015560010161027f565b634e487b7160e01b5f52604160045260245ffd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b82516001600160a01b038116810361039c57815260209283019201610082565b5f80fd5b6040519190601f01601f191682016001600160401b0381118382101761029a57604052565b80518210156103d95760209160051b010190565b634e487b7160e01b5f52603260045260245ffdfe608080604052600436101561001c575b50361561001a575f80fd5b005b5f3560e01c9081630ce8d62214610a9b575080630e2411ac14610674578063191d0a49146103e057806342cde4e8146103c357806346f0975a1461030e5780637df73e27146102d15780638340f549146100b25763a9fcfb3314610080575f61000f565b346100ae5760203660031901126100ae576004355f525f602052602060ff60405f2054166040519015158152f35b5f80fd5b60603660031901126100ae576100c6610ae6565b6100ce610afc565b604435916100da610dfd565b6001600160a01b031691821561029d576100f5811515610bbe565b6001600160a01b038216806101b8575080340361017e576101557f4174a9435a04d04d274c76779cad136a41fde6937c56241c09ab9d3c7064a1a9915b604080516001600160a01b03909516855260208501919091523393918291820190565b0390a360017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055005b60405162461bcd60e51b815260206004820152601260248201527108aa89040ecc2d8eaca40dad2e6dac2e8c6d60731b6044820152606490fd5b34610258576040516323b872dd60e01b5f5233600452306024528260445260205f60648180865af19060015f5114821615610237575b6040525f6060521561022557506101557f4174a9435a04d04d274c76779cad136a41fde6937c56241c09ab9d3c7064a1a991610132565b635274afe760e01b5f5260045260245ffd5b90600181151661024f57823b15153d151616906101ee565b503d5f823e3d90fd5b60405162461bcd60e51b815260206004820152601b60248201527f4554482073656e742077697468204552433230206465706f73697400000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600c60248201526b16995c9bc81858d8dbdd5b9d60a21b6044820152606490fd5b346100ae5760203660031901126100ae576001600160a01b036102f2610ae6565b165f526001602052602060ff60405f2054166040519015158152f35b346100ae575f3660031901126100ae576040518060206004549283815201809260045f525f516020610f975f395f51905f52905f5b8181106103a45750505081610359910382610b64565b604051918291602083019060208452518091526040830191905f5b818110610382575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610374565b82546001600160a01b0316845260209093019260019283019201610343565b346100ae575f3660031901126100ae576020600254604051908152f35b346100ae5760a03660031901126100ae576103f9610ae6565b610401610afc565b6064359060443560843567ffffffffffffffff81116100ae57610428903690600401610ab5565b9490610432610dfd565b845f525f60205260ff60405f20541661063c576001600160a01b038216958615610606576104af90610465851515610bbe565b604051926020840146815230604086015289606086015260018060a01b038816948560808201528760a08201528960c082015260c081526104a760e082610b64565b519020610c14565b845f525f60205260405f20600160ff1982541617905580155f1461058957505f80808481945af13d15610584573d6104e681610bf8565b906104f46040519283610b64565b81525f60203d92013e5b15610549577fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a21915b604080516001600160a01b03909216825260208201929092529081908101610155565b60405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606490fd5b6104fe565b90505f9291925060405163a9059cbb60e01b5f52856004528360245260205f60448180865af19060015f51148216156105ee575b604052156102255750907fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a2191610526565b90600181151661024f57823b15153d151616906105bd565b60405162461bcd60e51b815260206004820152600e60248201526d16995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e48195e1958dd5d195960821b6044820152606490fd5b346100ae5760603660031901126100ae5760043567ffffffffffffffff81116100ae576106a5903690600401610ab5565b906024359160443567ffffffffffffffff81116100ae576106ca903690600401610ab5565b908415610a5657848310610a1257600383106109cd57610764600192604051602081019061070c816106fe8b8a8c87610b12565b03601f198101835282610b64565b5190209260035493604051602081019146835230604083015260a06060830152600d60c08301526c7570646174655369676e65727360981b60e083015260808201528560a082015260e081526104a761010082610b64565b016003555f5b6004548110156107ac575f516020610f975f395f51905f528101546001600160a01b03165f908152600160208190526040909120805460ff191690550161076a565b50905f5b82811061089d575067ffffffffffffffff82116108895768010000000000000000821161088957816004548160045580821061085b575b50508060045f525f5b83811061083357505061082e837feb4dc7fab86d67670d7a4d7443a38860da1aa053f26529c8f41cc68e5d6a93369460025560405193849384610b12565b0390a1005b600190602061084184610baa565b930192815f516020610f975f395f51905f520155016107f0565b035f5b81811061086d578391506107e7565b5f8482015f516020610f975f395f51905f52015560010161085e565b634e487b7160e01b5f52604160045260245ffd5b6001600160a01b036108b86108b3838686610b86565b610baa565b161561099257806108f8575b6001906001600160a01b036108dd6108b3838787610b86565b165f528160205260405f208260ff19825416179055016107b0565b6109066108b3828585610b86565b5f19820182811161097e576001600160a01b0390610929906108b3908787610b86565b166001600160a01b03909116116108c457606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b81526020600482015260136024820152722d32b9379030b2323932b9b99039b4b3b732b960691b6044820152606490fd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b346100ae575f3660031901126100ae576020906003548152f35b9181601f840112156100ae5782359167ffffffffffffffff83116100ae576020808501948460051b0101116100ae57565b600435906001600160a01b03821682036100ae57565b602435906001600160a01b03821682036100ae57565b6040808252810183905293929160608501905f905b808210610b3957505060209150930152565b909183356001600160a01b03811691908290036100ae57908152602093840193019160010190610b27565b90601f8019910116810190811067ffffffffffffffff82111761088957604052565b9190811015610b965760051b0190565b634e487b7160e01b5f52603260045260245ffd5b356001600160a01b03811681036100ae5790565b15610bc557565b60405162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b67ffffffffffffffff811161088957601f01601f191660200190565b9060025490818410610dc6575f948592835b86881015610d72578760051b840135601e19853603018112156100ae5784019081359167ffffffffffffffff83116100ae57602081019083360382136100ae57610c6f84610bf8565b90610c7d6040519283610b64565b84825260208536920101116100ae575f602085610caf96610ca695838601378301015288610e5b565b90939193610e95565b6001600160a01b038281169116811115610d21575f52600160205260ff60405f20541615610ced57935f19811461097e576001978801970193610c26565b60405162461bcd60e51b815260206004820152600c60248201526b2737ba10309039b4b3b732b960a11b6044820152606490fd5b60405162461bcd60e51b815260206004820152602360248201527f5369676e617475726573206e6f74206f726465726564206f72206475706c696360448201526261746560e81b6064820152608490fd5b509450945050905010610d8157565b60405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742076616c6964207369676e6174757265730000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e10995b1bddc81d1a1c995cda1bdb19608a1b6044820152606490fd5b60027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005414610e4c5760027f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b633ee5aeb560e01b5f5260045ffd5b8151919060418303610e8b57610e849250602082015190606060408401519301515f1a90610f09565b9192909190565b50505f9160029190565b6004811015610ef55780610ea7575050565b60018103610ebe5763f645eedf60e01b5f5260045ffd5b60028103610ed9575063fce698f760e01b5f5260045260245ffd5b600314610ee35750565b6335e2f38360e21b5f5260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411610f8b579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15610f80575f516001600160a01b03811615610f7657905f905f90565b505f906001905f90565b6040513d5f823e3d90fd5b5050505f916003919056fe8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"initialSigners\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"initialThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"depositReference\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"execute\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"withdrawalId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signatures\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"executed\",\"inputs\":[{\"name\":\"withdrawalId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isSigner\",\"inputs\":[{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"signerNonce\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"signers\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address[]\",\"internalType\":\"address[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"threshold\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateSigners\",\"inputs\":[{\"name\":\"newSigners\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"newThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"signatures\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"Deposited\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"depositReference\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"depositor\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Executed\",\"inputs\":[{\"name\":\"withdrawalId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"asset\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SignersUpdated\",\"inputs\":[{\"name\":\"newSigners\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"newThreshold\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ECDSAInvalidSignatureS\",\"inputs\":[{\"name\":\"s\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + Bin: "0x60806040523461039c5761135c80380380610019816103a0565b928339810160408282031261039c5781516001600160401b03811161039c5782019181601f8401121561039c578251926001600160401b03841161029a578360051b9260206100698186016103a0565b8096815201916020839582010191821161039c57602001915b81831061037c575050506020015160017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055801561033757808351106102f35760038351106102ae575f5b83518110156101fc576001600160a01b036100e882866103c5565b5116156101b75780610126575b6001906001600160a01b0361010a82876103c5565b51165f528160205260405f208260ff19825416179055016100cd565b6001600160a01b0361013882866103c5565b51165f1982018281116101a3576001600160a01b039061015890876103c5565b5116106100f557606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b815260206004820152601360248201527f5a65726f2061646472657373207369676e6572000000000000000000000000006044820152606490fd5b509151906001600160401b03821161029a5768010000000000000000821161029a576004548260045580831061026f575b5060045f5260205f205f5b8381106102525784600255604051610f6e90816103ee8239f35b82516001600160a01b031681830155602090920191600101610238565b60045f52828060205f20019103905f5b82811061028d57505061022d565b5f8282015560010161027f565b634e487b7160e01b5f52604160045260245ffd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b82516001600160a01b038116810361039c57815260209283019201610082565b5f80fd5b6040519190601f01601f191682016001600160401b0381118382101761029a57604052565b80518210156103d95760209160051b010190565b634e487b7160e01b5f52603260045260245ffdfe608080604052600436101561001c575b50361561001a575f80fd5b005b5f3560e01c9081630ce8d62214610a58575080630e2411ac14610631578063191d0a491461038f57806342cde4e81461037257806346f0975a146102bd5780637df73e2714610280578063a9fcfb33146102525763c98444f714610080575f61000f565b608036600319011261024e57610094610aa3565b61009c610ab9565b604435916100a8610dba565b6001600160a01b031690811561021a576100c3831515610b7b565b6001600160a01b0316918261016057803403610126575b60405192338452602084015260408301527f29856f6638b9b9b8d4e50e7b837b6bfad87b2ce76577304d1b178e02d6d9eb02606060643593a360015f516020610f4e5f395f51905f5255005b60405162461bcd60e51b815260206004820152601260248201527108aa89040ecc2d8eaca40dad2e6dac2e8c6d60731b6044820152606490fd5b346101d5576040516323b872dd60e01b5f5233600452306024528160445260205f60648180885af19060015f51148216156101b4575b6040525f6060526100da5782635274afe760e01b5f5260045260245ffd5b9060018115166101cc57843b15153d15161690610196565b503d5f823e3d90fd5b60405162461bcd60e51b815260206004820152601b60248201527f4554482073656e742077697468204552433230206465706f73697400000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600c60248201526b16995c9bc81858d8dbdd5b9d60a21b6044820152606490fd5b5f80fd5b3461024e57602036600319011261024e576004355f525f602052602060ff60405f2054166040519015158152f35b3461024e57602036600319011261024e576001600160a01b036102a1610aa3565b165f526001602052602060ff60405f2054166040519015158152f35b3461024e575f36600319011261024e576040518060206004549283815201809260045f525f516020610f2e5f395f51905f52905f5b8181106103535750505081610308910382610b21565b604051918291602083019060208452518091526040830191905f5b818110610331575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610323565b82546001600160a01b03168452602090930192600192830192016102f2565b3461024e575f36600319011261024e576020600254604051908152f35b3461024e5760a036600319011261024e576103a8610aa3565b6103b0610ab9565b6064359060443560843567ffffffffffffffff811161024e576103d7903690600401610a72565b90946103e1610dba565b845f525f60205260ff60405f2054166105f9576001600160a01b0381169586156105c357839261046091610416851515610b7b565b6040519660208801904682523060408a01528a60608a015260018060a01b0316978860808201528660a08201528960c082015260c0815261045860e082610b21565b519020610bd1565b845f525f60205260405f20600160ff1982541617905583155f14610537575f80809381935af13d15610532573d61049681610bb5565b906104a46040519283610b21565b81525f60203d92013e5b156104f7577fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a21916040915b82519182526020820152a360015f516020610f4e5f395f51905f5255005b60405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606490fd5b6104ae565b505060405163a9059cbb60e01b5f52846004528160245260205f60448180875af19060015f51148216156105ab575b60405215610598577fe57dd573634102b6cae74aab341f709f6fc3ae2bdc0a35f9a47a85f45b677a21916040916104d9565b50635274afe760e01b5f5260045260245ffd5b9060018115166101cc57833b15153d15161690610566565b60405162461bcd60e51b815260206004820152600e60248201526d16995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e48195e1958dd5d195960821b6044820152606490fd5b3461024e57606036600319011261024e5760043567ffffffffffffffff811161024e57610662903690600401610a72565b906024359160443567ffffffffffffffff811161024e57610687903690600401610a72565b908415610a13578483106109cf576003831061098a5761072160019260405160208101906106c9816106bb8b8a8c87610acf565b03601f198101835282610b21565b5190209260035493604051602081019146835230604083015260a06060830152600d60c08301526c7570646174655369676e65727360981b60e083015260808201528560a082015260e0815261045861010082610b21565b016003555f5b600454811015610769575f516020610f2e5f395f51905f528101546001600160a01b03165f908152600160208190526040909120805460ff1916905501610727565b50905f5b82811061085a575067ffffffffffffffff821161084657680100000000000000008211610846578160045481600455808210610818575b50508060045f525f5b8381106107f05750506107eb837feb4dc7fab86d67670d7a4d7443a38860da1aa053f26529c8f41cc68e5d6a93369460025560405193849384610acf565b0390a1005b60019060206107fe84610b67565b930192815f516020610f2e5f395f51905f520155016107ad565b035f5b81811061082a578391506107a4565b5f8482015f516020610f2e5f395f51905f52015560010161081b565b634e487b7160e01b5f52604160045260245ffd5b6001600160a01b03610875610870838686610b43565b610b67565b161561094f57806108b5575b6001906001600160a01b0361089a610870838787610b43565b165f528160205260405f208260ff198254161790550161076d565b6108c3610870828585610b43565b5f19820182811161093b576001600160a01b03906108e690610870908787610b43565b166001600160a01b039091161161088157606460405162461bcd60e51b815260206004820152602060248201527f5369676e657273206d75737420626520736f7274656420617363656e64696e676044820152fd5b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b81526020600482015260136024820152722d32b9379030b2323932b9b99039b4b3b732b960691b6044820152606490fd5b60405162461bcd60e51b815260206004820152601760248201527f4e656564206174206c656173742033207369676e6572730000000000000000006044820152606490fd5b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f756768207369676e65727320666f72207468726573686f6c646044820152fd5b60405162461bcd60e51b815260206004820152601a60248201527f5468726573686f6c64206d75737420626520706f7369746976650000000000006044820152606490fd5b3461024e575f36600319011261024e576020906003548152f35b9181601f8401121561024e5782359167ffffffffffffffff831161024e576020808501948460051b01011161024e57565b600435906001600160a01b038216820361024e57565b602435906001600160a01b038216820361024e57565b6040808252810183905293929160608501905f905b808210610af657505060209150930152565b909183356001600160a01b038116919082900361024e57908152602093840193019160010190610ae4565b90601f8019910116810190811067ffffffffffffffff82111761084657604052565b9190811015610b535760051b0190565b634e487b7160e01b5f52603260045260245ffd5b356001600160a01b038116810361024e5790565b15610b8257565b60405162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b6044820152606490fd5b67ffffffffffffffff811161084657601f01601f191660200190565b9060025490818410610d83575f948592835b86881015610d2f578760051b840135601e198536030181121561024e5784019081359167ffffffffffffffff831161024e576020810190833603821361024e57610c2c84610bb5565b90610c3a6040519283610b21565b848252602085369201011161024e575f602085610c6c96610c6395838601378301015288610df2565b90939193610e2c565b6001600160a01b038281169116811115610cde575f52600160205260ff60405f20541615610caa57935f19811461093b576001978801970193610be3565b60405162461bcd60e51b815260206004820152600c60248201526b2737ba10309039b4b3b732b960a11b6044820152606490fd5b60405162461bcd60e51b815260206004820152602360248201527f5369676e617475726573206e6f74206f726465726564206f72206475706c696360448201526261746560e81b6064820152608490fd5b509450945050905010610d3e57565b60405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e742076616c6964207369676e6174757265730000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e10995b1bddc81d1a1c995cda1bdb19608a1b6044820152606490fd5b60025f516020610f4e5f395f51905f525414610de35760025f516020610f4e5f395f51905f5255565b633ee5aeb560e01b5f5260045ffd5b8151919060418303610e2257610e1b9250602082015190606060408401519301515f1a90610ea0565b9192909190565b50505f9160029190565b6004811015610e8c5780610e3e575050565b60018103610e555763f645eedf60e01b5f5260045ffd5b60028103610e70575063fce698f760e01b5f5260045260245ffd5b600314610e7a5750565b6335e2f38360e21b5f5260045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411610f22579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15610f17575f516001600160a01b03811615610f0d57905f905f90565b505f906001905f90565b6040513d5f823e3d90fd5b5050505f916003919056fe8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00", } // CustodyABI is the input ABI used to generate the binding from. @@ -357,25 +357,25 @@ func (_Custody *CustodyCallerSession) Threshold() (*big.Int, error) { return _Custody.Contract.Threshold(&_Custody.CallOpts) } -// Deposit is a paid mutator transaction binding the contract method 0x8340f549. +// Deposit is a paid mutator transaction binding the contract method 0xc98444f7. // -// Solidity: function deposit(address account, address asset, uint256 amount) payable returns() -func (_Custody *CustodyTransactor) Deposit(opts *bind.TransactOpts, account common.Address, asset common.Address, amount *big.Int) (*types.Transaction, error) { - return _Custody.contract.Transact(opts, "deposit", account, asset, amount) +// Solidity: function deposit(address account, address asset, uint256 amount, bytes32 depositReference) payable returns() +func (_Custody *CustodyTransactor) Deposit(opts *bind.TransactOpts, account common.Address, asset common.Address, amount *big.Int, depositReference [32]byte) (*types.Transaction, error) { + return _Custody.contract.Transact(opts, "deposit", account, asset, amount, depositReference) } -// Deposit is a paid mutator transaction binding the contract method 0x8340f549. +// Deposit is a paid mutator transaction binding the contract method 0xc98444f7. // -// Solidity: function deposit(address account, address asset, uint256 amount) payable returns() -func (_Custody *CustodySession) Deposit(account common.Address, asset common.Address, amount *big.Int) (*types.Transaction, error) { - return _Custody.Contract.Deposit(&_Custody.TransactOpts, account, asset, amount) +// Solidity: function deposit(address account, address asset, uint256 amount, bytes32 depositReference) payable returns() +func (_Custody *CustodySession) Deposit(account common.Address, asset common.Address, amount *big.Int, depositReference [32]byte) (*types.Transaction, error) { + return _Custody.Contract.Deposit(&_Custody.TransactOpts, account, asset, amount, depositReference) } -// Deposit is a paid mutator transaction binding the contract method 0x8340f549. +// Deposit is a paid mutator transaction binding the contract method 0xc98444f7. // -// Solidity: function deposit(address account, address asset, uint256 amount) payable returns() -func (_Custody *CustodyTransactorSession) Deposit(account common.Address, asset common.Address, amount *big.Int) (*types.Transaction, error) { - return _Custody.Contract.Deposit(&_Custody.TransactOpts, account, asset, amount) +// Solidity: function deposit(address account, address asset, uint256 amount, bytes32 depositReference) payable returns() +func (_Custody *CustodyTransactorSession) Deposit(account common.Address, asset common.Address, amount *big.Int, depositReference [32]byte) (*types.Transaction, error) { + return _Custody.Contract.Deposit(&_Custody.TransactOpts, account, asset, amount, depositReference) } // Execute is a paid mutator transaction binding the contract method 0x191d0a49. @@ -510,49 +510,50 @@ func (it *CustodyDepositedIterator) Close() error { // CustodyDeposited represents a Deposited event raised by the Custody contract. type CustodyDeposited struct { - Depositor common.Address - Account common.Address - Asset common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos + Account common.Address + DepositReference [32]byte + Depositor common.Address + Asset common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos } -// FilterDeposited is a free log retrieval operation binding the contract event 0x4174a9435a04d04d274c76779cad136a41fde6937c56241c09ab9d3c7064a1a9. +// FilterDeposited is a free log retrieval operation binding the contract event 0x29856f6638b9b9b8d4e50e7b837b6bfad87b2ce76577304d1b178e02d6d9eb02. // -// Solidity: event Deposited(address indexed depositor, address indexed account, address asset, uint256 amount) -func (_Custody *CustodyFilterer) FilterDeposited(opts *bind.FilterOpts, depositor []common.Address, account []common.Address) (*CustodyDepositedIterator, error) { +// Solidity: event Deposited(address indexed account, bytes32 indexed depositReference, address depositor, address asset, uint256 amount) +func (_Custody *CustodyFilterer) FilterDeposited(opts *bind.FilterOpts, account []common.Address, depositReference [][32]byte) (*CustodyDepositedIterator, error) { - var depositorRule []interface{} - for _, depositorItem := range depositor { - depositorRule = append(depositorRule, depositorItem) - } var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } + var depositReferenceRule []interface{} + for _, depositReferenceItem := range depositReference { + depositReferenceRule = append(depositReferenceRule, depositReferenceItem) + } - logs, sub, err := _Custody.contract.FilterLogs(opts, "Deposited", depositorRule, accountRule) + logs, sub, err := _Custody.contract.FilterLogs(opts, "Deposited", accountRule, depositReferenceRule) if err != nil { return nil, err } return &CustodyDepositedIterator{contract: _Custody.contract, event: "Deposited", logs: logs, sub: sub}, nil } -// WatchDeposited is a free log subscription operation binding the contract event 0x4174a9435a04d04d274c76779cad136a41fde6937c56241c09ab9d3c7064a1a9. +// WatchDeposited is a free log subscription operation binding the contract event 0x29856f6638b9b9b8d4e50e7b837b6bfad87b2ce76577304d1b178e02d6d9eb02. // -// Solidity: event Deposited(address indexed depositor, address indexed account, address asset, uint256 amount) -func (_Custody *CustodyFilterer) WatchDeposited(opts *bind.WatchOpts, sink chan<- *CustodyDeposited, depositor []common.Address, account []common.Address) (event.Subscription, error) { +// Solidity: event Deposited(address indexed account, bytes32 indexed depositReference, address depositor, address asset, uint256 amount) +func (_Custody *CustodyFilterer) WatchDeposited(opts *bind.WatchOpts, sink chan<- *CustodyDeposited, account []common.Address, depositReference [][32]byte) (event.Subscription, error) { - var depositorRule []interface{} - for _, depositorItem := range depositor { - depositorRule = append(depositorRule, depositorItem) - } var accountRule []interface{} for _, accountItem := range account { accountRule = append(accountRule, accountItem) } + var depositReferenceRule []interface{} + for _, depositReferenceItem := range depositReference { + depositReferenceRule = append(depositReferenceRule, depositReferenceItem) + } - logs, sub, err := _Custody.contract.WatchLogs(opts, "Deposited", depositorRule, accountRule) + logs, sub, err := _Custody.contract.WatchLogs(opts, "Deposited", accountRule, depositReferenceRule) if err != nil { return nil, err } @@ -584,9 +585,9 @@ func (_Custody *CustodyFilterer) WatchDeposited(opts *bind.WatchOpts, sink chan< }), nil } -// ParseDeposited is a log parse operation binding the contract event 0x4174a9435a04d04d274c76779cad136a41fde6937c56241c09ab9d3c7064a1a9. +// ParseDeposited is a log parse operation binding the contract event 0x29856f6638b9b9b8d4e50e7b837b6bfad87b2ce76577304d1b178e02d6d9eb02. // -// Solidity: event Deposited(address indexed depositor, address indexed account, address asset, uint256 amount) +// Solidity: event Deposited(address indexed account, bytes32 indexed depositReference, address depositor, address asset, uint256 amount) func (_Custody *CustodyFilterer) ParseDeposited(log types.Log) (*CustodyDeposited, error) { event := new(CustodyDeposited) if err := _Custody.contract.UnpackLog(event, "Deposited", log); err != nil { diff --git a/pkg/blockchain/evm/depositor.go b/pkg/blockchain/evm/depositor.go index eef2cdb..3b4bb75 100644 --- a/pkg/blockchain/evm/depositor.go +++ b/pkg/blockchain/evm/depositor.go @@ -54,7 +54,9 @@ func (d *Depositor) SubmitDeposit(ctx context.Context, asset string, amount deci return core.TxRef{}, err } opts.Value = amt - tx, err := d.custody.Deposit(opts, accountAddr, common.Address{}, amt) + // Zero depositReference: this depositor models no sub-account; the + // reference is opaque, log-only, and bytes32(0) means "none" (ADR-015). + tx, err := d.custody.Deposit(opts, accountAddr, common.Address{}, amt, [32]byte{}) if err != nil { return core.TxRef{}, fmt.Errorf("ETH deposit: %w", err) } @@ -85,7 +87,7 @@ func (d *Depositor) SubmitDeposit(ctx context.Context, asset string, amount deci if err != nil { return core.TxRef{}, err } - tx, err := d.custody.Deposit(depositOpts, accountAddr, assetAddr, amt) + tx, err := d.custody.Deposit(depositOpts, accountAddr, assetAddr, amt, [32]byte{}) if err != nil { return core.TxRef{}, fmt.Errorf("ERC20 deposit: %w", err) }