Files
Cyrill Leutwiler d2f76b645f switch to pallet_revive runtime (#40)
Signed-off-by: xermicus <cyrill@parity.io>
2024-09-03 17:18:22 +02:00

66 lines
1.2 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
/* runner.json
{
"actions": [
{
"Instantiate": {
"code": {
"Solidity": {
"contract": "MSize",
"solc_optimizer": false
}
}
}
},
{
"Call": {
"dest": {
"Instantiated": 0
},
"data": "f016832c"
}
},
{
"VerifyCall": {
"success": true,
"output": "0000000000000000000000000000000000000000000000000000000000000060"
}
},
{
"Call": {
"dest": {
"Instantiated": 0
},
"data": "f4a63aa5"
}
},
{
"VerifyCall": {
"success": true,
"output": "0000000000000000000000000000000000000000000000000000000000000084"
}
}
]
}
*/
contract MSize {
uint[] public data;
function mSize() public pure returns (uint size) {
assembly {
size := msize()
}
}
function mStore100() public pure returns (uint size) {
assembly {
mstore(100, msize())
size := msize()
}
}
}