Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/oft-upgradeable-shared-decimals-view.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@layerzerolabs/oft-evm-upgradeable": patch
---

Align `sharedDecimals()` mutability in `OFTCoreUpgradeable` from `pure` to `view`, matching the `IOFT` interface and `OFTCore` implementations.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ abstract contract OFTCoreUpgradeable is
* For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.
* ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615
*/
function sharedDecimals() public pure virtual returns (uint8) {
function sharedDecimals() public view virtual returns (uint8) {
return 6;
}

Expand Down
6 changes: 6 additions & 0 deletions packages/oft-evm-upgradeable/test/OFT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -555,4 +555,10 @@ contract OFTTest is TestHelperOz5 {
vm.expectRevert(abi.encodeWithSelector(IOAppMsgInspector.InspectionFailed.selector, message, extraOptions));
(message, ) = aOFT.buildMsgAndOptions(sendParam, amountToCreditLD);
}

function test_shared_decimals_view() public view {
assertEq(aOFT.sharedDecimals(), 6);
assertEq(bOFT.sharedDecimals(), 6);
assertEq(cOFTAdapter.sharedDecimals(), 6);
}
}