0 reply
0 recast
2 reactions
1 reply
0 recast
2 reactions
```
contract A {
CodeSection huffCode = CodeSection(0x0101e4, 3, 1, 3); // when used in code, huffCode is a constant that holds the code section index of the variable and not the struct defined above.
function b(uint256 _a, uint256 _b, uint256 _c) external view returns(uint256 _d) {
_d = huffCode_a, _b, _c);
}
// OR
function c(uint256 _a, uint256 _b, uint256 _c) external view returns(uint256 _d) {
assembly {
// in inline assembly, huffCode is the code section index of huffCode. The solidity version above does this under the hood.
_d := callf(huffCode, _a, _b, _c)
}
}
}
```
Also since memory is shared between code sections, similar to inline assembly the concept of memory safe code sections would also be a thing. 1 reply
0 recast
2 reactions