36 lines
1.6 KiB
JSON
36 lines
1.6 KiB
JSON
{
|
|
"language": "Solidity",
|
|
"sources": {
|
|
"contracts/test/TestSlot.sol": {
|
|
"content": "// SPDX-License-Identifier: Apache 2.0\npragma solidity 0.8.19;\ncontract TestSlot {\n uint public count = 123;\n address public owner = msg.sender;\n bool public isTrue = true;\n uint16 public u16 = 31;\n bytes32 private password;\n uint public constant someConst = 123;\n bytes32[3] public data;\n struct User {\n uint id;\n bytes32 password;\n }\n User[] private users;\n mapping(uint => User) private idToUser;\n constructor(bytes32 _password) {\n password = _password;\n }\n function addUser(bytes32 _password) public {\n User memory user = User({id: users.length, password: _password});\n users.push(user);\n idToUser[user.id] = user;\n }\n function getArrayLocation(uint slot, uint index, uint elementSize) public pure returns (uint) {\n return uint(keccak256(abi.encodePacked(slot))) + (index * elementSize);\n }\n function getMapLocation(uint slot, uint key) public pure returns (uint) {\n return uint(keccak256(abi.encodePacked(key, slot)));\n }\n}\n"
|
|
}
|
|
},
|
|
"settings": {
|
|
"optimizer": {
|
|
"enabled": true,
|
|
"runs": 200
|
|
},
|
|
"viaIR": true,
|
|
"outputSelection": {
|
|
"*": {
|
|
"*": [
|
|
"abi",
|
|
"evm.bytecode",
|
|
"evm.deployedBytecode",
|
|
"evm.methodIdentifiers",
|
|
"metadata",
|
|
"devdoc",
|
|
"userdoc",
|
|
"storageLayout",
|
|
"evm.gasEstimates"
|
|
],
|
|
"": [
|
|
"ast"
|
|
]
|
|
}
|
|
},
|
|
"metadata": {
|
|
"useLiteralContent": true
|
|
}
|
|
}
|
|
} |