Using the above “multicall” contract, we will attempt to manage our DAO treasury (to swap from $NEAR → $marmaj)
target - marmaj.multicall.near
deposit - 10.5 (extra NEAR can be redeemed from the marmaj.multicall.near contract - need to query contract)
{
“account_id”:“marmaj.multicall.near”,
“amount”:“HOW_MUCH_SER”
}
method - sequential
JSON for 10 NEAR swap:
{
“schedule”: [
{
“addr”: “wrap.near”,
“func”: “near_deposit”,
“args”: “{}”,
“gas”: “4000000000000”,
“depo”: “10000000000000000000000000”
},
{
“addr”: “wrap.near”,
“func”: “ft_transfer_call”,
“args”: “{"receiver_id":"v2.ref-finance.near","amount":"10000000000000000000000000", "msg":""}”,
“gas”: “40000000000000”,
“depo”: “1”
},
{
“addr”: “v2.ref-finance.near”,
“func”: “swap”,
“args”: “{"actions":[{"pool_id":11,"token_in":"wrap.near","amount_in":"10000000000000000000000000","token_out":"marmaj.tkn.near","min_amount_out":"1"}]}”,
“gas”: “20000000000000”,
“depo”: “1”
},
{
“addr”: “v2.ref-finance.near”,
“func”: “get_deposits”,
“args”: “{"account_id":"marmaj.multicall.near"}”,
“gas”: “5000000000000”,
“depo”: “0”
},
{
“addr”: “marmaj.multicall.near”,
“func”: “withdraw_from_ref”,
“args”: “{"ref_address":"v2.ref-finance.near","tokens":["wrap.near","marmaj.tkn.near"],"receiver_id":"marmaj.sputnik-dao.near","withdrawal_gas":"55000000000000","token_transfer_gas":"4000000000000"}”,
“gas”: “95000000000000”,
“depo”: “0”
}
]
}
Data is too large for a ledger.