Skip to content

Commit 6619659

Browse files
author
Malteish
authored
Merge pull request #337 from corpus-io/develop
Update Openzeppelin
2 parents 242729b + 98040ee commit 6619659

File tree

9 files changed

+201
-74
lines changed

9 files changed

+201
-74
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,22 @@ In order to improve UX, though, a frontend will be offered. In order to improve
7272

7373
Several of the contracts implement [EIP-2771](https://eips.ethereum.org/EIPS/eip-2771), and therefore use a trusted forwarder. The forwarder will be set in the constructor and there is no way to change it after deployment. The forwarder used will be the openGSN v2 forwarder deployed on mainnet. Some information about this contract:
7474

75-
- [Documentation and addresses](https://docs-v2.opengsn.org/networks/ethereum/mainnet.html)
75+
- [Documentation and addresses](https://docs-v2.opengsn.org/)
7676
- [Code](https://github.com/opengsn/gsn/blob/v2.2.5/packages/contracts/src/forwarder/Forwarder.sol)
7777
- [Audit reports](https://docs-v2.opengsn.org/audits.html)
78-
- Deployment: **0xAa3E82b4c4093b4bA13Cb5714382C99ADBf750cA**
78+
- Deployment on Ethereum Mainnet: **0xAa3E82b4c4093b4bA13Cb5714382C99ADBf750cA**
79+
7980
- deployed 2022-04-21
81+
- [official resources](https://docs-v2.opengsn.org/networks/xdai/xdai.html)
8082
- Visit on [etherscan](https://etherscan.io/address/0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca) ([see transactions here](https://etherscan.io/txsInternal?a=0xAa3E82b4c4093b4bA13Cb5714382C99ADBf750cA&&m=advanced&p=1))
8183
- This [dashboard](https://dune.com/oren/meta-transactions-on-ethereum-over-time) lists the forwarder as second most active forwarder contract with over 2000 transactions executed
8284
- used in our [tests](./test/CrowdinvestingERC2771.t.sol).
8385

86+
- Deployment on Gnosis Chain: **0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED**
87+
- deployed 2021-04-29
88+
- [official resources](https://docs-v2.opengsn.org/networks/xdai/xdai.html)
89+
- visit on [blockscout](https://gnosis.blockscout.com/address/0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED)
90+
8491
The platform will maintain a hot wallet (EOA) in order to send transactions to the forwarder contract. This results in the following flow:
8592

8693
- contract A supports EIP-2771 and uses `forwarder` as its (one and only, immutable) trusted forwarder

docs/deployment.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ forge script script/DeployToken.s.sol --rpc-url $GOERLI_RPC_URL --verify --broa
5353
## Forwarder
5454

5555
If the forwarder has not been deployed yet, e.g. when working in a testing environment, it can be deployed like this:
56-
`forge create node_modules/@opengsn/contracts/src/forwarder/Forwarder.sol:Forwarder --private-key $PRIVATE_KEY --rpc-url $GOERLI_RPC_URL --verify --etherscan-api-key $ETHERSCAN_API_KEY`
56+
57+
```
58+
forge create node_modules/@opengsn/contracts/src/forwarder/Forwarder.sol:Forwarder --private-key $PRIVATE_KEY --rpc-url $GOERLI_RPC_URL --verify --etherscan-api-key $ETHERSCAN_API_KEY
59+
```
5760

5861
## Contract Verification
5962

@@ -120,3 +123,27 @@ Provide the constructor arguments separated by whitespace in a file like this:
120123
```
121124

122125
More info can be found [here](https://book.getfoundry.sh/reference/forge/forge-verify-contract).
126+
127+
#### Verify on Gnosis Chiado
128+
129+
Use these settings for the Chiado network:
130+
131+
```
132+
forge [... deployment commands ...] --rpc-url $CHIADO_RPC_URL --verify --verifier blockscout --verifier-url https://gnosis-chiado.blockscout.com/api?
133+
```
134+
135+
#### Verify on Gnosis Mainnet
136+
137+
- blockscout
138+
139+
```
140+
forge script script/DeployPlatform.s.sol:DeployPlatform --private-key $PRIVATE_KEY --rpc-url $GNOSIS_RPC_URL --verify --verifier blockscout --verifier-url https://gnosis.blockscout.com/api? --resume
141+
```
142+
143+
Note that the URL provided in the output will point to gnosisscan, but that is wrong. The verification only happens on blockscout.
144+
145+
- gnosisscan (requires a gnosisscan api key):
146+
147+
```
148+
forge script script/DeployPlatform.s.sol:DeployPlatform --private-key $PRIVATE_KEY --rpc-url $GNOSIS_RPC_URL --verify --etherscan-api-key $GNOSISSCAN_API_KEY --resume
149+
```

docs/deployments.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Deployments
2+
3+
## Production
4+
5+
The contracts are deployed to these production networks:
6+
7+
- Ethereum Mainnet
8+
- [Gnosis Chain](https://www.gnosis.io/)
9+
10+
These are the most relevant contracts. Those that we deployed were verified on blockscout and gnosisscan, as both explorers seem to be used by the community.
11+
12+
| Contract | Ethereum Mainnet | Gnosis Chain (fomerly xDai chain) | | Comment |
13+
| -------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- | ------- |
14+
| Forwarder | | [0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED](https://gnosis.blockscout.com/address/0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED) | These were deployed by the GSN team |
15+
| FeeSettingsCloneFactory | | [0x2659B6c5121049626363dBc1d22f267e79a0BFDE](https://gnosisscan.io/address/0x2659b6c5121049626363dbc1d22f267e79a0bfde) | |
16+
| AllowListCloneFactory | | [0x2b27853251fcEc49617f7a3E2C9809108CCC36d6](https://gnosisscan.io/address/0x2b27853251fcec49617f7a3e2c9809108ccc36d6) | |
17+
| TokenProxyFactory | | [0x994257AcCF99E5995F011AB2A3025063e5367629](https://gnosisscan.io/address/0x994257accf99e5995f011ab2a3025063e5367629) | |
18+
| VestingCloneFactory | | [0xCCC45E788bcf916b3b7cA79c2e1A1fC694aD03F7](https://gnosisscan.io/address/0xccc45e788bcf916b3b7ca79c2e1a1fc694ad03f7) | |
19+
| PrivateOfferFactory | | [0x66330A3718F68c293046d39498EDC6a043CF7190](https://gnosisscan.io/address/0x66330a3718f68c293046d39498edc6a043cf7190) | |
20+
| FeeSettings | | [0xFce9A1e8C063162f4F54f84ab8B2744D3Efc15A2](https://gnosisscan.io/address/0xFce9A1e8C063162f4F54f84ab8B2744D3Efc15A2) | |
21+
| AllowList | | [0xf2c479836b1f23eBE127CFB3B6dabf535d60B6DD](https://gnosisscan.io/address/0xf2c479836b1f23ebe127cfb3b6dabf535d60b6dd) |
22+
| CrowdinvestingCloneFactory | | [0x470586e0a7c2E641c39930B96E58E4300Be32cF3](https://gnosisscan.io/address/0x470586e0a7c2e641c39930b96e58e4300be32cf3) | | |
23+
| monerium | | [0xcB444e90D8198415266c6a2724b7900fb12FC56E](https://gnosis.blockscout.com/token/0xcB444e90D8198415266c6a2724b7900fb12FC56E) | these were deployed by the monerium team |
24+
25+
## Testing
26+
27+
The contracts are deployed to these testing networks:
28+
29+
- Sepolia
30+
- [Chiado](https://docs.gnosischain.com/concepts/networks/chiado)
31+
32+
| Contract | Sepolia | Chiado | | Comment |
33+
| -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ------- |
34+
| Forwarder | | [0x2659B6c5121049626363dBc1d22f267e79a0BFDE](https://gnosis-chiado.blockscout.com/address/0x2659B6c5121049626363dBc1d22f267e79a0BFDE) | |
35+
| FeeSettingsCloneFactory | | [0xf2c479836b1f23eBE127CFB3B6dabf535d60B6DD](https://blockscout.chiadochain.net/address/0xf2c479836b1f23ebe127cfb3b6dabf535d60b6dd) | |
36+
| AllowListCloneFactory | | [0xCCC45E788bcf916b3b7cA79c2e1A1fC694aD03F7](https://blockscout.chiadochain.net/address/0xccc45e788bcf916b3b7ca79c2e1a1fc694ad03f7) | |
37+
| TokenProxyFactory | | [0x470586e0a7c2E641c39930B96E58E4300Be32cF3](https://blockscout.chiadochain.net/address/0x470586e0a7c2e641c39930b96e58e4300be32cf3) | |
38+
| VestingCloneFactory | | [0x2CC672eac7326DC0c3E19d1B313548346Eb10FD8](https://blockscout.chiadochain.net/address/0x2cc672eac7326dc0c3e19d1b313548346eb10fd8) | |
39+
| PrivateOfferFactory | | [0x994257AcCF99E5995F011AB2A3025063e5367629](https://blockscout.chiadochain.net/address/0x994257accf99e5995f011ab2a3025063e5367629) | |
40+
| FeeSettings | | [0xab32D71F81CB897C17C9474059466bF7e117384c](https://blockscout.chiadochain.net/address/0xab32D71F81CB897C17C9474059466bF7e117384c) | |
41+
| AllowList | | [0x774AE1a25964A0DbA498Ff7b7B59B2877B0F5be6](https://blockscout.chiadochain.net/address/0x774ae1a25964a0dba498ff7b7b59b2877b0f5be6) |
42+
| CrowdinvestingCloneFactory | | [0x53B5E6Acd59021E61495AbD30796b09A25c880eD](https://blockscout.chiadochain.net/address/0x53b5e6acd59021e61495abd30796b09a25c880ed) | |
43+
| tokenize.it_USDC | | [0xC3Ea9c8BF307c7022670C88dF0357E28DA975267](https://blockscout.chiadochain.net/address/0xc3ea9c8bf307c7022670c88df0357e28da975267) | |
44+
| tokenize.it_EUROC | | [0x730653cEB98334937431e27be111369a90B9aCc7](https://blockscout.chiadochain.net/address/0x730653ceb98334937431e27be111369a90b9acc7) | |
45+
| monerium | | [0xb106ed7587365a16b6691a3D4B2A734f4E8268a2](https://gnosis-chiado.blockscout.com/address/0xb106ed7587365a16b6691a3D4B2A734f4E8268a2) | these were deployed by the monerium team |
46+
47+
On chiado, the platform cold wallet is a simple EOA with this address: 0x99b686F27413fd41F338aDD3Bce2eb60bBa7885E.

foundry.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ optimizer_runs = 10_000
1414
gas_reports = ["AllowList", "Crowdinvesting", "FeeSettings", "PrivateOffer", "PrivateOfferFactory", "Token"]
1515

1616
[rpc_endpoints]
17-
goerli = "${GOERLI_RPC_URL}"
17+
goerli = "${GOERLI_RPC_URL}"
18+
chiado = "${CHIADO_RPC_URL}"
19+
gnosis = "${GNOSIS_RPC_URL}"

hardhat.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,13 @@ const config: HardhatUserConfig = {
5555
localhost: {
5656
url: 'http://localhost:8545',
5757
},
58-
ropsten: {
59-
url: process.env.ROPSTEN_URL || '',
58+
chiado: {
59+
url: process.env.CHIADO_RPC_URL || '',
60+
accounts:
61+
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
62+
},
63+
gnosis: {
64+
url: process.env.GNOSIS_RPC_URL || '',
6065
accounts:
6166
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
6267
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
},
8383
"dependencies": {
8484
"@opengsn/contracts": "2.2.5",
85-
"@openzeppelin/contracts": "4.9.5",
86-
"@openzeppelin/contracts-upgradeable": "4.9.5"
85+
"@openzeppelin/contracts": "4.9.6",
86+
"@openzeppelin/contracts-upgradeable": "4.9.6"
8787
},
8888
"scripts": {
8989
"prepack": "yarn npmignore --auto && yarn test && yarn build ",

0 commit comments

Comments
 (0)