ton-blockchain / stablecoin-contract

Sample code for centralised stablecoin jetton. TEP-74 and TEP-89 compatible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potential error in jettonContentToCell Function of JettonMinter.ts due to Missing storeStringTail Function in Updated Builder.js

DanGlChris opened this issue · comments

Description:

There is a possible issue in the JettonMinter.ts file related to the beginCell() method from the Builder.js library. The current implementation of jettonContentToCell function uses the storeStringTail function on the result of beginCell, but it seems that the recent update in the Builder.js library has removed or renamed this function. This discrepancy is causing the jettonContentToCell function to throw an error.

Error Occurs In:
The error occurs in the jettonContentToCell function within the line range 37-48. Additionally, as a consequence, both jettonMinterConfigToCell and jettonMinterConfigFullToCell functions may produce errors if they receive a configuration where config.jetton_content is not an instance of Cell.

image

Impact:
This issue can affect any functionality relying on these methods, possibly leading to unexpected behavior or application crashes during runtime.

Steps To Reproduce:

  1. Import required libraries including the updated version of Builder.js without the storeStringTail function.
  2. Attempt to call the jettonContentToCell function using appropriate parameters.

Expected Result:
A valid cell containing the provided jetton content data.

Actual Result:
An error caused by invoking the non-existent storeStringTail function on the result of the beginCell method.

Proposed Solution:
There are two possible solutions to resolve this issue:

  1. Update the codebase to use the latest version of the Builder.js library, making necessary modifications to replace deprecated functions such as storeStringTail.
  2. If updating the library is not feasible at present, consider downgrading to a previous stable release which still contains the storeStringTail function until further updates can be made safely.

Same type of error with while creating const mintMsg. Builder.js doesn't have the function storeMaybeRef(); instead, it has the function storeRefMaybe().

image

image

Description:

There is a possible issue in the JettonMinter.ts file related to the beginCell() method from the Builder.js library. The current implementation of jettonContentToCell function uses the storeStringTail function on the result of beginCell, but it seems that the recent update in the Builder.js library has removed or renamed this function. This discrepancy is causing the jettonContentToCell function to throw an error.

Error Occurs In:
The error occurs in the jettonContentToCell function within the line range 37-48. Additionally, as a consequence, both jettonMinterConfigToCell and jettonMinterConfigFullToCell functions may produce errors if they receive a configuration where config.jetton_content is not an instance of Cell.

This bug report is based on an invalid assumption: that the code uses Builder.js (when in fact it uses @ton/core's type Builder).

Same type of error with while creating const mintMsg. Builder.js doesn't have the function storeMaybeRef(); instead, it has the function storeRefMaybe().

And this may be true, actually! I cannot find storeMaybeRef() in latest @ton/core version.

Same type of error with while creating const mintMsg. Builder.js doesn't have the function storeMaybeRef(); instead, it has the function storeRefMaybe().

And this may be true, actually! I cannot find storeMaybeRef() in latest @ton/core version.

These methods are present in the link you provided.

The @ton/core version you provided in this contest is 0.54.0 according to your package.json configuration. In that version this function on Builder.ts is written storeRefMaybe() instead of storeMaybeRef().😄 Your last core version is 0.56.0.

Screenshot_20240402-170421