2020-03-20 23:32:30 +00:00
|
|
|
contract buggystruct {
|
|
|
|
Buggy public bug;
|
|
|
|
|
|
|
|
struct Buggy {
|
|
|
|
uint256 first;
|
|
|
|
uint256 second;
|
|
|
|
uint256 third;
|
|
|
|
string last;
|
|
|
|
}
|
|
|
|
|
2020-06-23 12:14:24 +00:00
|
|
|
constructor() {
|
2020-03-20 23:32:30 +00:00
|
|
|
bug = Buggy(10, 20, 30, "asdfghjkl");
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFirst() public returns (uint256) {
|
|
|
|
return bug.first;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getSecond() public returns (uint256) {
|
|
|
|
return bug.second;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getThird() public returns (uint256) {
|
|
|
|
return bug.third;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getLast() public returns (string memory) {
|
|
|
|
return bug.last;
|
|
|
|
}
|
|
|
|
}
|
2020-12-09 17:38:17 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-03-20 23:32:30 +00:00
|
|
|
// ----
|
|
|
|
// getFirst() -> 0x0a
|
|
|
|
// getSecond() -> 0x14
|
|
|
|
// getThird() -> 0x1e
|
|
|
|
// getLast() -> 0x20, 0x09, "asdfghjkl"
|