Skip to content

feat(multicall): add support for multicall contract #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

Foivos
Copy link
Contributor

@Foivos Foivos commented May 8, 2025

AXE-8467

Tested via Setting trusted chains:

node stellar/multicall.js multicall '[{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "set_trusted_chain",
  "args": ["avalanche"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "set_trusted_chain",
  "args": ["sui"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "set_trusted_chain",
  "args": ["binance"]
}]' --chain-name stellar

Wallet address: GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL

Wallet balances: 9795.8563976 XLM

Wallet sequence: 2750282307993774

Multicall executed tx: 9bb58763ccea05b865d42db75f1696754ba82d53f5a9d3d0d9ab027b01bead64

Multicall results:

Result 1:: Call executed successfully

Result 2:: Call executed successfully

Result 3:: Call executed successfully

Check if chains set

node stellar/multicall.js multicall '[{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "is_trusted_chain",
  "args": ["avalanche"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "is_trusted_chain",
  "args": ["sui"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "is_trusted_chain",
  "args": ["binance"]
}]' --chain-name stellar

Wallet address: GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL

Wallet balances: 9795.4461609 XLM

Wallet sequence: 2750282307993776

Multicall executed tx: 9a39fe7e16fdd4e8c0f5cdbfb649d59aedd4be8b7e6cb9729910818883bd4199

Multicall results:

Result 1:: true

Result 2:: true

Result 3:: true

Multicall to get flow limit

node stellar/multicall.js multicall '[{
    "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP",
    "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL",
    "function": "flow_limit",
    "args": ["0x96efc3f5494b452964196fa62dd5a3a3b6b895d317f8f0172ce55c8286ef9fe7"]
}]' --chain-name stellar -y
Wallet address: GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL

Wallet balances: 9792.6390598 XLM

Wallet sequence: 2750282307993788

Multicall executed tx: 8ddc3b037177147c43c78b0d56129094c1c24ae924a23d0d5a9805fcbdce6d99

Multicall results:

Result 1:: Call executed successfully

@Foivos Foivos requested a review from a team as a code owner May 8, 2025 12:47
@Foivos Foivos requested review from nbayindirli and npty May 8, 2025 12:47
@Grom-lab-dot
Copy link

Grom-lab-dot commented May 19, 2025

AXE-8467

Tested via Setting trusted chains:

node stellar/multicall.js multicall '[{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "set_trusted_chain",
  "args": ["avalanche"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "set_trusted_chain",
  "args": ["sui"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "set_trusted_chain",
  "args": ["binance"]
}]' --chain-name stellar

Wallet address: GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL

Wallet balances: 9795.8563976 XLM

Wallet sequence: 2750282307993774

Multicall executed tx: 9bb58763ccea05b865d42db75f1696754ba82d53f5a9d3d0d9ab027b01bead64

Multicall results:

Result 1:: Call executed successfully

Result 2:: Call executed successfully

Result 3:: Call executed successfully

Check if chains set

node stellar/multicall.js multicall '[{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "is_trusted_chain",
  "args": ["avalanche"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "is_trusted_chain",
  "args": ["sui"]
},
{
  "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP", 
  "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL", 
  "function": "is_trusted_chain",
  "args": ["binance"]
}]' --chain-name stellar

Wallet address: GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL

Wallet balances: 9795.4461609 XLM

Wallet sequence: 2750282307993776

Multicall executed tx: 9a39fe7e16fdd4e8c0f5cdbfb649d59aedd4be8b7e6cb9729910818883bd4199

Multicall results:

Result 1:: true

Result 2:: true

Result 3:: true

Multicall to get flow limit

node stellar/multicall.js multicall '[{
    "contract": "CA7QTCCATD5CSA3DFDDEWLOWHDHNKHKBUYWPFXFH6THFOIW2CIWTEVFP",
    "approver": "GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL",
    "function": "flow_limit",
    "args": ["0x96efc3f5494b452964196fa62dd5a3a3b6b895d317f8f0172ce55c8286ef9fe7"]
}]' --chain-name stellar -y
Wallet address: GAOQIUT5UJKLSI75YX2KLYM2IDAFSYYND2YYPLJLBSQBWVLN4EMDQUFL

Wallet balances: 9792.6390598 XLM

Wallet sequence: 2750282307993788

Multicall executed tx: 8ddc3b037177147c43c78b0d56129094c1c24ae924a23d0d5a9805fcbdce6d99

Multicall results:

Result 1:: Call executed successfully

@ahramy
Copy link
Contributor

ahramy commented May 29, 2025

Note: This script update only supports simple cases with non-complex arguments.

Multicall to add multiple trusted chains

```bash
node stellar/multicall.js multicall '[{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not very usable, think about how to create a clean UX. This should be integrated in the relevant scripts directly. E.g. node stellar/its.js set-trusted-chains [chain1] [chain2] ... should automatically use a multicall underthehood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants