-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add data and parsing for initial supplies and well balances (#1088)
- Loading branch information
Showing
6 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
protocol/reseed/data/exports/contract-circulating20736200.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"beanstalk": { | ||
"beans": "32952499881747", | ||
"unripeBeans": "107495547853813", | ||
"unripeLp": "67632589795645" | ||
}, | ||
"pools": { | ||
"beanweth": { | ||
"bean": "107380655868", | ||
"weth": "20582720189638019906" | ||
}, | ||
"beanwsteth": { | ||
"bean": "14544578478380", | ||
"wsteth": "2361659050325418670234" | ||
}, | ||
"bean3crv": { | ||
"bean": "83855245277", | ||
"3crv": "20668624046092866087554" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
["10000000000", "10000000000", "10000000000"] | ||
[ | ||
"32952499881747", | ||
"107495547853813", | ||
"67632589795645" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[ | ||
["1000000000", "10000000000000"], | ||
["1000000000", "1000000000000"], | ||
["1000000000", "1000000000"] | ||
["107380655868", "20582720189638019906"], | ||
["14544578478380", "2361659050325418670234"], | ||
["83855245277", "20668624046092866087554"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const fs = require("fs"); | ||
const { convertToBigNum } = require("../../utils/read.js"); // Assuming you have a conversion utility function | ||
|
||
function parseTokens(inputFilePath, outputFilePaths) { | ||
try { | ||
// Read the input file | ||
const data = JSON.parse(fs.readFileSync(inputFilePath, "utf8")); | ||
|
||
// Extract the initial supply from the "beanstalk" section | ||
const L2_initial_supply = [ | ||
data.beanstalk.beans, | ||
data.beanstalk.unripeBeans, | ||
data.beanstalk.unripeLp | ||
]; | ||
|
||
// Extract the well balances from the "pools" section | ||
const L2_well_balances = [ | ||
[data.pools.beanweth.bean, data.pools.beanweth.weth], | ||
[data.pools.beanwsteth.bean, data.pools.beanwsteth.wsteth], | ||
[data.pools.bean3crv.bean, data.pools.bean3crv["3crv"]] | ||
]; | ||
|
||
// Write the JSON files to the specified output paths | ||
fs.writeFileSync(outputFilePaths.L2_initial_supply, JSON.stringify(L2_initial_supply, null, 2)); | ||
fs.writeFileSync(outputFilePaths.L2_well_balances, JSON.stringify(L2_well_balances, null, 2)); | ||
|
||
console.log("Token Reserves and Supplies JSONs have been written successfully"); | ||
} catch (err) { | ||
console.error("Error:", err); | ||
} | ||
} | ||
|
||
exports.parseTokens = parseTokens; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters