Calldatasize constraints
See original GitHub issueWhen there is a constraint on some calldata[x] != 0
then there should be a constraint that the calldatasize > x
Take the example by Chofhe from discord( @nbanmp ):
contract Suicide {
uint256 isAllowed = 0;
function kill(address addr, uint256 isAllowed) {
require(isAllowed == 42);
require(msg.data.length == 4);
selfdestruct(addr);
}
}
Where mythril now reports a false positive
Proposed solution
Add the following constraint on calldataload:
# given variables: index, caldataload[index], calldatasize
Or(calldataload[index] == 0, index < calldatasize)
Good first issue
This issue is labeled as a good first issue. Hop by on our discord server if you’d like to contribute!
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Ethereum in Depth, Part 2 - OpenZeppelin blog
CALLDATASIZE tells the size of the transaction data. CALLDATALOAD loads 32 bytes of the transaction data onto the stack. CALLDATACOPY copies a ...
Read more >Inline Assembly — Solidity 0.8.17 documentation
Inline Assembly . You can interleave Solidity statements with inline assembly in a language close to the one of the Ethereum Virtual...
Read more >Calldatasize constraints | consensys Funded Issue Detail | Gitcoin ...
When there is a constraint on some ```calldata[x] != 0``` then there should be a constraint that the ```calldatasize > x``` Take the...
Read more >Meteor.call data size constraints? - help
I'm using peerlibrary:metor-file in my application to read in fles using the HTML5 handler. Afterwards, I want to push them to the server ......
Read more >Optimizer: Function Constraint Summarizer · Issue #10809
... we need to know constraints on the return values of some builtin functions: calldatasize cannot be too large, address is also bounded ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gitcoinbot https://github.com/ConsenSys/mythril-classic/pull/557 now correctly achieves this.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
The funding of 0.6 ETH (122.81 USD @ $204.68/ETH) attached to this issue has been approved & issued to @nbanmp.