Skip to content

Commit

Permalink
chore: releasing v6.3.1 (#280)
Browse files Browse the repository at this point in the history
* refactor: add gas options to gateway upgrade test (#277)

* refactor: add gas options to gateway upgrade test

* fix(ci): pinning slither version (#278)

* fix(ci): ignore unused imports in bytecode frozen contracts

* fix(ci): ignore unused imports in bytecode frozen contracts

* fix(ci): pinning the slither version to 0.10.1

* fix(ci): pinning the slither version to 0.10.1

---------

Co-authored-by: re1ro <rma4ok@gmail.com>

* feat(GasService): updated estimation dependency (#279)

* feat(GasService): updated estimation dependency

* chore(npm): version bump

* test(GasService): fixing gas info format

* chore(npm): GMP SDK version bump

---------

Co-authored-by: Blockchain Guy <ayusht11@outlook.com>
  • Loading branch information
re1ro and blockchainguyy authored Apr 17, 2024
1 parent 2da444a commit c4b295c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/slither.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ jobs:
uses: crytic/slither-action@v0.3.1
env:
NO_OVERRIDES: true
with:
node-version: 18
slither-version: 0.10.1
4 changes: 1 addition & 3 deletions contracts/gas-service/AxelarGasService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;

import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol';
import { IAxelarGasService } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol';
import { InterchainGasEstimation } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/gas-estimation/InterchainGasEstimation.sol';
import { InterchainGasEstimation, GasInfo } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/gas-estimation/InterchainGasEstimation.sol';
import { Upgradable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/Upgradable.sol';
import { SafeTokenTransfer, SafeTokenTransferFrom } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeTransfer.sol';
import { SafeNativeTransfer } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeNativeTransfer.sol';
Expand All @@ -20,8 +20,6 @@ contract AxelarGasService is InterchainGasEstimation, Upgradable, IAxelarGasServ
using SafeTokenTransferFrom for IERC20;
using SafeNativeTransfer for address payable;

error InvalidParams();

address public immutable gasCollector;

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/gmp/SourceChainSwapCaller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

pragma solidity ^0.8.0;

import { IAxelarGasService } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol';
import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol';
import { IAxelarGateway } from '../../interfaces/IAxelarGateway.sol';
import { IAxelarGasService } from '../../interfaces/IAxelarGasService.sol';

contract SourceChainSwapCaller {
IAxelarGateway public gateway;
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axelar-network/axelar-cgp-solidity",
"version": "6.3.0",
"version": "6.3.1",
"description": "EVM Smart Contracts for Axelar Network",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -30,7 +30,7 @@
},
"homepage": "https://github.com/axelarnetwork/axelar-cgp-solidity#readme",
"dependencies": {
"@axelar-network/axelar-gmp-sdk-solidity": "5.7.0"
"@axelar-network/axelar-gmp-sdk-solidity": "5.8.0"
},
"devDependencies": {
"@0xpolygonhermez/zkevm-commonjs": "github:0xpolygonhermez/zkevm-commonjs#v1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/AxelarGatewayUpgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('AxelarGatewayUpgrade', () => {

await waitFor(timeDelay);

const tx = await interchainGovernance.executeProposal(target, calldata, nativeValue);
const tx = await interchainGovernance.executeProposal(target, calldata, nativeValue, getGasOptions());
const receipt = await tx.wait();
const executionTimestamp = (await ethers.provider.getBlock(receipt.blockNumber)).timestamp;

Expand Down
35 changes: 28 additions & 7 deletions test/gmp/AxelarGasService.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,32 @@ describe('AxelarGasService', () => {
});

describe('Gas Estimation', () => {
const chains = ['ethereum', 'optimism', 'base'];
const chains = ['ethereum', 'optimism', 'arbitrum'];
const gasUpdates = [
[0, '110227069355211', '278470919016084', '3800724', '1395265596'],
[1, '110898281163494', '278128885876991', '3066', '0'],
[1, '123127735536005', '279194214965138', '30593', '0'],
{
gasEstimationType: 0,
l1FeeScalar: 0,
axelarBaseFee: 90000000000,
relativeGasPrice: 50000000000,
relativeBlobBaseFee: 1,
expressFee: 190000000000,
},
{
gasEstimationType: 1,
l1FeeScalar: 1500,
axelarBaseFee: 90000,
relativeGasPrice: 5000,
relativeBlobBaseFee: 0,
expressFee: 190000,
},
{
gasEstimationType: 3,
l1FeeScalar: 0,
axelarBaseFee: 90000,
relativeGasPrice: 5000,
relativeBlobBaseFee: 0,
expressFee: 190000,
},
];

it('should allow the collector to update gas info', async () => {
Expand All @@ -653,15 +674,15 @@ describe('AxelarGasService', () => {

await expect(gasService.connect(ownerWallet).updateGasInfo(chains, gasUpdates))
.to.emit(gasService, 'GasInfoUpdated')
.withArgs(chains[0], gasUpdates[0]);
.withArgs(chains[0], Object.values(gasUpdates[0]));

for (let i = 0; i < chains.length; i++) {
const chain = chains[i];
const gasInfo = gasUpdates[i];

let result = await gasService.getGasInfo(chain);
result = Array.from(result).map((x) => (x.toNumber ? x.toNumber().toString() : x));
expect(result).to.be.deep.equal(gasInfo);
expect(result).to.be.deep.equal(Object.values(gasInfo));
}
});

Expand Down Expand Up @@ -715,7 +736,7 @@ describe('AxelarGasService', () => {
params,
);

expect(gasEstimate).to.be.equal(111288142881657);
expect(gasEstimate).to.be.equal(374600090277);

await expectRevert(
(gasOptions) =>
Expand Down

0 comments on commit c4b295c

Please sign in to comment.