Skip to content

Commit

Permalink
chore: update protocol contracts to v8
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Jul 3, 2024
1 parent 3ada76c commit 5c31555
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@uniswap/v2-periphery": "^1.1.0-beta.0",
"@zetachain/faucet-cli": "^4.0.1",
"@zetachain/networks": "^8.0.0",
"@zetachain/protocol-contracts": "7.0.0",
"@zetachain/protocol-contracts": "8.0.0-rc1",
"axios": "^1.4.0",
"bech32": "^2.0.0",
"bip39": "^3.1.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/client/src/getFees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ const fetchZEVMFees = async function (
) {
const provider = new ethers.providers.StaticJsonRpcProvider(rpcUrl);
const contract = new ethers.Contract(zrc20.address, ZRC20.abi, provider);
const [, withdrawGasFee] = await contract.withdrawGasFee();
let withdrawGasFee;
try {
[, withdrawGasFee] = await contract.withdrawGasFee();
} catch (e) {
return;
}
const gasFee = ethers.BigNumber.from(withdrawGasFee);
const protocolFee = ethers.BigNumber.from(await contract.PROTOCOL_FLAT_FEE());
const gasToken = foreignCoins.find((c: any) => {
Expand Down Expand Up @@ -90,7 +95,7 @@ export const getFees = async function (this: ZetaChainClient, gas: Number) {
try {
const rpcUrl = this.getEndpoint("evm", `zeta_${this.network}`);
const fee = await fetchZEVMFees(zrc20, rpcUrl, foreignCoins);
fees.omnichain.push(fee);
if (fee) fees.omnichain.push(fee);
} catch (err) {
console.log(err);
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1767,10 +1767,10 @@
dependencies:
dotenv "^16.1.4"

"@zetachain/protocol-contracts@7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-7.0.0.tgz#20eb6c62d805d7470408ccdff0e3614684bca174"
integrity sha512-8JTNFZxVZYmDtAXJIEr+tkakuML12X42Fya4bJ1NkfWiVMkcSej92BSTl/35qYtHdjY7vXy9uMrfXEqfw5rsPw==
"@zetachain/protocol-contracts@8.0.0-rc1":
version "8.0.0-rc1"
resolved "https://registry.yarnpkg.com/@zetachain/protocol-contracts/-/protocol-contracts-8.0.0-rc1.tgz#34df589c1b56df77f2695b37bd8a4b79df1787b1"
integrity sha512-VpgbQtVUxy4XYFb0P9UN9nQZkhQ+fr3Bg7A5SqZJCH3fi8QELSn6qaVSwATn+mXdnSMD2uXWSnyy/ANXFqedmw==

abbrev@1:
version "1.1.1"
Expand Down

0 comments on commit 5c31555

Please sign in to comment.