new deploy logic
This commit is contained in:
parent
3e6d0b93cb
commit
4d5318b5d4
|
|
@ -12,11 +12,34 @@ kwargs = {}
|
|||
if int(os.getenv('INIT_DEPLOY_PLATFORM_CONTRACT', 0)) == 0:
|
||||
kwargs['address'] = Address(MY_PLATFORM_CONTRACT)
|
||||
|
||||
platform = Platform(
|
||||
admin_address=Address('UQAjz4Kdqoo4_Obg-UrUmuhoUB2W00vngZoX0MnAAnetZuAk'),
|
||||
def platform_with_salt(s: int = 0):
|
||||
s = Platform(
|
||||
admin_address=Address('UQD3XALhbETNo7ItrdPNFzMJtRHC5u6dIb39DCYa40jnWZdg'),
|
||||
blank_code=Cell.one_from_boc(Blank.code),
|
||||
cop_code=Cell.one_from_boc(COP_NFT.code),
|
||||
|
||||
collection_content_uri=f'{PROJECT_HOST}/api/platform-metadata.json',
|
||||
collection_content_uri=f'{PROJECT_HOST}/api/platform-metadata.json' + f"?s={s}",
|
||||
**kwargs
|
||||
)
|
||||
)
|
||||
|
||||
platform = platform_with_salt()
|
||||
|
||||
if int(os.getenv('INIT_DEPLOY_PLATFORM_CONTRACT', 0)) == 1:
|
||||
def is_nice_address(address: Address):
|
||||
bounceable_addr = address.to_string(True, True, True)
|
||||
non_bounceable_addr = address.to_string(True, True, False)
|
||||
|
||||
if '-' in bounceable_addr or '-' in non_bounceable_addr:
|
||||
return False
|
||||
|
||||
if '_' in bounceable_addr or '_' in non_bounceable_addr:
|
||||
return False
|
||||
|
||||
if bounceable_addr[-1] != 'A':
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
salt_value = 0
|
||||
while not is_nice_address(platform.admin_address):
|
||||
platform = platform_with_salt(salt_value)
|
||||
salt_value += 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue