everx-labs / TVM-Solidity-Compiler

Solidity compiler for TVM
GNU General Public License v3.0
125 stars 72 forks source link

Proposal: Add variables to msg namespace #138

Closed pyAndr3w closed 1 year ago

pyAndr3w commented 1 year ago

Adding these two variables will allow:

  1. Find out how many coins were spent on forward (gas management)
  2. Implement custom logic with message cell. (flexibility)

msg.forwardFee

msg.forwardFee (varUint16)

Returns:


msg.cell

msg.cell (TvmCell)

Returns:

mnill commented 1 year ago

this will be really useful for gas/value calculation in dapps. please prioritise this issue.

cryshado commented 1 year ago

@pyAndr3w This is definitely a valuable suggestion, thank you! I think we should implement separate msg.forwardFee and msg.importFee or/and provide access to Message X cell to allow parse these values independently. If msg.forwardFee returns the import fee in external messages, it would be unexpected behavior.

cryshado commented 1 year ago

Implemented in 0.71.0 (2023-07-20) #141