Skip to content

Commit

Permalink
use float format
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Nov 3, 2024
1 parent fd18173 commit 3750014
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/concrete/receipt/CycloReceipt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
LibFixedPointDecimalArithmeticOpenZeppelin,
Math
} from "rain.math.fixedpoint/lib/LibFixedPointDecimalArithmeticOpenZeppelin.sol";
import {
LibFixedPointDecimalFormat
} from "rain.math.fixedpoint/lib/format/LibFixedPointDecimalFormat.sol";

/// @dev The SVG of Cyclo logo is pinned on IPFS.
string constant CYCLO_RECEIPT_SVG_URI = "ipfs://bafybeidjgkxfpk7nujlnx7jwvjvmtcbkfg53vnlc2cc6ftqfhapqkmtahq";
Expand All @@ -16,9 +19,9 @@ contract CycloReceipt is Receipt {
function uri(uint256 id) public view virtual override returns (string memory) {
bytes memory json = abi.encodePacked(
"{\"name\":\"Receipt for cyclo lock at ",
fixedPoint18ToDecimalString(id),
LibFixedPointDecimalFormat.fixedPointToDecimalString(id),
" USD per sFLR.\",\"description\":\"1 of these receipts can be burned alongside 1 cysFLR to redeem ",
fixedPoint18ToDecimalString(
LibFixedPointDecimalFormat.fixedPointToDecimalString(
id > 0 ? LibFixedPointDecimalArithmeticOpenZeppelin.fixedPointDiv(1e18, id, Math.Rounding.Down) : 0
),
" sFLR. Reedem at https://cyclo.finance.\",\"image\":\"", CYCLO_RECEIPT_SVG_URI, "\"}"
Expand Down

0 comments on commit 3750014

Please sign in to comment.