-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,25 +27,44 @@ struct Attribution { | |
} | ||
|
||
library FraudMessage { | ||
uint8 public constant SIGNER_OFFSET = 0; | ||
uint8 public constant MERKLE_TREE_OFFSET = 32; | ||
uint8 public constant DIGEST_OFFSET = 64; | ||
uint8 public constant FRAUD_TYPE_OFFSET = 96; | ||
uint8 public constant TIMESTAMP_OFFSET = 97; | ||
uint8 public constant MESSAGE_LENGTH = 103; | ||
|
||
function encode( | ||
bytes32 signer, | ||
bytes32 merkleTree, | ||
bytes32 digest, | ||
Attribution memory attribution | ||
) internal pure returns (bytes memory) { | ||
return | ||
abi.encode( | ||
abi.encodePacked( | ||
signer, | ||
merkleTree, | ||
digest, | ||
attribution.fraudType, | ||
uint8(attribution.fraudType), | ||
attribution.timestamp | ||
); | ||
} | ||
|
||
function decode( | ||
bytes memory _message | ||
bytes calldata _message | ||
) internal pure returns (bytes32, bytes32, bytes32, Attribution memory) { | ||
return abi.decode(_message, (bytes32, bytes32, bytes32, Attribution)); | ||
require(_message.length == MESSAGE_LENGTH, "Invalid message length"); | ||
|
||
bytes32 signer = bytes32(_message[SIGNER_OFFSET:MERKLE_TREE_OFFSET]); | ||
Check notice Code scanning / Olympix Integrated Security Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low
Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
Check notice Code scanning / Olympix Integrated Security Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast Low
Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast
|
||
bytes32 merkleTree = bytes32( | ||
Check notice Code scanning / Olympix Integrated Security Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low
Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
Check notice Code scanning / Olympix Integrated Security Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast Low
Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast
|
||
_message[MERKLE_TREE_OFFSET:DIGEST_OFFSET] | ||
); | ||
bytes32 digest = bytes32(_message[DIGEST_OFFSET:FRAUD_TYPE_OFFSET]); | ||
Check notice Code scanning / Olympix Integrated Security Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low
Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
Check notice Code scanning / Olympix Integrated Security Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast Low
Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast
|
||
FraudType fraudType = FraudType(uint8(_message[FRAUD_TYPE_OFFSET])); | ||
Check notice Code scanning / Olympix Integrated Security Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low
Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
Check notice Code scanning / Olympix Integrated Security Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast Low
Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast
|
||
uint48 timestamp = uint48( | ||
Check notice Code scanning / Olympix Integrated Security Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low
Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
|
||
bytes6(_message[TIMESTAMP_OFFSET:MESSAGE_LENGTH]) | ||
Check notice Code scanning / Olympix Integrated Security Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast Low
Performing a narrowing downcast may result in silent overflow due to bit truncation. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unsafe-downcast
|
||
); | ||
|
||
return (signer, merkleTree, digest, Attribution(fraudType, timestamp)); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,7 @@ contract FraudProofRouter is GasRouter { | |
bytes32, | ||
/*_sender*/ | ||
bytes calldata _message | ||
) internal override onlyMailbox { | ||
) internal override { | ||
( | ||
bytes32 signer, | ||
Check notice Code scanning / Olympix Integrated Security Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low
Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
|
||
bytes32 merkleTree, | ||
Check notice Code scanning / Olympix Integrated Security Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables Low
Local variables in test functions are not properly fuzzed, potentially reducing the effectiveness of property-based testing. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-local-variables
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
@arbitrum=./node_modules/@arbitrum | ||
@eth-optimism=./node_modules/@eth-optimism | ||
@layerzerolabs=./node_modules/@layerzerolabs | ||
@openzeppelin=./node_modules/@openzeppelin | ||
@arbitrum=../node_modules/@arbitrum | ||
@eth-optimism=../node_modules/@eth-optimism | ||
@layerzerolabs=../node_modules/@layerzerolabs | ||
@openzeppelin=../node_modules/@openzeppelin | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
forge-std/=lib/forge-std/src/ | ||
fx-portal/=lib/fx-portal/ |
This file was deleted.