Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FiatToken limits #285

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/guides/manage-warp-route-limits.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Manage Warp Route Limits on xERC20 and FiatToken

## xERC20 Deployments

Warp Routes support [`xERC20` tokens](https://github.com/defi-wonderland/xERC20). Follow these steps to configure `xERC20` for Warp Route usage:

1. **Ownership Transfer**:
- Ensure that the ownership of the `xERC20` contract is transferred to a secure multisig for security purposes. This step is crucial to prevent unauthorized changes.
- The [`xERC20` contract](https://github.com/defi-wonderland/xERC20/blob/main/solidity/contracts/XERC20.sol) uses OpenZeppelin's `Ownable` interface. Use the `transferOwnership` function to complete this step.
2. **Mint Limit Configuration**:
- Set appropriate mint and burn limits for the Warp Route contract. This configuration must be done by the owner of the `xERC20` contract from the [`setLimits`](https://github.com/defi-wonderland/xERC20/blob/main/solidity/contracts/XERC20.sol#L85) function.
- Ensure limits are appropriate for the expected volume to prevent disruptions. Review and adjust the limits based on transaction volumes and expected usage patterns.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important to note that xerc20 limits are per 24hs, while the fiattoken ones are absolute


## FiatToken Deployments

Warp Routes support [Circle's Bridged USDC in the form of a minter for `FiatToken`](https://github.com/circlefin/stablecoin-evm) (See more on the repo for documentation). There are three roles that are relevant on the `FiatToken` and `MasterMinter` contracts:

1. `MasterMinter` owner is the account that can set controllers and minters.
2. `MasterMinter` controller is the account that can set the mint limits for its assigned minters.
3. `MasterMinter` minter is the account that can actually call `mint` on `FiatToken`.

Owner and controller should be typically set to a Safe multisig for enhanced security, the minter is the warp route contract address on the local chain.

There are three actions that should be set on the `MasterMinter` contract to be ready for usage:

1. As the owner, remove the previous test controller via the [`removeController(address _controller)` function](https://github.com/circlefin/stablecoin-evm/blob/master/contracts/minting/Controller.sol#L87C14-L87C51)
2. As the owner, you should set the controller and minter via the [`configureController(address controller, address worker)` funcition](https://github.com/circlefin/stablecoin-evm/blob/master/contracts/minting/Controller.sol#L70). The controller can be the same as the owner, the minter should be the warp route address.
3. As the controller, you should set the mint limit for the minter via the [`configureMinter(uint256 _newAllowance)` function](https://github.com/circlefin/stablecoin-evm/blob/master/contracts/minting/MintController.sol#L116). This limit is not being continuously reset, so either set it to a sufficiently large value (like `cast max-uint`) or monitor the usage and adjust accordingly.


5 changes: 5 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ const sidebars = {
id: "guides/deploy-svm-warp-route",
label: "Deploy an SVM Warp Route",
},
{
type: "doc",
id: "guides/manage-warp-route-limits",
label: "Mangaging Warp Route Limits",
},
],
},
{
Expand Down