You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: claim_contracts/README.md
+71Lines changed: 71 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,3 +34,74 @@ Then run the following script:
34
34
```
35
35
./deployClaim.sh
36
36
```
37
+
38
+
## Production
39
+
40
+
This is a series of steps to deploy the token to production and upgrade it if necessary.
41
+
42
+
### Safe wallet creation
43
+
44
+
First we create a wallet in [Safe](https://app.safe.global/) to represent the foundation. We assume this is done by the user. This safe will:
45
+
- Receive part of the deployed tokens.
46
+
- Own the proxy admin contract. This is the contract that can upgrade the token contract.
47
+
- Own the proxy contract. This will point to the current implementation of the contract. All users and the safe itself will interact with this contract to mint, transfer, burn, and other erc20 operations.
48
+
49
+
### Configuration
50
+
51
+
There is an example configuration file in `script-config/config.example.json`. Before deploying to production, we need to create a `config.mainnet.json` file in the same folder with the same contents as the example, but we need to change a couple of fields:
52
+
53
+
-`foundation`: this is the address of the safe that was created in the previous step.
54
+
-`claimSupplier`: this is the address of a different safe that will provide the funds for the claim contract when it is deployed.
55
+
-`deployer`: The address of the deterministic create2 deployer as specified in the [official repo](https://github.com/Arachnid/deterministic-deployment-proxy). The address should be `0x4e59b44847b379578588920ca78fbf26c0b4956c`.
56
+
-`salt`: An arbitrary value provided by the sender. This is a 32-bytes hex string. We default to 0.
57
+
58
+
### Deployment of the Token (proxy and implementation)
59
+
60
+
```bash
61
+
make deploy-token PRIVATE_KEY=<private_key> RPC_URL=<rpc_url> CONFIG=<config>
62
+
```
63
+
64
+
This make target internally executes a forge script that:
65
+
66
+
1. Deploys the token implementation that will be used only for its logic.
67
+
2. Deploys the Transparent Proxy, which also deploys the proxy admin. In this step the safe is set as the owner of both the owner of the proxy admin and the proxy (token).
68
+
69
+
The private key does NOT correspond to the safe, it needs to represent an account with sufficient funds to deploy the token.
70
+
71
+
Arguments (env variables):
72
+
-`PRIVATE_KEY`: the private key of the deployer account. This is NOT the foundation safe, just any account with enough eth for the deployment. This operation consumes approximately `3935470` gas units. As of Dec 16 2024, the gas price for a high priority is 16 gwei, which means around `0.063` eth.
73
+
-`RPC_URL`: a gateway or node that allows for rpc calls.
74
+
-`CONFIG`: the name of the configuration file. For `config.example.json` the name would be `example`. For `config.mainnet.json`, this would be `mainnet`.
75
+
76
+
The output of the deployment will look something like this:
77
+
78
+
```
79
+
== Logs ==
80
+
Aligned Token Proxy deployed at address: 0x9eDC342ADc2B73B2E36d0e77475bCF2103F09a22 with proxy admin: 0x51D94AdA2FFBFED637e6446CC991D8C65B93e167 and owner: 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
0 commit comments