Skip to content

Commit b9532b1

Browse files
author
-
committed
Updated Solidity compiler to v0.8.26 and evmVersion to cancun.
1 parent e1dcd26 commit b9532b1

File tree

8 files changed

+36
-188
lines changed

8 files changed

+36
-188
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ Axelar's factory was included because they are a trustworthy organization doing
7777

7878
The original solidity files were obtained by firstly adding the npm package `@axelar-network/axelar-gmp-sdk-solidity` and importing `@axelar-network/axelar-gmp-sdk-solidity/contracts/deploy/Create3Deployer.sol` in `contracts/Imports.sol`. Hardhat then compiles it and places the artifacts in `artifacts` directory. `Create3Deployer.json` is then copied to `artifacts-saved/@axelar-network/axelar-gmp-sdk-solidity/contracts/deploy/Create3Deployer.sol/` directory for preservation of the bytecode.
7979

80-
Gas used for the deployment is around 724,337, so gas limit in this deployment transaction has been set to 900,000, giving some room in case some opcode costs increase in future, hence there should be at least 0.09 of native currency at the signer's address before factory deployment.
80+
Gas used for the deployment is around 737,521, so gas limit in this deployment transaction has been set to 900,000, giving some room in case some opcode costs increase in future, hence there should be at least 0.09 of native currency at the signer's address before factory deployment.
8181

82-
Axelar's factory contract will be deployed to this address (if the EVM version is `shanghai` and transaction bytecode is unchanged):
82+
Axelar's factory contract will be deployed to this address (if the EVM version is `cancun` and transaction bytecode is unchanged):
8383
```
84-
0x95A9323CF0443758df5F3becf3B221cB3D42f3A0
84+
0x8cf037a598957EFE440841E256f4CA0056A8219C
8585
```
8686
The derived address of the account that would sign the deployment transaction, and that you'd need to fund in order to pay the gas fee, is:
8787
```
88-
0x152510503b8f5EB95dc34aAF274DFc858d609DF5
88+
0xa800eb61836539b33ad43201b7997ED30bA75f5D
8989
```
9090

9191
#### ZeframLou & transmissions11/solmate
@@ -99,15 +99,15 @@ The solmate CREATE3 library was obtained by adding the github repository commit
9999

100100
`@SKYBITDev3/ZeframLou-create3-factory/src/CREATE3Factory.sol` is imported in `contracts/Imports.sol`. Hardhat then compiles it and places the artifacts in `artifacts` directory. `CREATE3Factory.json` is then copied to `artifacts-saved/@SKYBITDev3/ZeframLou-create3-factory/src/CREATE3Factory.sol/` directory for preservation of the bytecode.
101101

102-
Gas used for the deployment is around 389,011, so gas limit in this deployment transaction has been set to 500,000, giving some room in case some opcode costs increase in future, hence there should be at least 0.05 of native currency at the signer's address before factory deployment.
102+
Gas used for the deployment is around 392,687, so gas limit in this deployment transaction has been set to 500,000, giving some room in case some opcode costs increase in future, hence there should be at least 0.05 of native currency at the signer's address before factory deployment.
103103

104-
ZeframLou's factory contract will be deployed to this address (if the EVM version is `shanghai` and transaction bytecode is unchanged):
104+
ZeframLou's factory contract will be deployed to this address (if the EVM version is `cancun` and transaction bytecode is unchanged):
105105
```
106-
0x2befaF9234EE4d5b10dDAECF55F73dA87F74Facb
106+
0x03B583D983aAe5a965dfCC3565F58C9153Af1Be3
107107
```
108108
The derived address of the account that would sign the deployment transaction, and that you'd need to fund in order to pay the gas fee, is:
109109
```
110-
0x1C5aEAeb492367E680e2aD965fE2Ac90E5c648cf
110+
0x9dA930687de2ac5a056dbD80BCDb99c7008f1750
111111
```
112112
#### SKYBIT & Vectorized/solady
113113
The Vectorized/solady CREATE3 library has been included because it is more gas-efficient than other options. A factory contract is needed to use the library so a new one was created based on ZeframLou's factory.
@@ -118,15 +118,15 @@ The original Vectorized/solady CREATE3 solidity file was obtained by firstly add
118118

