remove unnecessary 'revert ETHTransferFailed' in mintWithETH

This commit is contained in:
stubbsta 2025-09-05 10:24:03 +02:00
parent 3491595a43
commit 6db07da0c5
No known key found for this signature in database
3 changed files with 5 additions and 6 deletions

View File

@ -72,7 +72,9 @@ cast send $TOKEN_PROXY_ADDRESS "mint(address,uint256)" <TO_ADDRESS> <AMOUNT> --r
cast send $TOKEN_PROXY_ADDRESS "mintWithETH(address,uint256)" <TO_ACCOUNT> <AMOUNT> --value <ETH_AMOUNT> --rpc-url $RPC_URL --private-key $MINTING_ACCOUNT_PRIVATE_KEY --from $MINTING_ACCOUNT_ADDRESS
```
**Note**: The `mintWithETH` function is public and can be called by anyone. It requires sending ETH with the transaction (using `--value`), which gets burned (sent to address(0)) as an economic cost for minting tokens. This provides a permissionless way to obtain tokens for testing without requiring minter privileges.
**Note**: The `mintWithETH` function is public and can be called by anyone. It requires sending ETH with the transaction
(using `--value`), which gets burned (sent to address(0)) as an economic cost for minting tokens. This provides a
permissionless way to obtain tokens for testing without requiring minter privileges.
### Approve the token for the waku-rlnv2-contract to use

View File

@ -13,7 +13,6 @@ error AccountNotMinter();
error AccountAlreadyMinter();
error AccountNotInMinterList();
error InsufficientETH();
error ETHTransferFailed();
contract TestStableToken is
Initializable,
@ -66,8 +65,7 @@ contract TestStableToken is
if (msg.value == 0) revert InsufficientETH();
// Burn ETH by sending to zero address
(bool success,) = payable(address(0)).call{ value: msg.value }("");
if (!success) revert ETHTransferFailed();
payable(address(0)).transfer(msg.value);
_mint(to, amount);

View File

@ -7,8 +7,7 @@ import {
AccountNotMinter,
AccountAlreadyMinter,
AccountNotInMinterList,
InsufficientETH,
ETHTransferFailed
InsufficientETH
} from "./TestStableToken.sol";
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import { DeployTokenWithProxy } from "../script/DeployTokenWithProxy.s.sol";