Skip to content
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

[VEN-2090][VEN-2188]: XVS bridge src chain configurations for Sepolia and Ethereum #140

Merged
merged 10 commits into from
Jan 8, 2024
4 changes: 1 addition & 3 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import fs from "fs";
import { HardhatUserConfig, task } from "hardhat/config";

require("dotenv").config();

Check warning on line 7 in hardhat.config.ts

View workflow job for this annotation

GitHub Actions / lint

Require statement not part of import statement
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;

task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
Expand Down Expand Up @@ -52,9 +52,7 @@
bsctestnet: {
url: process.env.ARCHIVE_NODE_bsctestnet || "https://data-seed-prebsc-1-s1.binance.org:8545",
chainId: 97,
accounts: {
mnemonic: process.env.MNEMONIC || "",
},
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
gasPrice: ethers.utils.parseUnits("10", "gwei").toNumber(),
gasMultiplier: 10,
timeout: 12000000,
Expand Down
3 changes: 2 additions & 1 deletion scripts/proposeTestnetVIP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { getCalldatas } from "../src/utils";
import GOVERNOR_BRAVO_DELEGATE_ABI from "../src/vip-framework/abi/governorBravoDelegateAbi.json";

const readline = require("readline-sync");

Check warning on line 6 in scripts/proposeTestnetVIP.ts

View workflow job for this annotation

GitHub Actions / lint

Require statement not part of import statement

const DEFAULT_GOVERNOR_PROXY = "0x5573422a1a59385c247ec3a66b93b7c08ec2f8f2";

Expand All @@ -14,7 +14,7 @@

export const proposeTestnetVIP = async () => {
const vipNumber = readline.question("Number of the VIP to propose => ");
const proposal = await loadProposal(vipNumber);
const proposal = await await loadProposal(vipNumber);

const { targets, signatures, values, meta } = proposal;

Expand All @@ -30,3 +30,4 @@
);
await tx.wait();
};
proposeTestnetVIP();

Check warning on line 33 in scripts/proposeTestnetVIP.ts

View workflow job for this annotation

GitHub Actions / lint

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
31 changes: 0 additions & 31 deletions simulations/vip-187/vip-187-testnet-2/simulations.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ import {
MIN_DST_GAS,
SINGLE_RECEIVE_LIMIT,
SINGLE_SEND_LIMIT,
vip187Testnet,
} from "../../../vips/vip-187/vip-187-testnet";
vip232Testnet,
} from "../../../vips/vip-232/vip-232-testnet";
import ACM_ABI from "./abi/AccessControlManager.json";
import XVS_ABI from "./abi/XVS.json";
import XVSBridgeAdmin_ABI from "./abi/XVSBridgeAdmin.json";
import XVSProxyOFTSrc_ABI from "./abi/XVSProxyOFTSrc.json";

const XVSProxyOFTSrc = "0x963cAbDC5bb51C1479ec94Df44DE2EC1a49439E3";
const XVSBridgeAdmin_Proxy = "0x5D08D49A2e43aC4c72C60754d1550BA12e846d66";
const XVSProxyOFTSrc = "0x0E132cd94fd70298b747d2b4D977db8d086e5fD0";
const XVSBridgeAdmin_Proxy = "0xB164Cb262328Ca44a806bA9e3d4094931E658513";
const NORMAL_TIMELOCK = "0xce10739590001705F7FF231611ba4A48B2820327";
const XVS = "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff";
const XVS_HOLDER = "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706";

forking(35486130, () => {
forking(36177672, () => {
const provider = ethers.provider;
let bridge: ethers.Contract;
let bridgeAdmin: ethers.Contract;
Expand All @@ -39,13 +39,13 @@ forking(35486130, () => {
bridge = new ethers.Contract(XVSProxyOFTSrc, XVSProxyOFTSrc_ABI, provider);
bridgeAdmin = new ethers.Contract(XVSBridgeAdmin_Proxy, XVSBridgeAdmin_ABI, provider);
xvs = new ethers.Contract(XVS, XVS_ABI, provider);
xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("2"));
xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("5"));
[receiver] = await ethers.getSigners();
receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]);
defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 200000]);
defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]);
});

testVip("vip187Testnet", vip187Testnet(), {
testVip("vip232Testnet", vip232Testnet(), {
callbackAfterExecution: async (txResponse: TransactionResponse) => {
await expectEvents(
txResponse,
Expand All @@ -61,7 +61,7 @@ forking(35486130, () => {
"SetTrustedRemoteAddress",
"Failure",
],
[50, 2, 1, 1, 1, 1, 1, 1, 0],
[55, 2, 1, 1, 1, 1, 1, 1, 0],
);
},
});
Expand Down Expand Up @@ -92,7 +92,7 @@ forking(35486130, () => {
});

it("Should emit an event on successfull bridging of XVS", async () => {
const amount = parseUnits("1", 18);
const amount = parseUnits("0.5", 18);
const nativeFee = (
await bridge.estimateSendFee(DEST_CHAIN_ID, receiverAddressBytes32, amount, false, defaultAdapterParams)
).nativeFee;
Expand Down Expand Up @@ -139,15 +139,15 @@ forking(35486130, () => {
});

it("Reverts if max daily transaction limit exceed", async function () {
const maxPlusAmount = ethers.utils.parseUnits("110");
const amount = ethers.utils.parseUnits("1");
const maxPlusAmount = ethers.utils.parseUnits("500");
const amount = ethers.utils.parseUnits("0.9");

await xvs.connect(xvsHolderSigner).approve(bridge.address, maxPlusAmount);
const nativeFee = (
await bridge.estimateSendFee(DEST_CHAIN_ID, receiverAddressBytes32, amount, false, defaultAdapterParams)
).nativeFee;

for (let i = 0; i < 70; i++) {
for (let i = 0; i < 50; i++) {
await bridge
.connect(xvsHolderSigner)
.sendFrom(
Expand Down
Loading
Loading