Commit 88dde7c8 authored by Maurelian's avatar Maurelian Committed by GitHub

fix(ctb): N-03 Assert for impossible condition (#3449)

* fix(ctb): N-03 Assert for impossible condition

* fix(ctb): N-04  Confusing else conditions in ProxyAdmin

* chore: Regen bindings

* chore: regen bindings
Co-authored-by: default avatarMatthew Slipper <me@matthewslipper.com>
parent 7375a949
---
'@eth-optimism/contracts-bedrock': patch
---
Uses assert rather than a require statements to check for conditions we believe are unreachable.This is more semantically explicit, and should enable us to more effectively use some advanced analysis methods in our testing.
---
'@eth-optimism/contracts-bedrock': patch
---
Use assert statements for unreachable conditions.
This diff is collapsed.
......@@ -288,8 +288,9 @@ abstract contract CrossDomainMessenger is
);
if (_isOtherMessenger()) {
// Should never happen.
require(msg.value == _value, "CrossDomainMessenger: mismatched message value");
// This property should always hold when the message is first submitted (as opposed to
// being replayed).
assert(msg.value == _value);
} else {
require(
msg.value == 0,
......
......@@ -248,7 +248,9 @@ contract ProxyAdmin is Owned {
string memory name = implementationName[_proxy];
addressManager.setAddress(name, _implementation);
} else {
revert("ProxyAdmin: unknown proxy type");
// It should not be possible to retrieve a ProxyType value which is not matched by
// one of the previous conditions.
assert(false);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment