Skip to content

Commit

Permalink
gas immutable and deploy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Nov 22, 2024
1 parent e815844 commit 5dfba30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/swap/contracts/Swap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract Swap is UniversalContract {
address public immutable uniswapRouter;
GatewayZEVM public gateway;
uint256 constant BITCOIN = 18332;
uint256 public gasLimit;
uint256 public immutable gasLimit;

error InvalidAddress();
error Unauthorized();
Expand Down
2 changes: 1 addition & 1 deletion examples/swap/contracts/SwapToAnyToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract SwapToAnyToken is UniversalContract {
address public immutable uniswapRouter;
GatewayZEVM public gateway;
uint256 constant BITCOIN = 18332;
uint256 public gasLimit;
uint256 public immutable gasLimit;

error InvalidAddress();
error Unauthorized();
Expand Down
11 changes: 9 additions & 2 deletions examples/swap/tasks/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { task } from "hardhat/config";
import { task, types } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";

const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
Expand All @@ -14,7 +14,8 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
const factory = await hre.ethers.getContractFactory(args.name);
const contract = await (factory as any).deploy(
args.gateway,
args.uniswapRouter
args.uniswapRouter,
args.gasLimit
);
await contract.deployed();

Expand Down Expand Up @@ -44,4 +45,10 @@ task("deploy", "Deploy the contract", main)
"gateway",
"Gateway address (default: ZetaChain Gateway)",
"0x6c533f7fe93fae114d0954697069df33c9b74fd7"
)
.addOptionalParam(
"gasLimit",
"Gas limit for the transaction",
1000000,
types.int
);

0 comments on commit 5dfba30

Please sign in to comment.