add modifier bypass mutations

This commit is contained in:
zanderbyte-certora 2025-07-30 12:03:51 +03:00
parent a3992bc0c0
commit e21324f3ff
13 changed files with 169 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..8397373 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -221,7 +221,7 @@ contract Vault is VaultBase, Pausable, Ownable {
/// ⚠️ The account holder can also withdraw itself, so when designing a smart
/// contract that controls funds in the vault, don't assume that only this
/// smart contract can initiate a withdrawal ⚠️
- function withdraw(FundId fund, AccountId accountId) public whenNotPaused {
+ function withdraw(FundId fund, AccountId accountId) public {
Controller controller = Controller.wrap(msg.sender);
_withdraw(controller, fund, accountId);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..ac8b1cd 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -138,7 +138,7 @@ contract Vault is VaultBase, Pausable, Ownable {
FundId fundId,
AccountId accountId,
uint128 amount
- ) public whenNotPaused {
+ ) public {
Controller controller = Controller.wrap(msg.sender);
_deposit(controller, fundId, accountId, amount);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..42a3b9b 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -163,7 +163,7 @@ contract Vault is VaultBase, Pausable, Ownable {
AccountId from,
AccountId to,
uint128 amount
- ) public whenNotPaused {
+ ) public {
Controller controller = Controller.wrap(msg.sender);
_transfer(controller, fundId, from, to, amount);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..52b7db0 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -180,7 +180,7 @@ contract Vault is VaultBase, Pausable, Ownable {
AccountId from,
AccountId to,
TokensPerSecond rate
- ) public whenNotPaused {
+ ) public {
Controller controller = Controller.wrap(msg.sender);
_flow(controller, fundId, from, to, rate);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..26a17b0 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -116,7 +116,7 @@ contract Vault is VaultBase, Pausable, Ownable {
FundId fundId,
Timestamp expiry,
Timestamp maximum
- ) public whenNotPaused {
+ ) public {
Controller controller = Controller.wrap(msg.sender);
_lock(controller, fundId, expiry, maximum);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..f8fcddf 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -125,7 +125,7 @@ contract Vault is VaultBase, Pausable, Ownable {
/// the existing expiry, but no later than the maximum timestamp that was
/// provided when locking the fund.
/// Only allowed when the lock has not unlocked yet.
- function extendLock(FundId fundId, Timestamp expiry) public whenNotPaused {
+ function extendLock(FundId fundId, Timestamp expiry) public {
Controller controller = Controller.wrap(msg.sender);
_extendLock(controller, fundId, expiry);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..15af8af 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -151,7 +151,7 @@ contract Vault is VaultBase, Pausable, Ownable {
FundId fundId,
AccountId accountId,
uint128 amount
- ) public whenNotPaused {
+ ) public {
Controller controller = Controller.wrap(msg.sender);
_designate(controller, fundId, accountId, amount);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..c9b39f2 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -191,7 +191,7 @@ contract Vault is VaultBase, Pausable, Ownable {
FundId fundId,
AccountId accountId,
uint128 amount
- ) public whenNotPaused {
+ ) public {
Controller controller = Controller.wrap(msg.sender);
_burnDesignated(controller, fundId, accountId, amount);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..de9c8d2 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -202,7 +202,7 @@ contract Vault is VaultBase, Pausable, Ownable {
function burnAccount(
FundId fundId,
AccountId accountId
- ) public whenNotPaused {
+ ) public {
Controller controller = Controller.wrap(msg.sender);
_burnAccount(controller, fundId, accountId);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..4037209 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -210,7 +210,7 @@ contract Vault is VaultBase, Pausable, Ownable {
/// Freezes a fund. Stops all tokens flows and disallows any operations on the
/// fund until it unlocks.
/// Only allowed when the fund is locked.
- function freezeFund(FundId fundId) public whenNotPaused {
+ function freezeFund(FundId fundId) public {
Controller controller = Controller.wrap(msg.sender);
_freezeFund(controller, fundId);
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..0d76718 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -234,7 +234,7 @@ contract Vault is VaultBase, Pausable, Ownable {
Controller controller,
FundId fund,
AccountId accountId
- ) public {
+ ) public whenNotPaused {
(address holder, ) = Accounts.decodeId(accountId);
require(msg.sender == holder, VaultOnlyAccountHolder());
_withdraw(controller, fund, accountId);

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..c98627e 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -240,7 +240,7 @@ contract Vault is VaultBase, Pausable, Ownable {
_withdraw(controller, fund, accountId);
}
- function pause() public onlyOwner {
+ function pause() public {
_pause();
}

View File

@ -0,0 +1,13 @@
diff --git a/contracts/Vault.sol b/contracts/Vault.sol
index 8433a08..6b80271 100644
--- a/contracts/Vault.sol
+++ b/contracts/Vault.sol
@@ -244,7 +244,7 @@ contract Vault is VaultBase, Pausable, Ownable {
_pause();
}
- function unpause() public onlyOwner {
+ function unpause() public {
_unpause();
}