Skip to content

Commit

Permalink
fix: lastId object error
Browse files Browse the repository at this point in the history
  • Loading branch information
baptistr committed Jul 12, 2024
1 parent 19a95b7 commit f4508fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const YAMcontract = new ethers.Contract(GNOSIS_CONTRACT_YAM, GNOSIS_ABI_Y
export const formatPrice = (price) => {
const priceString = price.toString();
const integerPart = priceString.slice(0, 2) || "0";
const decimalPart = priceString.slice(2).padEnd(6, '0'); // Ensure there are at least 6 decimal places
const decimalPart = priceString.slice(2).padEnd(6, '0');
return `${integerPart}.${decimalPart}`;
};

Expand Down
4 changes: 2 additions & 2 deletions discord/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ const onReady = async () => {
console.log('json/tokens.json created.');
}

lastId = await GnosisController.getOfferCount();
lastId = { id: await GnosisController.getOfferCount() }

writeFileSync('json/lastId.json', JSON.stringify({ id: lastId }));
writeFileSync('json/lastId.json', JSON.stringify(lastId));

params = JSON.parse(readFileSync('json/params.json', 'utf-8'));
const { deltaMax, yieldMin, quantityMin } = params.yamlowprice;
Expand Down

0 comments on commit f4508fb

Please sign in to comment.