Skip to content

Commit

Permalink
Store genesis data in source
Browse files Browse the repository at this point in the history
  • Loading branch information
lykhonis committed Oct 25, 2023
1 parent 556a312 commit aa15f16
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 5 deletions.
32 changes: 32 additions & 0 deletions artifacts/data/4201/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"address": "0x9C87032c85713BfffbaBcA7f3F9c1CE0b2d9268b",
"claims": {
"0": {
"amount": 1,
"index": 0,
"profile": "0x30B3f161Ee7A6b5E449cB5Ad4eeABEFcd8288362",
"proof": [
"0x5b4f1479a7c282efc27e19dc088e89707dca6fcefab84b20d2a1c67a3c0bb8c3",
"0xf1d4014fd880a1aba10c63467a9dbbb7180a04763acb24d692ffab4b1829a0d8"
]
},
"1": {
"amount": 2,
"index": 1,
"profile": "0x07F15aB9F47A004A21552E6b8C81ad2b37ff52D5",
"proof": [
"0xd02435c5bba3eae5a583b45114ce6f493a215da9600637cfae109599fdd096a6",
"0xf1d4014fd880a1aba10c63467a9dbbb7180a04763acb24d692ffab4b1829a0d8"
]
},
"2": {
"amount": 3,
"index": 2,
"profile": "0x64f134CfF78A8A6EC55eF1992A36798C84460b26",
"proof": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0xb2f631ec33f45c0ed159f3d0f1b5e53ed91e458e1a7a8065714455c8d009a085"
]
}
}
}
5 changes: 4 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ src = "src"
out = "out"
libs = ["lib"]
extra_output_files = ["metadata"]
fs_permissions = [{ access = "read-write", path = "./scripts/" }]
fs_permissions = [
{ access = "read", path = "./scripts/" },
{ access = "read-write", path = "./artifacts/" },
]

# solidity compiler
solc = "0.8.17"
Expand Down
2 changes: 0 additions & 2 deletions scripts/assets/lsp7/.gitignore

This file was deleted.

11 changes: 9 additions & 2 deletions scripts/assets/lsp7/GenesisDigitalAsset.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ contract Drop is Script {
uint256 fundAmount = 0;

// build merkle tree
string memory json = vm.readFile(string.concat(vm.projectRoot(), "/scripts/assets/lsp7/genesis-drop.json"));
string memory json = vm.readFile(
string.concat(
vm.projectRoot(), "/scripts/assets/lsp7/data/", Strings.toString(block.chainid), "/genesis.json"
)
);
Data memory jsonData = abi.decode(vm.parseJson(json), (Data));

console.log("Allowlist claims:", jsonData.claims.length);
Expand Down Expand Up @@ -84,7 +88,10 @@ contract Drop is Script {
vm.serializeString("", "claims", claimsJson);
string memory json = vm.serializeAddress("", "address", address(drop));

vm.writeJson(json, string.concat(vm.projectRoot(), "/scripts/assets/lsp7/genesis-deployed.json"));
string memory outputDir =
string.concat(vm.projectRoot(), "/artifacts/data/", Strings.toString(block.chainid));
vm.createDir(outputDir, true);
vm.writeJson(json, string.concat(outputDir, "/genesis.json"));
}
}
}
16 changes: 16 additions & 0 deletions scripts/assets/lsp7/data/4201/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"claims": [
{
"profile": "0x30B3f161Ee7A6b5E449cB5Ad4eeABEFcd8288362",
"amount": 1
},
{
"profile": "0x07F15aB9F47A004A21552E6b8C81ad2b37ff52D5",
"amount": 2
},
{
"profile": "0x64f134CfF78A8A6EC55eF1992A36798C84460b26",
"amount": 3
}
]
}

0 comments on commit aa15f16

Please sign in to comment.