Open hats-bug-reporter[bot] opened 9 months ago
Thank you for participation. After carefully reviewing the submission we've concluded that this issue is INVALID.
It correctly points out that there's a missing getter for k_last
but we do not think that's a problem. We cannot think of a real-life use case that requires it. If it does, k_last
is a multiplication of reserves which are available through a public getter.
We hope you participate in the future audits of ink!.
Github username: @0xmahdirostami Twitter username: 0xmahdirostami Submission hash (on-chain): 0xc2c7040044a5b6b74de83867f009fa8914160e2543b3459bcba054938eaf4da4 Severity: minor
Description: Description
The ink! implementation lacks a function for retrieving the
k_last
state.k_last
represents the product ofreserve0
andreserve1
immediately after the most recent liquidity event. In the original Solidity implementation, the contract includes a publick_last
variable along with a getter function. However, in the Rust implementation, there is no assigned function for readingk_last
from the pair contract.Impact
The impact of this issue is considered minor. Adding a function for retrieving
k_last
from the pair contract would improve the completeness and accessibility of the contract's state.Link to Code
It's recommended to add a function for returning
k_last
, similar to the UniswapV2 implementation.This addition will enhance the contract's usability and compatibility with external systems that may need to access the
k_last
state.