You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following program constructs are unused or have repeated functionality which could be abstracted into a common function.
src/lib/mina/token/token-methods.ts:
tokenMethods(): mint(), burn(), and send() all recompute the derived token id before calling getApprovedUpdate(). Consider computing the derived token ID within the getApprovedUpdate() function.
To avoid recomputing the derived token ID in send(), the developers could have getApprovedUpdate() take the token ID as an optional parameter, and return the computed value.
src/lib/mina/token/token-contract.ts:
TokenContract.approveAccountUpdate(): This function duplicates most of the body of approveAccountUpdates().
o1js/src/lib/provable/merkle-list.ts:
from(), fromReverse(): Note that from(array) is simply fromReverse([...array].reverse()), but both functions instead implement the same logic.
MerkleListIterator, MerkleListIterator.Unsafe: Both objects implement previous() and next() methods which share the majority of their logic.
The text was updated successfully, but these errors were encountered:
kantp
added
audit
Addresses findings from the audit
info
o1js
Issues that require changes in o1js itself, rather than in this repository
labels
Jul 2, 2024
The following program constructs are unused or have repeated functionality which could be abstracted into a common function.
src/lib/mina/token/token-methods.ts
:tokenMethods()
:mint()
,burn()
, andsend()
all recompute the derived token id before callinggetApprovedUpdate()
. Consider computing the derived token ID within thegetApprovedUpdate()
function.To avoid recomputing the derived token ID in
send()
, the developers could havegetApprovedUpdate()
take the token ID as an optional parameter, and return the computed value.src/lib/mina/token/token-contract.ts
:TokenContract.approveAccountUpdate()
: This function duplicates most of the body ofapproveAccountUpdates()
.o1js/src/lib/provable/merkle-list.ts
:from()
,fromReverse()
: Note thatfrom(array)
is simplyfromReverse([...array].reverse())
, but both functions instead implement the same logic.MerkleListIterator
,MerkleListIterator.Unsafe
: Both objects implementprevious()
andnext()
methods which share the majority of their logic.The text was updated successfully, but these errors were encountered: