devnet: use real account and nonce for send-lockups.js
ghstack-source-id: fb233fa727
Pull Request resolved: https://github.com/certusone/wormhole/pull/61
This commit is contained in:
parent
bdd9d96559
commit
13f79a96b3
|
@ -1,5 +1,6 @@
|
|||
const WrappedAsset = artifacts.require("WrappedAsset");
|
||||
const Wormhole = artifacts.require("Wormhole");
|
||||
const ERC20 = artifacts.require("ERC20PresetMinterPauser");
|
||||
|
||||
module.exports = async function (deployer) {
|
||||
await deployer.deploy(WrappedAsset);
|
||||
|
@ -7,4 +8,5 @@ module.exports = async function (deployer) {
|
|||
keys: ["0xbeFA429d57cD18b7F8A4d91A2da9AB4AF05d0FBe"],
|
||||
expiration_time: 0
|
||||
}, WrappedAsset.address, 1000);
|
||||
await deployer.deploy(ERC20, "Test Token","TKN");
|
||||
};
|
||||
|
|
|
@ -26,19 +26,26 @@ function sleep(ms) {
|
|||
module.exports = function(callback) {
|
||||
const fn = async () => {
|
||||
let bridge = await Wormhole.deployed();
|
||||
|
||||
let token = await ERC20.new("Test Token", "TKN");
|
||||
let token = await ERC20.deployed();
|
||||
console.log("Token:", token.address);
|
||||
await token.mint("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1", "1000000000000000000");
|
||||
await token.approve(bridge.address, "1000000000000000000");
|
||||
|
||||
while (true) {
|
||||
let ev = await bridge.lockAssets(
|
||||
token.address, /* asset address */
|
||||
"1000000005", /* amount */
|
||||
"0x1230000000000000000000000000000000000000000000000000000000000000", /* recipient */
|
||||
1, /* target chain: solana */
|
||||
0, /* nonce */
|
||||
false /* refund dust? */
|
||||
/* asset address */
|
||||
token.address,
|
||||
/* amount */
|
||||
"1000000005",
|
||||
/* recipient
|
||||
* 7EFk3VrWeb29SWJPQs5cUyqcY3fQd33S9gELkGybRzeu base58 -> hex) */
|
||||
"0x5c8b574eced4dbea1bbf23d5149564791900129ede419a6860e3e706b426b2ba",
|
||||
/* target chain: solana */
|
||||
1,
|
||||
/* nonce */
|
||||
Math.floor(Math.random() * 65535),
|
||||
/* refund dust? */
|
||||
false
|
||||
);
|
||||
|
||||
let block = await web3.eth.getBlock('latest');
|
||||
|
|
|
@ -41,6 +41,14 @@ echo "Created token account $account"
|
|||
# Mint new tokens owned by our CLI account
|
||||
cli mint "$token" 10000000000 "$account"
|
||||
|
||||
# Create wrapped asset for the token we mint in send-lockups.js (2 = Ethereum, 9 decimals)
|
||||
wrapped_token=$(cli create-wrapped "$bridge_address" 2 9 000000000000000000000000CfEB869F69431e42cdB54A4F4f105C19C080A601 | grep 'Wrapped Mint address' | awk '{ print $4 }')
|
||||
echo "Created wrapped token $token"
|
||||
|
||||
# Create token account to receive wrapped assets from send-lockups.js
|
||||
wrapped_account=$(cli create-account --seed=934893 "$wrapped_token" | grep 'Creating account' | awk '{ print $3 }')
|
||||
echo "Created wrapped token account $wrapped_account"
|
||||
|
||||
# Do lock transactions
|
||||
while : ; do
|
||||
# Uncomment for simulated debugging transactions
|
||||
|
|
Loading…
Reference in New Issue