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

chore(protocol): rename a state variable name in ERC20Vault #17331

Merged
merged 4 commits into from
May 25, 2024
Merged
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
2 changes: 1 addition & 1 deletion packages/protocol/contract_layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
| __gap | uint256[50] | 251 | 0 | 1600 | contracts/tokenvault/ERC20Vault.sol:ERC20Vault |
| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | contracts/tokenvault/ERC20Vault.sol:ERC20Vault |
| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | contracts/tokenvault/ERC20Vault.sol:ERC20Vault |
| btokenBlacklist | mapping(address => bool) | 303 | 0 | 32 | contracts/tokenvault/ERC20Vault.sol:ERC20Vault |
| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | contracts/tokenvault/ERC20Vault.sol:ERC20Vault |
| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | contracts/tokenvault/ERC20Vault.sol:ERC20Vault |
| __gap | uint256[46] | 305 | 0 | 1472 | contracts/tokenvault/ERC20Vault.sol:ERC20Vault |

Expand Down
8 changes: 4 additions & 4 deletions packages/protocol/contracts/tokenvault/ERC20Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ contract ERC20Vault is BaseVault {
mapping(uint256 chainId => mapping(address ctoken => address btoken)) public canonicalToBridged;

/// @notice Mappings from bridged tokens to their blacklist status.
mapping(address btoken => bool blacklisted) public btokenBlacklist;
mapping(address btoken => bool denied) public btokenDenylist;

/// @notice Mappings from ctoken to its last migration timestamp.
mapping(uint256 chainId => mapping(address ctoken => uint256 timestamp)) public
Expand Down Expand Up @@ -180,7 +180,7 @@ contract ERC20Vault is BaseVault {
revert VAULT_INVALID_CTOKEN();
}

if (btokenBlacklist[_btokenNew]) revert VAULT_BTOKEN_BLACKLISTED();
if (btokenDenylist[_btokenNew]) revert VAULT_BTOKEN_BLACKLISTED();

uint256 _lastMigrationStart = lastMigrationStart[_ctoken.chainId][_ctoken.addr];
if (block.timestamp < _lastMigrationStart + MIN_MIGRATION_DELAY) {
Expand All @@ -198,7 +198,7 @@ contract ERC20Vault is BaseVault {
}

delete bridgedToCanonical[btokenOld_];
btokenBlacklist[btokenOld_] = true;
btokenDenylist[btokenOld_] = true;

// Start the migration
if (
Expand Down Expand Up @@ -239,7 +239,7 @@ contract ERC20Vault is BaseVault {
{
if (_op.amount == 0) revert VAULT_INVALID_AMOUNT();
if (_op.token == address(0)) revert VAULT_INVALID_TOKEN();
if (btokenBlacklist[_op.token]) revert VAULT_BTOKEN_BLACKLISTED();
if (btokenDenylist[_op.token]) revert VAULT_BTOKEN_BLACKLISTED();
if (msg.value < _op.fee) revert VAULT_INSURFICIENT_FEE();

(bytes memory data, CanonicalERC20 memory ctoken, uint256 balanceChange) =
Expand Down