diff --git a/docs/guides/manage-warp-route-limits.mdx b/docs/guides/manage-warp-route-limits.mdx new file mode 100644 index 00000000..4d03ac8a --- /dev/null +++ b/docs/guides/manage-warp-route-limits.mdx @@ -0,0 +1,33 @@ +# 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](https://github.com/defi-wonderland/xERC20/blob/main/solidity/contracts/XERC20.sol) is transferred to a secure multisig for security purposes. This step is crucial to prevent unauthorized changes. +- The `xERC20` contract uses OpenZeppelin's `Ownable` interface. Use the `transferOwnership` function to complete this step. +2. **Mint Limit Configuration**: +- The minting and burning limits for the Warp Route contract are managed through the [`setLimits`](https://github.com/defi-wonderland/xERC20/blob/main/solidity/contracts/XERC20.sol#L85) function in the `xERC20` contract. This function must be called by the contract owner. + - The `xERC20` contract uses a 24-hour window to manage limits. This is defined by the [`_DURATION`](https://github.com/defi-wonderland/xERC20/blob/main/solidity/contracts/XERC20.sol#L13) variable, which is set to 1 days (24 hours). The current available limits are calculated dynamically using the [`_getCurrentLimit`](https://github.com/defi-wonderland/xERC20/blob/main/solidity/contracts/XERC20.sol#L234) function. + - If 24 hours (`_DURATION`) have passed since the last use, the limit will automatically restore to the full `maxLimit`. +- Ensure limits are appropriate for the expected volume to prevent disruptions. Review and adjust the limits based on transaction volumes and expected usage patterns. + +## 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`. + +The owner and controller should typically be set to a Safe multisig for enhanced security, the minter is the Warp Route contract address on the local chain. Mint limits for `FiatToken` are absolute, meaning they do not reset automatically and must be updated if required. + +There are three actions that should be set on the `MasterMinter` contract to be ready for usage: + +1. **Remove the previous test controller:**: +- 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. **Set the controller and minter:** +- 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. **Set the mint limit for the minter:** +- 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. diff --git a/sidebars.js b/sidebars.js index 0ecc4d7b..4ba7fdaa 100644 --- a/sidebars.js +++ b/sidebars.js @@ -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", + }, ], }, {