Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ require (
github.com/spf13/cobra v1.9.1
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
github.com/trufnetwork/kwil-db v0.10.3-0.20260112162448-e97ebc066644
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260112162448-e97ebc066644
github.com/trufnetwork/kwil-db v0.10.3-0.20260114101438-086d08546643
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114101438-086d08546643
github.com/trufnetwork/sdk-go v0.3.2-0.20250630062504-841b40cdb709
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa
Expand Down
24 changes: 24 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,18 @@ github.com/trufnetwork/kwil-db v0.10.3-0.20260109051031-0955c8d87ef6 h1:BNp/U5Qo
github.com/trufnetwork/kwil-db v0.10.3-0.20260109051031-0955c8d87ef6/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db v0.10.3-0.20260112162448-e97ebc066644 h1:o770AGCcrK4nQkq2yd0eaCE+i9dH4wge8CVEMdUSXRY=
github.com/trufnetwork/kwil-db v0.10.3-0.20260112162448-e97ebc066644/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114061745-6f2d6a245e79 h1:vh+RQ+1Z1Wai2M9VqslDhP6xBw/elFCMpzOB07dBGJE=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114061745-6f2d6a245e79/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114072646-4f26c74d04c3 h1:CTXVexWAy6KRNIxAHrOsRi6NMVd74Yf9dkV2+l71CzI=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114072646-4f26c74d04c3/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114074016-7106bfec0cab h1:Ph3JdcFNUUnTSbX8NHkYa6c4ou/Ss8S/6as57Zn9ePc=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114074016-7106bfec0cab/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114075133-7d07e0d4298f h1:8DrJFQRqB+L0IFc1VKrcoFgBYvgLEsbwKepvenNQWsY=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114075133-7d07e0d4298f/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114095122-23536ba811db h1:9YVfKYXDimJPbNDq8kxzSkij2H0kE3s2ilCErrBDJoY=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114095122-23536ba811db/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114101438-086d08546643 h1:VCoPld2HSQPbTBoVsj/fLH19a9bJ7Re5OgJL8NVwTgU=
github.com/trufnetwork/kwil-db v0.10.3-0.20260114101438-086d08546643/go.mod h1:LiBAC48uZl2B0IiLtD2hpOce7RNfpuDdghVAOc3u1Qo=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260107154136-b8af58932e24 h1:5RcJ0Cyt9UaXwv71d9jYgwGL2zwyTJdP9m4wkk6B6Z8=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260107154136-b8af58932e24/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260108132315-b1fcfb33a848 h1:/0naLqfmAqfL5XWdN1yulk5auImOP14Taw0B1baq3GU=
Expand All @@ -1244,6 +1256,18 @@ github.com/trufnetwork/kwil-db/core v0.4.3-0.20260109051031-0955c8d87ef6 h1:SF9d
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260109051031-0955c8d87ef6/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260112162448-e97ebc066644 h1:3CX0z9BFxSsJhRBJ7zf7HXKH7K19pLYO7AtM674TGms=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260112162448-e97ebc066644/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114061745-6f2d6a245e79 h1:k64+JoBheX5aBx1Y69TzITbbwD25yCPys35JUSR/wX8=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114061745-6f2d6a245e79/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114072646-4f26c74d04c3 h1:rGwoMSdxn8WI9gsoBusLXOiO3wgYNehk8k1v+N4TcRA=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114072646-4f26c74d04c3/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114074016-7106bfec0cab h1:HgZRlpiFv2j1YxgSRtqIIAo9Wq9myCOW7Rl/m36jhAs=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114074016-7106bfec0cab/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114075133-7d07e0d4298f h1:4xLPe8D+a9bz7XTyIEFibarEVFt5YQEZFBq8ilKQ83w=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114075133-7d07e0d4298f/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114095122-23536ba811db h1:rvYHb4SXGJbntCg//pUuQtk5Ap9ywFYuPVoOHeX/yiU=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114095122-23536ba811db/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114101438-086d08546643 h1:JeHSZnCyyB40MNwngt/dnpwPdweO37QqIb2IR5cZCos=
github.com/trufnetwork/kwil-db/core v0.4.3-0.20260114101438-086d08546643/go.mod h1:HnOsh9+BN13LJCjiH0+XKaJzyjWKf+H9AofFFp90KwQ=
github.com/trufnetwork/openzeppelin-merkle-tree-go v0.0.2 h1:DCq8MzbWH0wZmICNmMVsSzUHUPl+2vqRhluEABjxl88=
github.com/trufnetwork/openzeppelin-merkle-tree-go v0.0.2/go.mod h1:Y0MJpPp9QXU5vC6Gpoilql2NkgmGNcbHm9HYC2v2N8s=
github.com/trufnetwork/sdk-go v0.3.2-0.20250630062504-841b40cdb709 h1:d9EqPXIjbq/atzEncK5dM3Z9oStx1BxCGuL/sjefeCw=
Expand Down
6 changes: 3 additions & 3 deletions internal/migrations/erc20-bridge/000-extension.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ USE erc20 {

-- Second hoodi bridge: Test Token 2 (TT2)
-- Token: 0x1591DeAa21710E0BA6CC1b15F49620C9F65B2dEd
-- Proxy: 0x9BD843A3ce718FE639e9968860B933b026784687
-- Explorer: https://hoodi.etherscan.io/address/0x9BD843A3ce718FE639e9968860B933b026784687
-- Proxy: 0x80D9B3b6941367917816d36748C88B303f7F1415
-- Explorer: https://hoodi.etherscan.io/address/0x80D9B3b6941367917816d36748C88B303f7F1415
USE erc20 {
chain: 'hoodi',
escrow: '0x9BD843A3ce718FE639e9968860B933b026784687',
escrow: '0x80D9B3b6941367917816d36748C88B303f7F1415',
distribution_period: '10m'
} AS hoodi_tt2;
30 changes: 28 additions & 2 deletions internal/migrations/erc20-bridge/004-withdrawal-proof-action.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
-- Withdrawal Proof Action for Hoodi Non-Custodial Bridge (Test Token)
-- This action exposes the list_wallet_rewards precompile as a public action.
-- Withdrawal Proof Actions for Hoodi Non-Custodial Bridges
-- These actions expose the list_wallet_rewards precompile as public actions.
-- Returns merkle proofs AND validator signatures - everything needed for withdrawal.
-- Returns ALL confirmed epochs, not just first one (uses RETURN NEXT)
-- Epochs filtered by withdrawals table (only unclaimed epochs returned)

-- First hoodi bridge: Test Token (TT)
CREATE OR REPLACE ACTION hoodi_tt_get_withdrawal_proof($wallet_address TEXT)
PUBLIC VIEW RETURNS TABLE (
chain TEXT,
Expand All @@ -25,3 +27,27 @@ PUBLIC VIEW RETURNS TABLE (
$row.param_root, $row.param_proofs, $row.param_signatures;
}
};

-- Second hoodi bridge: Test Token 2 (TT2)
CREATE OR REPLACE ACTION hoodi_tt2_get_withdrawal_proof($wallet_address TEXT)
PUBLIC VIEW RETURNS TABLE (
chain TEXT,
chain_id TEXT,
contract TEXT,
created_at INT8,
recipient TEXT,
amount NUMERIC(78, 0),
block_hash BYTEA,
root BYTEA,
proofs BYTEA[],
signatures BYTEA[]
) {
-- with_pending = false means only return confirmed epochs (ready for withdrawal)
-- Returns ALL confirmed epochs ordered by height DESC (newest first)
FOR $row IN hoodi_tt2.list_wallet_rewards($wallet_address, false) {
-- Return each row (don't exit loop!)
RETURN NEXT $row.chain, $row.chain_id, $row.contract, $row.created_at,
$row.param_recipient, $row.param_amount, $row.param_block_hash,
$row.param_root, $row.param_proofs, $row.param_signatures;
}
};
Loading