Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Oct 9, 2023
1 parent 9fed06b commit 23489f6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Transfer unclaimed airdrop funds from neutron-1 to cosmoshub-4

yarn build
# Test
`cd ./test`

`yarn build`

## learn denom
neutrond tx ibc-transfer transfer "transfer" "channel-189" "cosmos1mwfj5j8v2aafqqnjekeqtupgc6894033nvtgre" "100untrn" --chain-id pion-1 --home "~/.neutrond" --node "https://rpc-falcron.pion-1.ntrn.tech:443" --from "pion1_testnet_wallet" --keyring-backend test
gaiad q bank balances cosmos1mwfj5j8v2aafqqnjekeqtupgc6894033nvtgre --home ~/.gaiad-theta --node https://rpc.sentry-02.theta-testnet.polypore.xyz:443

Expand All @@ -10,27 +14,35 @@ IBC_DENOM="ibc/kekw"
ENDPOINT="http://127.0.0.1:26657"
MNEMONICS="banner spread envelope side kite person disagree path silver will brother under couch edit food venture squirrel civil budget number acquire point work mass"

## 1. create channel beforehand
## prepare. create channel beforehand
// WARN: testnet connection id example
hermes create channel --a-chain pion-1 --a-port transfer --b-port transfer --a-connection connection-120

// created "channel-189 <-> channel-3235" for testnet

## 2. setup contracts
## 1. setup contracts
node ./lib/index.js setup_contracts "$MNEMONICS" "$ENDPOINT" "connection-120" "channel-189" "$IBC_DENOM"

// Result contracts:
{"creditsAddress":"neutron1je7qemax5u362p6f8qw5z7327vdwu36f0nyskkccwk2g88afrxkszj792a","airdropAddress":"neutron1hksph0z3aw59tf4zt63wadf7lmrw3aywylp52nd4ycypvhtatq4sj5wtm5","claimerAddress":"neutron1224xy9aygqryna5u0x4c8jnxpe8lxn8fvkvvjszszr87cqt202hqtpp9fl"}
{"creditsAddress":"neutron1s7q7t60agc4qll5u5hrt2th237rpn4wkjxva8zw2tj0rr36rue6qdqshcq","airdropAddress":"neutron140evr8wdxf44a5tz7lk7p9guus84d7763vp30j6zek9zmupj24nqye5mnd","claimerAddress":"neutron1xmf2rmsmnz208lfjytqdw8xx90ulkdg7p3k7g4ql82ady7mr3m0qdxp5qd"}

## 3. run steps
CLAIMER_ADDRESS="neutron1224xy9aygqryna5u0x4c8jnxpe8lxn8fvkvvjszszr87cqt202hqtpp9fl"
## 2. run steps
CLAIMER_ADDRESS="neutron1xmf2rmsmnz208lfjytqdw8xx90ulkdg7p3k7g4ql82ady7mr3m0qdxp5qd"

node ./lib/index.js step_1 "$MNEMONICS" "$ENDPOINT" "$CLAIMER_ADDRESS" # withdraw from airdrop

node ./lib/index.js step_2 "$MNEMONICS" "$ENDPOINT" "$CLAIMER_ADDRESS" # create ica

node ./lib/index.js step_3 "$MNEMONICS" "$ENDPOINT" "$CLAIMER_ADDRESS" # send to ica

node ./lib/index.js step_4 "$MNEMONICS" "$ENDPOINT" "$CLAIMER_ADDRESS" # execute MsgFundCommunityPool

## query state
node ./lib/index.js query_state "$MNEMONICS" "$ENDPOINT" "$CLAIMER_ADDRESS"

should be 0 on account

## query community pool
gaiad q auth module-account distribution --chain-id theta-testnet-001 --node "https://rpc.sentry-02.theta-testnet.polypore.xyz:443"
gaiad q bank balances cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl --chain-id theta-testnet-001 --node "https://rpc.sentry-02.theta-testnet.polypore.xyz:443"
https://testnet.mintscan.io/cosmoshub-testnet/account/cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl
3 changes: 0 additions & 3 deletions test/lib/step_2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ async function Step2(c, claimerAddress) {
create_hub_i_c_a: {},
}, 'auto', 'create hub ica', []);
console.log('createhubicares ' + JSON.stringify(createhubicares));
console.log('Step 2 check');
const icaResponse = await c.client.queryContractSmart(claimerAddress, { interchain_account: {} });
console.log('ICA address: ' + icaResponse);
}
exports.Step2 = Step2;
3 changes: 0 additions & 3 deletions test/lib/step_4.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ async function Step4(c, claimerAddress) {
fund_community_pool: {},
}, 'auto', 'fund community pool', [{ amount: '8000', denom: 'untrn' }]);
console.log('fundcommunitypoolres ' + JSON.stringify(fundcommunitypoolres));
console.log('Step 4 check');
console.log('ICA address: ' + await c.client.queryContractSmart(claimerAddress, { transfer_amount: {} }));
console.log('Stage: ' + JSON.stringify(await c.client.queryContractSmart(claimerAddress, { stage: {} })));
}
exports.Step4 = Step4;
4 changes: 0 additions & 4 deletions test/src/step_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ export async function Step2(c: Connection, claimerAddress: string): Promise<void
create_hub_i_c_a: {},
}, 'auto', 'create hub ica', [])
console.log('createhubicares ' + JSON.stringify(createhubicares))

console.log('Step 2 check')
const icaResponse = await c.client.queryContractSmart(claimerAddress, { interchain_account: {} })
console.log('ICA address: ' + icaResponse)
}
4 changes: 0 additions & 4 deletions test/src/step_4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ export async function Step4(c: Connection, claimerAddress: string): Promise<void
fund_community_pool: {},
}, 'auto', 'fund community pool', [{ amount: '8000', denom: 'untrn' }])
console.log('fundcommunitypoolres ' + JSON.stringify(fundcommunitypoolres))

console.log('Step 4 check')
console.log('ICA address: ' + await c.client.queryContractSmart(claimerAddress, { transfer_amount: {} }))
console.log('Stage: ' + JSON.stringify(await c.client.queryContractSmart(claimerAddress, { stage: {} })))
}

0 comments on commit 23489f6

Please sign in to comment.