Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "pragma strict-purity-check" and require pre-declarations in FunC #726

Open
wants to merge 10 commits into
base: testnet
Choose a base branch
from
53 changes: 30 additions & 23 deletions crypto/func/auto-tests/legacy_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,47 @@
import tempfile
import shutil

add_pragmas = [] #["allow-post-modification", "compute-asm-ltr"];
add_pragmas = []

tests = [
# note, that deployed version of elector,config and multisig differ since it is compilled with func-0.1.0.
# Newer compillators optimize arithmetic and logic expression that can be calculated at the compile time
["elector/elector-code.fc", 115226404411715505328583639896096915745686314074575650766750648324043316883483],
["config/config-code.fc", 10913070768607625342121305745084703121685937915388357634624451844356456145601],
["eth-bridge-multisig/multisig-code.fc", 101509909129354488841890823627011033360100627957439967918234053299675481277954],
# FunC v0.5.0 enabled compute-asm-ltd and allow-post-modifications by default, this changed almost all compilations

["bsc-bridge-collector/votes-collector.fc", 62190447221288642706570413295807615918589884489514159926097051017036969900417],
["uni-lock-wallet/uni-lockup-wallet.fc", 61959738324779104851267145467044677651344601417998258530238254441977103654381],
["nft-collection/nft-collection-editable.fc", 45561997735512210616567774035540357815786262097548276229169737015839077731274],
["dns-collection/nft-collection.fc", 107999822699841936063083742021519765435859194241091312445235370766165379261859],
["elector/elector-code.fc", 96915288474895095375636985346314354662782784860648058159878921867365312683154],
["config/config-code.fc", 22290399841823616942485152190379024190655691555189464909245612965253206016940],
["eth-bridge-multisig/multisig-code.fc", 61794576422183943960272839720117943378686303983578297509099019523440847170337],

["bsc-bridge-collector/votes-collector.fc", 92944270384900724656771477263840139047476985690583064733832286422277180224175],
["uni-lock-wallet/uni-lockup-wallet.fc", 27323712737699566411771249412638860892056222617959925563185009479925143218351],
["nft-collection/nft-collection-editable.fc", 3265272879406938912616104900469474227258611213495548733729957432831667074606],
["dns-collection/nft-collection.fc", 50100285311144683401305558797522852568981620193836838830789475785944491291928],


# note, that deployed version of tele-nft-item differs since it is compilled with func-0.3.0.
# After introducing of try/catch construction, c2 register is not always the default one.
# Thus it is necessary to save it upon jumps, differences of deployed and below compilled is that
# "c2 SAVE" is added to the beginning of recv_internal. It does not change behavior.
["tele-nft-item/nft-item.fc", 69777543125381987786450436977742010705076866061362104025338034583422166453344],

["storage/storage-contract.fc", 91377830060355733016937375216020277778264560226873154627574229667513068328151],
["storage/storage-provider.fc", 13618336676213331164384407184540461509022654507176709588621016553953760588122],
["nominator-pool/pool.fc", 69767057279163099864792356875696330339149706521019810113334238732928422055375],
["jetton-minter/jetton-minter.fc", 9028309926287301331466371999814928201427184114165428257502393474125007156494],
["gg-marketplace/nft-marketplace-v2.fc", 92199806964112524639740773542356508485601908152150843819273107618799016205930],
["jetton-wallet/jetton-wallet.fc", 86251125787443633057458168028617933212663498001665054651523310772884328206542],
["whales-nominators/nominators.fc", 8941364499854379927692172316865293429893094891593442801401542636695127885153],


["tact-examples/treasure_Treasure.code.fc", 13962538639825790677138656603323869918938565499584297120566680287245364723897],
["tact-examples/jetton_SampleJetton.code.fc", 94076762218493729104783735200107713211245710256802265203823917715299139499110],
["tact-examples/jetton_JettonDefaultWallet.code.fc", 29421313492520031238091587108198906058157443241743283101866538036369069620563],
["tact-examples/maps_MapTestContract.code.fc", 22556550222249123835909180266811414538971143565993192846012583552876721649744],
["tele-nft-item/nft-item.fc", 112456603551352598193405120624678866030139400186800709562240012518003340977105],

["storage/storage-contract.fc", 44542652015163304335966522853331133393011733370692441537470366854345658892851],
["storage/storage-provider.fc", 108677173951298337060746154977967122806502520160062519672276937694037317935577],
["nominator-pool/pool.fc", 113824867250406571749406540634759859835643042958487527298742314026185451318138],
["jetton-minter/jetton-minter.fc", 59172251235013928378816323931018560572240088017859486196396002876800156186183],
["gg-marketplace/nft-marketplace-v2.fc", 65550944551194537105854154716861234168502062117999272754502885031166440057836],
["jetton-wallet/jetton-wallet.fc", 26109413028643307141901410795152471606217725316052170190064118584402007124948],

# 2023-11-30 update: source files in nominators.fc were included in the wrong order.
# FunC v0.5.0 has more strict function ordering rules, so nominators.fc was changed to fix compilation error.
["whales-nominators/nominators.fc", 32017040532734767645954674692768344406402364921654403435168703583553605058036],


# 2023-11-30 update: __tact_verify_address was optimized out because it is not marked as impure.
# In FunC v0.5.0 all functions are impure by default, so it is not optimized out anymore.
["tact-examples/treasure_Treasure.code.fc", 60348994682690664630455354672413353326734169633005380820521037982881341539662],
["tact-examples/jetton_SampleJetton.code.fc", 70075170397574779402104489003369966746142305378310979462742589461276337980270],
["tact-examples/jetton_JettonDefaultWallet.code.fc", 12710666798574325848563501630728896968396634924087634181325633274893128358499],
["tact-examples/maps_MapTestContract.code.fc", 86004071444084135394990759334664637743689750108042267324839281046456545168857],
]

