udpate: vault and bridge

This commit is contained in:
venuswhispers
2024-10-11 15:20:51 -04:00
parent 8f2bb68015
commit 64e161cc98
3 changed files with 17 additions and 19 deletions
@@ -936,8 +936,8 @@ export const CONTRACTS = {
},
8888: {
chain_id: 8888,
teleporter: "0x46390FA219b22f739C63F0bF1c165a1FBc30B57c",
vault: "0xA563ebea2Cd4895559D64b1945943D370F5336d4",
teleporter: "0x6CF6aFF7CcfF500AcEAeb308Ce52cc31e9393d71",
vault: "0x1044d0f16b46D6f0E300bC28C27101Ca099301CA",
},
};
+3 -3
View File
@@ -26,7 +26,7 @@ contract Bridge is Ownable, AccessControl {
address internal payoutAddr;
LuxVault public vault;
/** Events */
event BridgeBurned(address caller, uint256 amt);
event BridgeBurned(address caller, uint256 amt, address token);
event VaultDeposit(address depositor, uint256 amt, address token);
event VaultWithdraw(address receiver, uint256 amt, address token);
event BridgeMinted(address recipient, address token, uint256 amt);
@@ -218,9 +218,9 @@ contract Bridge is Ownable, AccessControl {
function bridgeBurn(uint256 amount_, address tokenAddr_) public {
TeleportStruct memory teleport;
teleport.token = ERC20B(tokenAddr_);
require((teleport.token.balanceOf(msg.sender) > 0), "Zero Balance");
require((teleport.token.balanceOf(msg.sender) >= amount_), "Insufficient token balance");
teleport.token.bridgeBurn(msg.sender, amount_);
emit BridgeBurned(msg.sender, amount_);
emit BridgeBurned(msg.sender, amount_, tokenAddr_);
}
/**
+12 -14
View File
@@ -1,22 +1,20 @@
import { ethers } from "hardhat";
async function main() {
const [deployer] = await ethers.getSigners();
const [deployer] = await ethers.getSigners();
/////LuxVault
const assets = [] as any[];
/////LuxVault
const assets = [] as any[]
const _signer = await ethers.getContractFactory("LuxVault");
const _vault = await _signer.deploy(assets);
await _vault.waitForDeployment();
console.log("LuxVault address on luxTestnet:", await _vault.getAddress());
const _signer = await ethers.getContractFactory("LuxVault");
const _vault = await _signer.deploy(assets);
await _vault.waitForDeployment();
console.log("LuxVault address on luxTestnet:", await _vault.getAddress());
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});