Output the storage layout of a contract via storageLayout artifact

This commit is contained in:
Leonardo Alt
2019-11-14 10:19:17 +01:00
committed by chriseth
parent bc57566037
commit 5f43b8dbeb
31 changed files with 706 additions and 1 deletions
@@ -0,0 +1,16 @@
{
"language": "Solidity",
"sources": {
"fileA": {
"content": "contract A { uint[] array1; bool[] array2; }"
}
},
"settings": {
"outputSelection": {
"fileA": {
"A": [ "storageLayout" ],
"": [ "storageLayout" ]
}
}
}
}
@@ -0,0 +1,4 @@
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":3,"contract":"fileA:A","label":"array1","offset":0,"slot":"0","type":"t_array(t_uint256)dyn_storage"},{"astId":6,"contract":"fileA:A","label":"array2","offset":0,"slot":"1","type":"t_array(t_bool)dyn_storage"}],"types":{"t_array(t_bool)dyn_storage":{"base":"t_bool","encoding":"dynamic_array","label":"bool[]","numberOfBytes":"32"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","formattedMessage":"fileA:1:1: Warning: Source file does not specify required compiler version!
contract A { uint[] array1; bool[] array2; }
^------------------------------------------^
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":44,"file":"fileA","start":0},"type":"Warning"}],"sources":{"fileA":{"id":0}}}