From 691b2a2e8c5f75dfdaa1901a6cbe8389cf114283 Mon Sep 17 00:00:00 2001 From: Richard Watts Date: Fri, 30 Aug 2024 09:50:40 +0100 Subject: [PATCH] (fix) We can now apparently overload call() - previously the compiler complained at me for this, but it now seems fine! (fix) Don't limit deployment gas. --- .../ERC20ProxyForZRC2/contracts/ScillaConnector.sol | 2 +- .../ERC20ProxyForZRC2/contracts/ZRC2ERC20ProxyBurnable.sol | 2 +- .../experimental/ERC20ProxyForZRC2/tasks/deployProxy.ts | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/contracts/experimental/ERC20ProxyForZRC2/contracts/ScillaConnector.sol b/contracts/experimental/ERC20ProxyForZRC2/contracts/ScillaConnector.sol index 740772072..11abeddb9 100644 --- a/contracts/experimental/ERC20ProxyForZRC2/contracts/ScillaConnector.sol +++ b/contracts/experimental/ERC20ProxyForZRC2/contracts/ScillaConnector.sol @@ -12,7 +12,7 @@ library ScillaConnector { * @param tran_name The name of the function to call * @param arg1 The first argument to the function */ - function callu128( + function call( address target, string memory tran_name, uint128 arg1 diff --git a/contracts/experimental/ERC20ProxyForZRC2/contracts/ZRC2ERC20ProxyBurnable.sol b/contracts/experimental/ERC20ProxyForZRC2/contracts/ZRC2ERC20ProxyBurnable.sol index 12929845b..a2e1c3a05 100644 --- a/contracts/experimental/ERC20ProxyForZRC2/contracts/ZRC2ERC20ProxyBurnable.sol +++ b/contracts/experimental/ERC20ProxyForZRC2/contracts/ZRC2ERC20ProxyBurnable.sol @@ -20,7 +20,7 @@ contract ZRC2ERC20ProxyBurnable is ZRC2ERC20Proxy { */ function burn(uint256 value) public virtual { uint128 value128 = value.toUint128(); - zrc2_proxy.callu128("Burn", value128); + zrc2_proxy.call("Burn", value128); } /** diff --git a/contracts/experimental/ERC20ProxyForZRC2/tasks/deployProxy.ts b/contracts/experimental/ERC20ProxyForZRC2/tasks/deployProxy.ts index 467f63933..acc29d860 100644 --- a/contracts/experimental/ERC20ProxyForZRC2/tasks/deployProxy.ts +++ b/contracts/experimental/ERC20ProxyForZRC2/tasks/deployProxy.ts @@ -4,8 +4,7 @@ task("deployProxy", "deploy an ERC20 proxy for a ZRC2 contract") console.log(`Deploying an ERC20 proxy for the ZRC-2 at ${zrc2Address}`); // ZRC2 addresses frequently have bad checksums, hence toLowerCase(). const contract = await ethers.deployContract("ZRC2ERC20Proxy", - [zrc2Address.toLowerCase()], - { gasLimit: 1_000_000 }); + [zrc2Address.toLowerCase()]); await contract.waitForDeployment(); const proxyAddress = await contract.getAddress(); console.log(`Complete. There is now an ERC20-compliant proxy at ${proxyAddress} for the ZRC-2 contract at ${zrc2Address}`); @@ -23,8 +22,7 @@ task("deployProxyBurnable", "deploy a burnable ERC20 proxy for a ZRC2 contract") console.log(`Deploying a burnable ERC20 proxy for the ZRC-2 at ${zrc2Address}`); // ZRC2 addresses frequently have bad checksums, hence toLowerCase(). const contract = await ethers.deployContract("ZRC2ERC20ProxyBurnable", - [zrc2Address.toLowerCase()], - { gasLimit: 1_000_000 }); + [zrc2Address.toLowerCase()]); await contract.waitForDeployment(); const proxyAddress = await contract.getAddress(); console.log(`Complete. There is now an ERC20-compliant proxy at ${proxyAddress} for the ZRC-2 contract at ${zrc2Address}`);