Skip to content

Commit

Permalink
Merge pull request #339 from corpus-io/main
Browse files Browse the repository at this point in the history
bump release branch
  • Loading branch information
malteish authored Mar 14, 2024
2 parents 63e8d66 + 6619659 commit 9be0f69
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 74 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,22 @@ In order to improve UX, though, a frontend will be offered. In order to improve

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:

- [Documentation and addresses](https://docs-v2.opengsn.org/networks/ethereum/mainnet.html)
- [Documentation and addresses](https://docs-v2.opengsn.org/)
- [Code](https://github.com/opengsn/gsn/blob/v2.2.5/packages/contracts/src/forwarder/Forwarder.sol)
- [Audit reports](https://docs-v2.opengsn.org/audits.html)
- Deployment: **0xAa3E82b4c4093b4bA13Cb5714382C99ADBf750cA**
- Deployment on Ethereum Mainnet: **0xAa3E82b4c4093b4bA13Cb5714382C99ADBf750cA**

- deployed 2022-04-21
- [official resources](https://docs-v2.opengsn.org/networks/xdai/xdai.html)
- Visit on [etherscan](https://etherscan.io/address/0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca) ([see transactions here](https://etherscan.io/txsInternal?a=0xAa3E82b4c4093b4bA13Cb5714382C99ADBf750cA&&m=advanced&p=1))
- 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
- used in our [tests](./test/CrowdinvestingERC2771.t.sol).

- Deployment on Gnosis Chain: **0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED**
- deployed 2021-04-29
- [official resources](https://docs-v2.opengsn.org/networks/xdai/xdai.html)
- visit on [blockscout](https://gnosis.blockscout.com/address/0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED)

The platform will maintain a hot wallet (EOA) in order to send transactions to the forwarder contract. This results in the following flow:

- contract A supports EIP-2771 and uses `forwarder` as its (one and only, immutable) trusted forwarder
Expand Down
29 changes: 28 additions & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ forge script script/DeployToken.s.sol --rpc-url $GOERLI_RPC_URL --verify --broa
## Forwarder

If the forwarder has not been deployed yet, e.g. when working in a testing environment, it can be deployed like this:
`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`

```
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
```

## Contract Verification

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

More info can be found [here](https://book.getfoundry.sh/reference/forge/forge-verify-contract).

#### Verify on Gnosis Chiado

Use these settings for the Chiado network:

```
forge [... deployment commands ...] --rpc-url $CHIADO_RPC_URL --verify --verifier blockscout --verifier-url https://gnosis-chiado.blockscout.com/api?
```

#### Verify on Gnosis Mainnet

- blockscout

```
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
```

Note that the URL provided in the output will point to gnosisscan, but that is wrong. The verification only happens on blockscout.

- gnosisscan (requires a gnosisscan api key):

```
forge script script/DeployPlatform.s.sol:DeployPlatform --private-key $PRIVATE_KEY --rpc-url $GNOSIS_RPC_URL --verify --etherscan-api-key $GNOSISSCAN_API_KEY --resume
```
47 changes: 47 additions & 0 deletions docs/deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Deployments

## Production

The contracts are deployed to these production networks:

- Ethereum Mainnet
- [Gnosis Chain](https://www.gnosis.io/)

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.

| Contract | Ethereum Mainnet | Gnosis Chain (fomerly xDai chain) | | Comment |
| -------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- | ------- |
| Forwarder | | [0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED](https://gnosis.blockscout.com/address/0x7eEae829DF28F9Ce522274D5771A6Be91d00E5ED) | These were deployed by the GSN team |
| FeeSettingsCloneFactory | | [0x2659B6c5121049626363dBc1d22f267e79a0BFDE](https://gnosisscan.io/address/0x2659b6c5121049626363dbc1d22f267e79a0bfde) | |
| AllowListCloneFactory | | [0x2b27853251fcEc49617f7a3E2C9809108CCC36d6](https://gnosisscan.io/address/0x2b27853251fcec49617f7a3e2c9809108ccc36d6) | |
| TokenProxyFactory | | [0x994257AcCF99E5995F011AB2A3025063e5367629](https://gnosisscan.io/address/0x994257accf99e5995f011ab2a3025063e5367629) | |
| VestingCloneFactory | | [0xCCC45E788bcf916b3b7cA79c2e1A1fC694aD03F7](https://gnosisscan.io/address/0xccc45e788bcf916b3b7ca79c2e1a1fc694ad03f7) | |
| PrivateOfferFactory | | [0x66330A3718F68c293046d39498EDC6a043CF7190](https://gnosisscan.io/address/0x66330a3718f68c293046d39498edc6a043cf7190) | |
| FeeSettings | | [0xFce9A1e8C063162f4F54f84ab8B2744D3Efc15A2](https://gnosisscan.io/address/0xFce9A1e8C063162f4F54f84ab8B2744D3Efc15A2) | |
| AllowList | | [0xf2c479836b1f23eBE127CFB3B6dabf535d60B6DD](https://gnosisscan.io/address/0xf2c479836b1f23ebe127cfb3b6dabf535d60b6dd) |
| CrowdinvestingCloneFactory | | [0x470586e0a7c2E641c39930B96E58E4300Be32cF3](https://gnosisscan.io/address/0x470586e0a7c2e641c39930b96e58e4300be32cf3) | | |
| monerium | | [0xcB444e90D8198415266c6a2724b7900fb12FC56E](https://gnosis.blockscout.com/token/0xcB444e90D8198415266c6a2724b7900fb12FC56E) | these were deployed by the monerium team |

## Testing

The contracts are deployed to these testing networks:

- Sepolia
- [Chiado](https://docs.gnosischain.com/concepts/networks/chiado)

| Contract | Sepolia | Chiado | | Comment |
| -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ------- |
| Forwarder | | [0x2659B6c5121049626363dBc1d22f267e79a0BFDE](https://gnosis-chiado.blockscout.com/address/0x2659B6c5121049626363dBc1d22f267e79a0BFDE) | |
| FeeSettingsCloneFactory | | [0xf2c479836b1f23eBE127CFB3B6dabf535d60B6DD](https://blockscout.chiadochain.net/address/0xf2c479836b1f23ebe127cfb3b6dabf535d60b6dd) | |
| AllowListCloneFactory | | [0xCCC45E788bcf916b3b7cA79c2e1A1fC694aD03F7](https://blockscout.chiadochain.net/address/0xccc45e788bcf916b3b7ca79c2e1a1fc694ad03f7) | |
| TokenProxyFactory | | [0x470586e0a7c2E641c39930B96E58E4300Be32cF3](https://blockscout.chiadochain.net/address/0x470586e0a7c2e641c39930b96e58e4300be32cf3) | |
| VestingCloneFactory | | [0x2CC672eac7326DC0c3E19d1B313548346Eb10FD8](https://blockscout.chiadochain.net/address/0x2cc672eac7326dc0c3e19d1b313548346eb10fd8) | |
| PrivateOfferFactory | | [0x994257AcCF99E5995F011AB2A3025063e5367629](https://blockscout.chiadochain.net/address/0x994257accf99e5995f011ab2a3025063e5367629) | |
| FeeSettings | | [0xab32D71F81CB897C17C9474059466bF7e117384c](https://blockscout.chiadochain.net/address/0xab32D71F81CB897C17C9474059466bF7e117384c) | |
| AllowList | | [0x774AE1a25964A0DbA498Ff7b7B59B2877B0F5be6](https://blockscout.chiadochain.net/address/0x774ae1a25964a0dba498ff7b7b59b2877b0f5be6) |
| CrowdinvestingCloneFactory | | [0x53B5E6Acd59021E61495AbD30796b09A25c880eD](https://blockscout.chiadochain.net/address/0x53b5e6acd59021e61495abd30796b09a25c880ed) | |
| tokenize.it_USDC | | [0xC3Ea9c8BF307c7022670C88dF0357E28DA975267](https://blockscout.chiadochain.net/address/0xc3ea9c8bf307c7022670c88df0357e28da975267) | |
| tokenize.it_EUROC | | [0x730653cEB98334937431e27be111369a90B9aCc7](https://blockscout.chiadochain.net/address/0x730653ceb98334937431e27be111369a90b9acc7) | |
| monerium | | [0xb106ed7587365a16b6691a3D4B2A734f4E8268a2](https://gnosis-chiado.blockscout.com/address/0xb106ed7587365a16b6691a3D4B2A734f4E8268a2) | these were deployed by the monerium team |

On chiado, the platform cold wallet is a simple EOA with this address: 0x99b686F27413fd41F338aDD3Bce2eb60bBa7885E.
4 changes: 3 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ optimizer_runs = 10_000
gas_reports = ["AllowList", "Crowdinvesting", "FeeSettings", "PrivateOffer", "PrivateOfferFactory", "Token"]

[rpc_endpoints]
goerli = "${GOERLI_RPC_URL}"
goerli = "${GOERLI_RPC_URL}"
chiado = "${CHIADO_RPC_URL}"
gnosis = "${GNOSIS_RPC_URL}"
9 changes: 7 additions & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ const config: HardhatUserConfig = {
localhost: {
url: 'http://localhost:8545',
},
ropsten: {
url: process.env.ROPSTEN_URL || '',
chiado: {
url: process.env.CHIADO_RPC_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
gnosis: {
url: process.env.GNOSIS_RPC_URL || '',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
},
"dependencies": {
"@opengsn/contracts": "2.2.5",
"@openzeppelin/contracts": "4.9.5",
"@openzeppelin/contracts-upgradeable": "4.9.5"
"@openzeppelin/contracts": "4.9.6",
"@openzeppelin/contracts-upgradeable": "4.9.6"
},
"scripts": {
"prepack": "yarn npmignore --auto && yarn test && yarn build ",
Expand Down
Loading

0 comments on commit 9be0f69

Please sign in to comment.