disintar / toncli

TON Command Line Interface - easy smart contract manipulation
https://disintar.io/
Apache License 2.0
158 stars 35 forks source link

Toncli deploys into the same address every time #105

Closed avevad closed 1 year ago

avevad commented 1 year ago

Bug Type

Functional

Reproduction steps

  1. toncli deploy
  2. toncli deploy again

Actual result

The contract gets deployed to the same address over and over again, but all the times except the first TON CLI does nothing (because the address is already initialized)

Expected result

The contract deploys to a new address every time

Suggested Severity

High

Device

OS: Arch Linux x86_64 
Host: MS-7D18 2.0 
Kernel: 6.0.12-arch1-1
CPU: 11th Gen Intel i5-11600 (12) @ 4.800GHz 
GPU: Intel RocketLake-S GT1 [UHD Graphics 750] 
Memory: 15823MiB

Additional Context

No response

tvorogme commented 1 year ago

Address of smart contract in TON is calculated by StateInit hash, which includes code, data & libs. If you don't change data / code / libs you will get the same address.

If you want to save same code and data but deploy on new address, add now 32 u, in data.fif.