Update test/README.md

This commit is contained in:
stubbsta 2025-09-19 09:25:39 +02:00
parent c7cfe713e0
commit 169b4c7526
No known key found for this signature in database
2 changed files with 12 additions and 3 deletions

View File

@ -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.

View File

@ -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());
}