def getenv(name, default=None):
Expand Down
22 changes: 21 additions & 1 deletion crypto/func/auto-tests/legacy_tests.json
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
[["elector/elector-code.fc", "115226404411715505328583639896096915745686314074575650766750648324043316883483"], ["config/config-code.fc", "10913070768607625342121305745084703121685937915388357634624451844356456145601"], ["eth-bridge-multisig/multisig-code.fc", "101509909129354488841890823627011033360100627957439967918234053299675481277954"], ["bsc-bridge-collector/votes-collector.fc", "62190447221288642706570413295807615918589884489514159926097051017036969900417"], ["uni-lock-wallet/uni-lockup-wallet.fc", "61959738324779104851267145467044677651344601417998258530238254441977103654381"], ["nft-collection/nft-collection-editable.fc", "45561997735512210616567774035540357815786262097548276229169737015839077731274"], ["dns-collection/nft-collection.fc", "107999822699841936063083742021519765435859194241091312445235370766165379261859"], ["tele-nft-item/nft-item.fc", "69777543125381987786450436977742010705076866061362104025338034583422166453344"], ["storage/storage-contract.fc", "91377830060355733016937375216020277778264560226873154627574229667513068328151"], ["storage/storage-provider.fc", "13618336676213331164384407184540461509022654507176709588621016553953760588122"], ["nominator-pool/pool.fc", "69767057279163099864792356875696330339149706521019810113334238732928422055375"], ["jetton-minter/jetton-minter.fc", "9028309926287301331466371999814928201427184114165428257502393474125007156494"], ["gg-marketplace/nft-marketplace-v2.fc", "92199806964112524639740773542356508485601908152150843819273107618799016205930"], ["jetton-wallet/jetton-wallet.fc", "86251125787443633057458168028617933212663498001665054651523310772884328206542"], ["whales-nominators/nominators.fc", "8941364499854379927692172316865293429893094891593442801401542636695127885153"], ["tact-examples/treasure_Treasure.code.fc", "13962538639825790677138656603323869918938565499584297120566680287245364723897"], ["tact-examples/jetton_SampleJetton.code.fc", "94076762218493729104783735200107713211245710256802265203823917715299139499110"], ["tact-examples/jetton_JettonDefaultWallet.code.fc", "29421313492520031238091587108198906058157443241743283101866538036369069620563"], ["tact-examples/maps_MapTestContract.code.fc", "22556550222249123835909180266811414538971143565993192846012583552876721649744"]]
[
["elector/elector-code.fc", "96915288474895095375636985346314354662782784860648058159878921867365312683154"],
["config/config-code.fc", "22290399841823616942485152190379024190655691555189464909245612965253206016940"],
["eth-bridge-multisig/multisig-code.fc", "61794576422183943960272839720117943378686303983578297509099019523440847170337"],
["bsc-bridge-collector/votes-collector.fc", "92944270384900724656771477263840139047476985690583064733832286422277180224175"],
["uni-lock-wallet/uni-lockup-wallet.fc", "27323712737699566411771249412638860892056222617959925563185009479925143218351"],
["nft-collection/nft-collection-editable.fc", "3265272879406938912616104900469474227258611213495548733729957432831667074606"],
["dns-collection/nft-collection.fc", "50100285311144683401305558797522852568981620193836838830789475785944491291928"],
["tele-nft-item/nft-item.fc", "112456603551352598193405120624678866030139400186800709562240012518003340977105"],
["storage/storage-contract.fc", "44542652015163304335966522853331133393011733370692441537470366854345658892851"],
["storage/storage-provider.fc", "108677173951298337060746154977967122806502520160062519672276937694037317935577"],
["nominator-pool/pool.fc", "113824867250406571749406540634759859835643042958487527298742314026185451318138"],
["jetton-minter/jetton-minter.fc", "59172251235013928378816323931018560572240088017859486196396002876800156186183"],
["gg-marketplace/nft-marketplace-v2.fc", "65550944551194537105854154716861234168502062117999272754502885031166440057836"],
["jetton-wallet/jetton-wallet.fc", "26109413028643307141901410795152471606217725316052170190064118584402007124948"],
["whales-nominators/nominators.fc", "32017040532734767645954674692768344406402364921654403435168703583553605058036"],
["tact-examples/treasure_Treasure.code.fc", "60348994682690664630455354672413353326734169633005380820521037982881341539662"],
["tact-examples/jetton_SampleJetton.code.fc", "70075170397574779402104489003369966746142305378310979462742589461276337980270"],
["tact-examples/jetton_JettonDefaultWallet.code.fc", "12710666798574325848563501630728896968396634924087634181325633274893128358499"],
["tact-examples/maps_MapTestContract.code.fc", "86004071444084135394990759334664637743689750108042267324839281046456545168857"]
]
Loading