From e48687f22003e4f75b05ad146da8ae4762a4ae37 Mon Sep 17 00:00:00 2001 From: nambrot Date: Sun, 29 Dec 2024 19:55:09 -0500 Subject: [PATCH 1/5] FiatToken limits --- docs/guides/manage-warp-route-limits.mdx | 19 +++++++++++++++++++ sidebars.js | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 docs/guides/manage-warp-route-limits.mdx diff --git a/docs/guides/manage-warp-route-limits.mdx b/docs/guides/manage-warp-route-limits.mdx new file mode 100644 index 00000000..579417c9 --- /dev/null +++ b/docs/guides/manage-warp-route-limits.mdx @@ -0,0 +1,19 @@ +# Manage Warp Route Limits on xERC20 and FiatToken + +## FiatToken deploys + +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, 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 continously reset, so either set it to a suficiently 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", + }, ], }, { From 84b0ad2889b5810e593bf99871586712ea57bc6f Mon Sep 17 00:00:00 2001 From: Eda Akturk Date: Tue, 7 Jan 2025 11:55:37 +0300 Subject: [PATCH 2/5] Add xerc20 deployment section and fix typos --- docs/guides/manage-warp-route-limits.mdx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/guides/manage-warp-route-limits.mdx b/docs/guides/manage-warp-route-limits.mdx index 579417c9..b35ab95f 100644 --- a/docs/guides/manage-warp-route-limits.mdx +++ b/docs/guides/manage-warp-route-limits.mdx @@ -1,6 +1,19 @@ # Manage Warp Route Limits on xERC20 and FiatToken -## FiatToken deploys +## xERC20 Deployments + +Warp Routes support [`xERC20` tokens](https://github.com/defi-wonderland/xERC20). + +Here's how 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` 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. + +## 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: @@ -8,12 +21,12 @@ Warp Routes support [Circle's Bridged USDC in the form of a minter for `FiatToke 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, the minter is the warp route contract address on the local chain. +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 continously reset, so either set it to a suficiently large value (like `cast max-uint`) or monitor the usage and adjust accordingly. +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. From 036b348a0b68449c4b8d60d9bf31bbf3bf818455 Mon Sep 17 00:00:00 2001 From: Eda Akturk Date: Tue, 7 Jan 2025 12:01:36 +0300 Subject: [PATCH 3/5] formating and grammar fix --- docs/guides/manage-warp-route-limits.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/guides/manage-warp-route-limits.mdx b/docs/guides/manage-warp-route-limits.mdx index b35ab95f..13ac4c00 100644 --- a/docs/guides/manage-warp-route-limits.mdx +++ b/docs/guides/manage-warp-route-limits.mdx @@ -2,9 +2,7 @@ ## xERC20 Deployments -Warp Routes support [`xERC20` tokens](https://github.com/defi-wonderland/xERC20). - -Here's how to configure `xERC20` for Warp Route usage: +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. @@ -15,7 +13,7 @@ Here's how to configure `xERC20` for Warp Route usage: ## 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: +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. From 1ac9078c95bc9c5cc8929a245fe5f0c78e17480b Mon Sep 17 00:00:00 2001 From: Eda Akturk Date: Tue, 7 Jan 2025 21:09:26 +0300 Subject: [PATCH 4/5] add link to setLimits --- docs/guides/manage-warp-route-limits.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/manage-warp-route-limits.mdx b/docs/guides/manage-warp-route-limits.mdx index 13ac4c00..3b220adb 100644 --- a/docs/guides/manage-warp-route-limits.mdx +++ b/docs/guides/manage-warp-route-limits.mdx @@ -8,7 +8,7 @@ Warp Routes support [`xERC20` tokens](https://github.com/defi-wonderland/xERC20) - 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` function. +- 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. ## FiatToken Deployments From af70d586a9e1f42e814d4e86cb1ecb8d06f9c053 Mon Sep 17 00:00:00 2001 From: Eda Akturk Date: Wed, 8 Jan 2025 07:02:46 +0300 Subject: [PATCH 5/5] xERC20 add 24 hour limit window --- docs/guides/manage-warp-route-limits.mdx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/guides/manage-warp-route-limits.mdx b/docs/guides/manage-warp-route-limits.mdx index 3b220adb..9526270f 100644 --- a/docs/guides/manage-warp-route-limits.mdx +++ b/docs/guides/manage-warp-route-limits.mdx @@ -5,10 +5,12 @@ 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. +- 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**: -- 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. +- 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