|
1 | | -# waku-rlnv2-contract [![Github Actions][gha-badge]][gha] [![Foundry][foundry-badge]][foundry] [![License: MIT][license-badge]][license] |
| 1 | +# logos-messaging-rlnv2-contract [![Github Actions][gha-badge]][gha] [![Foundry][foundry-badge]][foundry] [![License: MIT][license-badge]][license] |
2 | 2 |
|
3 | 3 | [gha]: https://github.com/waku-org/waku-rlnv2-contract/actions |
4 | 4 | [gha-badge]: https://github.com/waku-org/waku-rlnv2-contract/actions/workflows/ci.yml/badge.svg |
|
7 | 7 | [license]: https://opensource.org/licenses/MIT |
8 | 8 | [license-badge]: https://img.shields.io/badge/License-MIT-blue.svg |
9 | 9 |
|
10 | | -Waku's RLNv2 contracts, which include - |
| 10 | +logos-messaging's RLNv2 contracts, which include - |
11 | 11 |
|
12 | 12 | - LazyIMT, which allows the root of the chain to be accessible on-chain. |
13 | 13 |
|
@@ -68,31 +68,48 @@ $ forge coverage |
68 | 68 |
|
69 | 69 | #### Deploy to Anvil: |
70 | 70 |
|
| 71 | +The following deployment will deploy several contracts required by the Logos Messaging RLNv2 contract and then deploy |
| 72 | +the Logos Messaging RLNv2 implementation contract as well as a proxy contract. |
| 73 | + |
71 | 74 | ```sh |
72 | 75 | $ TOKEN_ADDRESS=0x1122334455667788990011223344556677889900 forge script script/Deploy.s.sol --broadcast --rpc-url localhost --tc Deploy |
73 | 76 | ``` |
74 | 77 |
|
75 | | -Replace the `TOKEN_ADDRESS` value by a token address you have deployed on anvil. A `TestToken` is available in |
76 | | -`test/TestToken.sol` and can be deployed with |
| 78 | +Replace the `TOKEN_ADDRESS` value by a token address you have deployed on anvil. A `TestToken` implementation is |
| 79 | +available in `test/TestStableToken.sol` and can be deployed with a proxy using the following command (use the proxy |
| 80 | +address in the above command): |
77 | 81 |
|
78 | 82 | ```sh |
79 | | -forge script test/TestToken.sol --broadcast --rpc-url localhost --tc TestTokenFactory |
| 83 | +(ETH_FROM=$ETH_FROM forge script script/DeployTokenWithProxy.s.sol:DeployTokenWithProxy --broadcast -vvvv --rpc-url http://localhost --private-key $PRIVATE_KEY) |
80 | 84 | ``` |
81 | 85 |
|
82 | 86 | For this script to work, you need to have a `MNEMONIC` environment variable set to a valid |
83 | 87 | [BIP39 mnemonic](https://iancoleman.io/bip39/). |
84 | 88 |
|
85 | | -#### Deploy to Sepolia: |
| 89 | +#### Deploy to Linea Sepolia: |
86 | 90 |
|
87 | 91 | Ensure that you use the [cast wallet](https://book.getfoundry.sh/reference/cast/cast-wallet) to store private keys that |
88 | 92 | will be used in deployments. |
89 | 93 |
|
90 | 94 | ```sh |
| 95 | +$ export ETH_FROM=<your-wallet-address> |
| 96 | +$ export TOKEN_ADDRESS=<token-address> |
91 | 97 | $ export RPC_URL=<rpc-url> |
92 | | -$ export ACCOUNT=<account name in foundry keystore> |
93 | | -$ pnpm deploy:sepolia |
| 98 | +$ export API_KEY_LINEASCAN=<api-key-lineascan> |
| 99 | +$ export API_KEY_ETHERSCAN=123 #(dummy value) |
| 100 | +$ export API_KEY_CARDONA=123 #(dummy value) |
| 101 | +$ export ACCOUNT=<account name in cast wallet> |
| 102 | +$ pnpm deploy:linea_sepolia |
94 | 103 | ``` |
95 | 104 |
|
| 105 | +This should deploy the following contracts: |
| 106 | + |
| 107 | +- PoseidonT3: used by the logos-messaging-rlnv2-contract to generate the cryptographic commitments stored in the merkle |
| 108 | + tree |
| 109 | +- LinearPriceCalculator: calculator used by logos-messaging-rlnv2-contract to determine the price of a membership |
| 110 | +- WakuRlnV2: the implementation contract |
| 111 | +- WakuRlnV2 Proxy: the proxy contract pointing to the implementation contract |
| 112 | + |
96 | 113 | ### Format |
97 | 114 |
|
98 | 115 | Format the contracts: |
|
0 commit comments