119119
`contracts/SKYBITCREATE3Factory.sol` imports `{CREATE3} from "@Vectorized/solady/src/utils/CREATE3.sol";`. Hardhat then compiles it and places the artifacts in `artifacts` directory. `SKYBITCREATE3Factory.json` is then copied to `artifacts-saved/contracts/SKYBITCREATE3Factory.sol/` directory for preservation of the bytecode.
120120

121-
Gas used for the deployment is around 230,784, so gas limit in this deployment transaction has been set to 300,000, giving some room in case some opcode costs increase in future, hence there should be at least 0.03 of native currency at the signer's address before factory deployment.
121+
Gas used for the deployment is around 260,068, so gas limit in this deployment transaction has been set to 300,000, giving some room in case some opcode costs increase in future, hence there should be at least 0.03 of native currency at the signer's address before factory deployment.
122122

123-
The SKYBITSolady factory contract will be deployed to this address (if the EVM version is `shanghai` and transaction bytecode is unchanged):
123+
The SKYBITSolady factory contract will be deployed to this address (if the EVM version is `cancun` and transaction bytecode is unchanged):
124124
```
125-
0xF545230eE44735CCDb71325c6D4bC981b444CBb6
125+
0x5391d63aBd39A43360CE360531f5Ba5c19249030
126126
```
127127
The derived address of the account that would sign the deployment transaction, and that you'd need to fund in order to pay the gas fee, is:
128128
```
129-
0x7a2c43Cb49D08a68D8F6Ac708A55716C3cd78557
129+
0x0d253cCC774aa8F6619FC6C094D961a09Ce50865
130130
```
131131

