Skip to content

Commit

Permalink
Add storage-layout-diff
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptofish7 committed Dec 5, 2021
1 parent e8fb056 commit 5eb4e86
Show file tree
Hide file tree
Showing 46 changed files with 6,851 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ junit.xml
#Buidler files
cache
artifacts
out.html
1 change: 1 addition & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require("hardhat-deploy-ethers");
require("hardhat-spdx-license-identifier");
require("hardhat-watcher");
require("hardhat-contract-sizer");
require("hardhat-storage-layout-diff");
require("@openzeppelin/hardhat-upgrades");

const { HardhatUserConfig } = require("hardhat/types");
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"hardhat-deploy-ethers": "^0.3.0-beta.10",
"hardhat-preprocessor": "^0.1.4",
"hardhat-spdx-license-identifier": "^2.0.3",
"hardhat-storage-layout-diff": "^0.0.3",
"hardhat-watcher": "^2.1.1",
"husky": "^7.0.2",
"jest-diff": "^26.4.2",
Expand Down
47 changes: 47 additions & 0 deletions storage_layout/contracts/FlashloanLender.sol:FlashloanLender.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"storage": [
{
"astId": 2081,
"contract": "contracts/FlashloanLender.sol:FlashloanLender",
"label": "underlyingToJToken",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_address,t_address)"
},
{
"astId": 2083,
"contract": "contracts/FlashloanLender.sol:FlashloanLender",
"label": "joetroller",
"offset": 0,
"slot": "1",
"type": "t_address_payable"
},
{
"astId": 2085,
"contract": "contracts/FlashloanLender.sol:FlashloanLender",
"label": "owner",
"offset": 0,
"slot": "2",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_address_payable": {
"encoding": "inplace",
"label": "address payable",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_address)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => address)",
"numberOfBytes": "32",
"value": "t_address"
}
}
}
234 changes: 234 additions & 0 deletions storage_layout/contracts/JAvax.sol:JAvax.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"storage": [
{
"astId": 15024,
"contract": "contracts/JAvax.sol:JAvax",
"label": "_notEntered",
"offset": 0,
"slot": "0",
"type": "t_bool"
},
{
"astId": 15026,
"contract": "contracts/JAvax.sol:JAvax",
"label": "name",
"offset": 0,
"slot": "1",
"type": "t_string_storage"
},
{
"astId": 15028,
"contract": "contracts/JAvax.sol:JAvax",
"label": "symbol",
"offset": 0,
"slot": "2",
"type": "t_string_storage"
},
{
"astId": 15030,
"contract": "contracts/JAvax.sol:JAvax",
"label": "decimals",
"offset": 0,
"slot": "3",
"type": "t_uint8"
},
{
"astId": 15038,
"contract": "contracts/JAvax.sol:JAvax",
"label": "admin",
"offset": 1,
"slot": "3",
"type": "t_address_payable"
},
{
"astId": 15040,
"contract": "contracts/JAvax.sol:JAvax",
"label": "pendingAdmin",
"offset": 0,
"slot": "4",
"type": "t_address_payable"
},
{
"astId": 15042,
"contract": "contracts/JAvax.sol:JAvax",
"label": "joetroller",
"offset": 0,
"slot": "5",
"type": "t_contract(JoetrollerInterface)21466"
},
{
"astId": 15044,
"contract": "contracts/JAvax.sol:JAvax",
"label": "interestRateModel",
"offset": 0,
"slot": "6",
"type": "t_contract(InterestRateModel)2453"
},
{
"astId": 15046,
"contract": "contracts/JAvax.sol:JAvax",
"label": "initialExchangeRateMantissa",
"offset": 0,
"slot": "7",
"type": "t_uint256"
},
{
"astId": 15048,
"contract": "contracts/JAvax.sol:JAvax",
"label": "reserveFactorMantissa",
"offset": 0,
"slot": "8",
"type": "t_uint256"
},
{
"astId": 15050,
"contract": "contracts/JAvax.sol:JAvax",
"label": "accrualBlockTimestamp",
"offset": 0,
"slot": "9",
"type": "t_uint256"
},
{
"astId": 15052,
"contract": "contracts/JAvax.sol:JAvax",
"label": "borrowIndex",
"offset": 0,
"slot": "10",
"type": "t_uint256"
},
{
"astId": 15054,
"contract": "contracts/JAvax.sol:JAvax",
"label": "totalBorrows",
"offset": 0,
"slot": "11",
"type": "t_uint256"
},
{
"astId": 15056,
"contract": "contracts/JAvax.sol:JAvax",
"label": "totalReserves",
"offset": 0,
"slot": "12",
"type": "t_uint256"
},
{
"astId": 15058,
"contract": "contracts/JAvax.sol:JAvax",
"label": "totalSupply",
"offset": 0,
"slot": "13",
"type": "t_uint256"
},
{
"astId": 15062,
"contract": "contracts/JAvax.sol:JAvax",
"label": "accountTokens",
"offset": 0,
"slot": "14",
"type": "t_mapping(t_address,t_uint256)"
},
{
"astId": 15068,
"contract": "contracts/JAvax.sol:JAvax",
"label": "transferAllowances",
"offset": 0,
"slot": "15",
"type": "t_mapping(t_address,t_mapping(t_address,t_uint256))"
},
{
"astId": 15077,
"contract": "contracts/JAvax.sol:JAvax",
"label": "accountBorrows",
"offset": 0,
"slot": "16",
"type": "t_mapping(t_address,t_struct(BorrowSnapshot)15073_storage)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_address_payable": {
"encoding": "inplace",
"label": "address payable",
"numberOfBytes": "20"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(InterestRateModel)2453": {
"encoding": "inplace",
"label": "contract InterestRateModel",
"numberOfBytes": "20"
},
"t_contract(JoetrollerInterface)21466": {
"encoding": "inplace",
"label": "contract JoetrollerInterface",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_mapping(t_address,t_uint256))": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => mapping(address => uint256))",
"numberOfBytes": "32",
"value": "t_mapping(t_address,t_uint256)"
},
"t_mapping(t_address,t_struct(BorrowSnapshot)15073_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => struct JTokenStorage.BorrowSnapshot)",
"numberOfBytes": "32",
"value": "t_struct(BorrowSnapshot)15073_storage"
},
"t_mapping(t_address,t_uint256)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => uint256)",
"numberOfBytes": "32",
"value": "t_uint256"
},
"t_string_storage": {
"encoding": "bytes",
"label": "string",
"numberOfBytes": "32"
},
"t_struct(BorrowSnapshot)15073_storage": {
"encoding": "inplace",
"label": "struct JTokenStorage.BorrowSnapshot",
"members": [
{
"astId": 15070,
"contract": "contracts/JAvax.sol:JAvax",
"label": "principal",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 15072,
"contract": "contracts/JAvax.sol:JAvax",
"label": "interestIndex",
"offset": 0,
"slot": "1",
"type": "t_uint256"
}
],
"numberOfBytes": "64"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"encoding": "inplace",
"label": "uint8",
"numberOfBytes": "1"
}
}
}
Loading

0 comments on commit 5eb4e86

Please sign in to comment.