Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Dec 25, 2023
1 parent 410f724 commit 810ccf0
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions helix-contract/deploy/deploy_xtoken_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ const crabNetwork = {
name: "crab",
url: "https://crab-rpc.darwinia.network",
dao: "0x88a39B052d477CfdE47600a7C9950a441Ce61cb4",
backing: "0x27F58339CbB8c5A6f58d5D05Bfc1B3fd121F489C",
backing: "0xbdC7bbF408931C5d666b4F0520E0D9E9A0B04e99",
chainid: 44
};

const sepoliaNetwork = {
name: "sepolia",
url: "https://rpc-sepolia.rockx.com",
dao: "0x88a39B052d477CfdE47600a7C9950a441Ce61cb4",
issuing: "0xFF3bc7372A8011CFaD43D240464ef2fe74C59b86",
issuing: "0xf22D0bb66b39745Ae6e3fEa3E5859d7f0b367Fd1",
chainid: 11155111
};

Expand Down Expand Up @@ -52,7 +52,7 @@ async function registerBacking() {
const walletBacking = wallet(crabNetwork.url);

const backing = await ethers.getContractAt("xTokenBacking", backingNetwork.backing, walletBacking);
const xToken = "0x4828B88240166B8bB79A833Fd0dD38EaeADAAB1a";
const xToken = "0x9Da7E18441f26515CC713290BE846E726d41781d";

await backing.registerOriginalToken(
11155111,
Expand All @@ -73,10 +73,10 @@ async function lockAndRemoteIssuing() {
11155111,
"0x0000000000000000000000000000000000000000",
walletBacking.address,
ethers.utils.parseEther("100"),
1703247763001,
ethers.utils.parseEther("10"),
1703247763002,
"0x000000000000000000000000000000000000000000000000000000000005f02200000000000000000000000088a39b052d477cfde47600a7c9950a441ce61cb400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
{ value: ethers.utils.parseEther("105.4") }
{ value: ethers.utils.parseEther("15.4") }
);
}

Expand All @@ -86,14 +86,14 @@ async function burnAndRemoteUnlock() {

const issuing = await ethers.getContractAt("xTokenIssuing", issuingNetwork.issuing, walletIssuing);

const xTokenAddress = "0x4828B88240166B8bB79A833Fd0dD38EaeADAAB1a";
const xTokenAddress = "0x9Da7E18441f26515CC713290BE846E726d41781d";
const xToken = await ethers.getContractAt("xTokenErc20", xTokenAddress, walletIssuing);
await xToken.approve(issuing.address, ethers.utils.parseEther("10000000"), {gasLimit: 500000});
await issuing.burnAndRemoteUnlock(
xTokenAddress,
walletIssuing.address,
ethers.utils.parseEther("5"),
1703248419043,
1703248419044,
"0x000000000000000000000000000000000000000000000000000000000006493c00000000000000000000000088a39b052d477cfde47600a7c9950a441ce61cb400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
{
value: ethers.utils.parseEther("0.0000007"),
Expand All @@ -113,8 +113,8 @@ async function requestRemoteUnlockForIssuingFailure() {
"0x0000000000000000000000000000000000000000",
walletIssuing.address,
walletIssuing.address,
ethers.utils.parseEther("100"),
1703247763000,
ethers.utils.parseEther("91"),
1703247763001,
"0x000000000000000000000000000000000000000000000000000000000006493c00000000000000000000000088a39b052d477cfde47600a7c9950a441ce61cb400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
{
value: ethers.utils.parseEther("0.0000007"),
Expand All @@ -130,11 +130,12 @@ async function requestRemoteIssuingForUnlockFailure() {
const backing = await ethers.getContractAt("xTokenBacking", backingNetwork.backing, walletBacking);

await backing.requestRemoteIssuingForUnlockFailure(
"0xab4f619082b61cac56f60611a661e2b16d8052ab2531be791d95821f8fb232ce",
11155111,
"0x0000000000000000000000000000000000000000",
walletBacking.address,
ethers.utils.parseEther("100"),
walletBacking.address,
ethers.utils.parseEther("5"),
1703248419044,
"0x000000000000000000000000000000000000000000000000000000000005f02200000000000000000000000088a39b052d477cfde47600a7c9950a441ce61cb400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
{ value: ethers.utils.parseEther("5.4") }
);
Expand All @@ -145,8 +146,8 @@ async function main() {
//await registerBacking();
//await lockAndRemoteIssuing();
//await burnAndRemoteUnlock();
await requestRemoteUnlockForIssuingFailure();
//await requestRemoteIssuingForUnlockFailure();
//await requestRemoteUnlockForIssuingFailure();
await requestRemoteIssuingForUnlockFailure();
}

main()
Expand Down

0 comments on commit 810ccf0

Please sign in to comment.