132132
#### SKYBITLite
@@ -136,7 +136,7 @@ The node package [@skybit/hardhat-yul](https://www.npmjs.com/package/@skybit/har
136136

137137
Gas used for the deployment is 78,914, so gas limit in this deployment transaction has been set to 100,000, giving some room in case some opcode costs increase in future, hence there should be at least 0.01 of native currency at the signer's address before factory deployment.
138138

139-
The SKYBITLite factory contract will be deployed to this address (if the EVM version is `shanghai` and transaction bytecode is unchanged):
139+
The SKYBITLite factory contract will be deployed to this address (if the EVM version is `cancun` and transaction bytecode is unchanged):
140140
```
141141
0x739201bA340A675624D9ADb1cc27e68F76a29765
142142
```
@@ -463,18 +463,18 @@ See also `contracts/TESTERC20.sol` in which the constructor accepts an array of
463463
An alternative is to replace `msg.sender` with `tx.origin`, but Vitalik said that we shouldn't rely on `tx.origin`. Feel free to do some research if you're curious.
464464

465465
### Invalid opcode
466-
It's generally best practice to use the latest released versions of technology. However Hardhat v2.17.3 downgraded the default EVM version from `shanghai` to `paris`. So if you want to use the latest EVM then you need to set the EVM version explicity in `hardhat.config.js` like this:
466+
It's generally best practice to use the latest released versions of technology. However Hardhat v2.17.3 downgraded the default EVM version to `paris`. So if you want to use the latest EVM then you need to set the EVM version explicity in `hardhat.config.js` like this:
467467
```js
468468
solidity: { // changing these values affects deployment address
469469
compilers: [
470470
{
471-
version: `0.8.24`,
471+
version: `0.8.26`,
472472
settings: {
473473
optimizer: {
474474
enabled: true,
475475
runs: 15000
476476
},
477-
evmVersion: `shanghai` // downgrade to `paris` if you encounter 'invalid opcode' error
477+
evmVersion: `cancun` // downgrade to `paris` if you encounter 'invalid opcode' error
478478
}
479479
},
480480
],

artifacts-saved/@axelar-network/axelar-gmp-sdk-solidity/contracts/deploy/Create3Deployer.sol/Create3Deployer.json

Lines changed: 0 additions & 149 deletions
This file was deleted.

hardhat.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ networks = { ...networks, ...additionalNetworks }
122122
// RPC URL overrides in case you dont want to use the one in viem/chains:
123123
// networks.mainnet.url = `https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`
124124

125-
networks.polygonMumbai.url = `https://polygon-mumbai.blockpi.network/v1/rpc/public`
126-
127125
networks.bscTestnet.url = `https://data-seed-prebsc-2-s2.bnbchain.org:8545`
128126

129127
networks.sepolia.url = `https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`
@@ -139,14 +137,13 @@ module.exports = {
139137
solidity: { // changing these values changes bytecode, so can affect deployment address if not using CREATE3
140138
compilers: [
141139
{
142-
version: `0.8.24`,
140+
version: `0.8.26`,
143141
settings: {
144142
optimizer: {
145143
enabled: true,
146144
runs: 15000
147145
},
148-
evmVersion: `shanghai`, // downgrade to `paris` if you encounter 'invalid opcode' error
149-
// evmVersion: `paris`,
146+
evmVersion: `cancun`,
150147
}
151148
},
152149
],

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SKYBIT-Keyless-Deployment",
3-
"version": "5.0.2",
3+
"version": "6.0.0",
44
"packageManager": "yarn@4.2.2",
55
"devDependencies": {
66
"@SKYBITDev3/ZeframLou-create3-factory": "https://github.com/SKYBITDev3/ZeframLou-create3-factory#3a8db987b8a6e1b63845a0ee1d0206cb4b5748f9",
@@ -30,7 +30,7 @@
3030
"ethers": "^6.12.1",
3131
"hardhat": "^2.22.4",
3232
"hardhat-gas-reporter": "^2.2.0",
33-
"solc": "0.8.24",
33+
"solc": "0.8.26",
3434
"solidity-coverage": "^0.8.12",
3535
"ts-node": "^10.9.2",
3636
"typechain": "^8.3.2",

scripts/deployKeylessly-TESTERC20UG.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function main() {
3030
const cfToken = await ethers.getContractFactory(artifactOfContractToDeploy.abi, artifactOfContractToDeploy.bytecode)
3131
const bytecodeWithArgs = (await cfToken.getDeployTransaction()).data // no constructor args
3232

33-
const implAddress = await deployKeylessly(contractName, bytecodeWithArgs, gasLimitForImpl, wallet, isDeployEnabled) // gas cost: 3012861
33+
const implAddress = await deployKeylessly(contractName, bytecodeWithArgs, gasLimitForImpl, wallet, isDeployEnabled)
3434
if (implAddress === undefined) return
3535

3636
const proxyContractName = `ERC1967Proxy`
@@ -41,7 +41,7 @@ async function main() {
4141

4242
const proxyBytecodeWithArgs = (await cfProxy.getDeployTransaction(...proxyConstructorArgs)).data
4343

44-
const proxyAddress = await deployKeylessly(proxyContractName, proxyBytecodeWithArgs, gasLimitForProxy, wallet, isDeployEnabled) // gas cost: 378214
44+
const proxyAddress = await deployKeylessly(proxyContractName, proxyBytecodeWithArgs, gasLimitForProxy, wallet, isDeployEnabled)
4545

4646
if (isDeployEnabled) {
4747
await upgrades.forceImport(proxyAddress, cfToken)

scripts/deployViaCREATE3-TESTERC20.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const { ethers, network } = require(`hardhat`)
22

33
// CHOOSE WHICH FACTORY YOU WANT TO USE:
4-
// const factoryToUse = { name: `axelarnetwork`, address: `0x95A9323CF0443758df5F3becf3B221cB3D42f3A0` } // gas cost: 1846094
5-
// const factoryToUse = { name: `ZeframLou`, address: `0x2befaF9234EE4d5b10dDAECF55F73dA87F74Facb` } // gas cost: 1767973
6-
// const factoryToUse = { name: `SKYBITSolady`, address: `0xF545230eE44735CCDb71325c6D4bC981b444CBb6` } // gas cost: 1743119
7-
const factoryToUse = { name: `SKYBITLite`, address: `0x739201bA340A675624D9ADb1cc27e68F76a29765` } // gas cost: 1743602
4+
// const factoryToUse = { name: `axelarnetwork`, address: `0x8cf037a598957EFE440841E256f4CA0056A8219C` }
5+
// const factoryToUse = { name: `ZeframLou`, address: `0x03B583D983aAe5a965dfCC3565F58C9153Af1Be3` }
6+
// const factoryToUse = { name: `SKYBITSolady`, address: `0x5391d63aBd39A43360CE360531f5Ba5c19249030` }
7+
const factoryToUse = { name: `SKYBITLite`, address: `0x739201bA340A675624D9ADb1cc27e68F76a29765` }
88

99

1010
const isDeployEnabled = true // toggle in case you do deployment and verification separately.

scripts/deployViaCREATE3-TESTERC20UG.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
const { ethers, network, upgrades } = require(`hardhat`)
33

44
// CHOOSE WHICH FACTORY YOU WANT TO USE:
5-
// const factoryToUse = { name: `axelarnetwork`, address: `0x95A9323CF0443758df5F3becf3B221cB3D42f3A0` } // gas cost: 2413077 + 498930
6-
// const factoryToUse = { name: `ZeframLou`, address: `0x2befaF9234EE4d5b10dDAECF55F73dA87F74Facb` } // gas cost: 2413077 + 422294
7-
// const factoryToUse = { name: `SKYBITSolady`, address: `0xF545230eE44735CCDb71325c6D4bC981b444CBb6` } // gas cost: 2413077 + 418479
8-
const factoryToUse = { name: `SKYBITLite`, address: `0x739201bA340A675624D9ADb1cc27e68F76a29765` } // gas cost: 2413077 + 419071
5+
// const factoryToUse = { name: `axelarnetwork`, address: `0x8cf037a598957EFE440841E256f4CA0056A8219C` }
6+
// const factoryToUse = { name: `ZeframLou`, address: `0x03B583D983aAe5a965dfCC3565F58C9153Af1Be3` }
7+
// const factoryToUse = { name: `SKYBITSolady`, address: `0x5391d63aBd39A43360CE360531f5Ba5c19249030` }
8+
const factoryToUse = { name: `SKYBITLite`, address: `0x739201bA340A675624D9ADb1cc27e68F76a29765` }
99

1010
const isDeployEnabled = true // toggle in case you do deployment and verification separately.
1111

@@ -67,7 +67,7 @@ async function main() {
6767
const { getArtifactOfFactory, getDeployedAddress, CREATE3Deploy } = rootRequire(`scripts/CREATE3-deploy-functions.js`)
6868

6969
if (isDeployEnabled) {
70-
proxy = await CREATE3Deploy(factoryToUse.name, factoryToUse.address, cfProxy, proxyContractName, proxyConstructorArgs, salt, wallet, isDeployEnabled) // Gas cost: 425068
70+
proxy = await CREATE3Deploy(factoryToUse.name, factoryToUse.address, cfProxy, proxyContractName, proxyConstructorArgs, salt, wallet, isDeployEnabled)
7171
if (proxy === undefined) return
7272

7373
proxyAddress = proxy.target

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ __metadata:
16391639
ethers: "npm:^6.12.1"
16401640
hardhat: "npm:^2.22.4"
16411641
hardhat-gas-reporter: "npm:^2.2.0"
1642-
solc: "npm:0.8.24"
1642+
solc: "npm:0.8.26"
16431643
solidity-coverage: "npm:^0.8.12"
16441644
ts-node: "npm:^10.9.2"
16451645
typechain: "npm:^8.3.2"
@@ -6576,9 +6576,9 @@ __metadata:
65766576
languageName: node
65776577
linkType: hard
65786578

6579-
"solc@npm:0.8.24":
6580-
version: 0.8.24
6581-
resolution: "solc@npm:0.8.24"
6579+
"solc@npm:0.8.26":
6580+
version: 0.8.26
6581+
resolution: "solc@npm:0.8.26"
65826582
dependencies:
65836583
command-exists: "npm:^1.2.8"
65846584
commander: "npm:^8.1.0"
@@ -6589,7 +6589,7 @@ __metadata:
65896589
tmp: "npm:0.0.33"
65906590
bin:
65916591
solcjs: solc.js
6592-
checksum: 10/e85644370a26a92fbdfb783ce14184fb6291ddd77ff93cc5d70019add63c32ecea9988453d02b27b99cb37f46cc99b88f33321305b3f9a5cacb9b1a6f803b607
6592+
checksum: 10/30ef9c2687f727eb5bdd685c77b1a0b354e7d6ba7a080cfcdce5a89f25a1399ff7949fecef47768088d825588da230da0044b46f056fc36f3959c0e3d3c9a82b
65936593
languageName: node
65946594
linkType: hard
65956595

0 commit comments

Comments
 (0)