Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified meta/FlareFtsoSubParserAuthoringMeta.rain.meta
Binary file not shown.
Binary file modified meta/FlareFtsoWords.rain.meta
Binary file not shown.
4 changes: 2 additions & 2 deletions src/generated/FlareFtsoWords.pointers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ pragma solidity ^0.8.25;
// file needs the contract to exist so that it can be compiled.

/// @dev Hash of the known bytecode.
bytes32 constant BYTECODE_HASH = bytes32(0x69ffc4160d6551b77f501f51e6e53d7825dcd7318519779f877261ebd37b7da0);
bytes32 constant BYTECODE_HASH = bytes32(0x358d8e811b035af26e4cf1bd71f901057474799487777603aaa6ac620842bcf0);

/// @dev The hash of the meta that describes the contract.
bytes32 constant DESCRIBED_BY_META_HASH = bytes32(0x4ccb316fd35a2abbee0016f38926a4c95b6270b229c85a9acf8a3a52b36bfedc);
bytes32 constant DESCRIBED_BY_META_HASH = bytes32(0x1bff202a0cc8b25b7f81cf3d1b9e7b81c465a2d82c9082a7fdf3f87c6e7e8dbe);

/// @dev The parse meta that is used to lookup word definitions.
/// The structure of the parse meta is:
Expand Down
4 changes: 2 additions & 2 deletions src/interface/IDineroFlrEth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ pragma solidity ^0.8.25;
interface IDineroFlrEth {
//slither-disable-start naming-convention
//forge-lint: disable-next-line(mixed-case-function)
function LSTPerToken() external view returns (uint256 ethAmount);
function LSTPerToken() external view returns (uint256 ethPerFlreth18);
//slither-disable-end

//forge-lint: disable-next-line(mixed-case-function)
function tokensPerLST() external view returns (uint256 tokenAmount);
function tokensPerLST() external view returns (uint256 flrethPerEth18);
}
8 changes: 6 additions & 2 deletions src/lib/op/LibOpFtsoCurrentPricePair.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ library LibOpFtsoCurrentPricePair {
function run(OperandV2 operand, StackItem[] memory inputs) internal view returns (StackItem[] memory) {
uint256 symbolA;
assembly ("memory-safe") {
// Truncating from 3 inputs to 2, so we can forward directly to the
// `ftsoCurrentPriceUsd` opcode.
// Advance the pointer past the length slot so the virtual 2-element
// array starts at inputs[1]=symbolB. Save symbolA so it can be
// restored for the second fetch.
inputs := add(inputs, 0x20)
symbolA := mload(inputs)
mstore(inputs, 2)
Expand All @@ -60,8 +61,11 @@ library LibOpFtsoCurrentPricePair {
// above, which exposes [symbolB, timeout] as a 2-element inputs array.
StackItem[] memory denominatorOutputs = LibOpFtsoCurrentPriceUsd.run(operand, inputs);
assembly ("memory-safe") {
// Replace symbolB with symbolA so the second fetch uses symbolA.
mstore(add(inputs, 0x20), symbolA)
}
// symbolA is now at inputs[0]; the second fetch resolves the
// numerator price.
StackItem[] memory numeratorOutputs = LibOpFtsoCurrentPriceUsd.run(operand, inputs);

Float numeratorPrice;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/parse/LibFlareFtsoSubParser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ library LibFlareFtsoSubParser {
);
meta[SUB_PARSER_WORD_SFLR_EXCHANGE_RATE] = AuthoringMetaV2(
"sflr-exchange-rate",
"Returns the current sFLR per FLR exchange rate self-reported by the Sceptre staked FLR contract, i.e. how many sFLR shares correspond to 1 FLR. A value less than 1 means 1 FLR yields fewer than 1 sFLR share. Accepts 0 inputs."
"Returns the current sFLR-per-FLR exchange rate as a Rain Float, self-reported by the Sceptre staked FLR contract. Accepts 0 inputs. The value is the number of sFLR shares equivalent to 1 FLR of pooled liquidity, so a value less than 1 means 1 FLR yields fewer than 1 sFLR share (e.g. ~0.877 means 1 FLR buys 0.877 sFLR). To convert in the FLR-per-sFLR direction, take the reciprocal."
);
return abi.encode(meta);
}
Expand Down
2 changes: 1 addition & 1 deletion test/src/concrete/FlareFtsoWords.pointers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ contract FlareFtsoWordsPointersTest is Test {
);
assertEq(
m[SUB_PARSER_WORD_SFLR_EXCHANGE_RATE].description,
"Returns the current sFLR per FLR exchange rate self-reported by the Sceptre staked FLR contract, i.e. how many sFLR shares correspond to 1 FLR. A value less than 1 means 1 FLR yields fewer than 1 sFLR share. Accepts 0 inputs."
"Returns the current sFLR-per-FLR exchange rate as a Rain Float, self-reported by the Sceptre staked FLR contract. Accepts 0 inputs. The value is the number of sFLR shares equivalent to 1 FLR of pooled liquidity, so a value less than 1 means 1 FLR yields fewer than 1 sFLR share (e.g. ~0.877 means 1 FLR buys 0.877 sFLR). To convert in the FLR-per-sFLR direction, take the reciprocal."
);
}

Expand Down
Loading