mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-05 15:33:08 +00:00
Update test/README.md
This commit is contained in:
parent
c7cfe713e0
commit
169b4c7526
@ -47,7 +47,18 @@ implementation.
|
||||
ETH_FROM=$DEPLOYER_ACCOUNT_ADDRESS forge script test/TestStableToken.sol:TestStableTokenFactory --tc TestStableTokenFactory --rpc-url $RPC_URL --private-key $DEPLOYER_ACCOUNT_PRIVATE_KEY --broadcast
|
||||
```
|
||||
|
||||
### Update the proxy contract to point to the new implementation (safe, recommended)
|
||||
### Update the proxy contract to point to the new implementation
|
||||
|
||||
#### Option 1: Update proxy implementation address only (recommended when the cap is already set)
|
||||
|
||||
When the proxy is already initialized and the `cap` is set, you can simply update the implementation address using
|
||||
`upgradeTo(address)`.
|
||||
|
||||
```bash
|
||||
cast send $TOKEN_PROXY_ADDRESS "upgradeTo(address)" $NEW_IMPLEMENTATION_ADDRESS --rpc-url $RPC_URL --private-key $DEPLOYER_ACCOUNT_PRIVATE_KEY
|
||||
```
|
||||
|
||||
#### Option 2: Update proxy implementation address and initialize cap
|
||||
|
||||
When upgrading a UUPS/ERC1967 proxy you should perform the upgrade and initialization in the same transaction to avoid
|
||||
leaving the proxy in an uninitialized state. Use `upgradeToAndCall(address,bytes)` with the initializer calldata.
|
||||
|
||||
@ -118,8 +118,6 @@ contract TestStableToken is
|
||||
}
|
||||
|
||||
contract TestStableTokenFactory is BaseScript {
|
||||
// Use the returned implementation address with a proxy upgrade call (e.g. `upgradeToAndCall`) to atomically point a
|
||||
// proxy to the new implementation and initialize it.
|
||||
function run() public broadcast returns (address) {
|
||||
return address(new TestStableToken());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user