mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-19 14:23:07 +00:00
remove unnecessary 'revert ETHTransferFailed' in mintWithETH
This commit is contained in:
parent
3491595a43
commit
6db07da0c5
@ -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
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user