Contract submission

Created On NaN secs ago - Invalid Date UTC+0

Contract Code

1
2 @export('submission')
3 def submit_contract(name: str, code: str, owner: Any=None, constructor_args: dict={}):
4 assert not name.isdigit() and all(c.isalnum() or c == '_' for c in name), 'Invalid contract name!'
5
6 assert name.startswith('con_')
7
8 assert ctx.caller == ctx.signer, 'Cannot be called from a smart contract!'
9
10 assert name.islower(), 'Name must be lowercase!'
11
12 Contract().submit(name=name, code=code, owner=owner, constructor_args=constructor_args, developer=ctx.caller)
13
14
15 @export('submission')
16 def change_developer(contract: str, new_developer: str):
17 d = Contract()._driver.get_var(contract=contract, variable='developer')
18 assert ctx.caller == d, 'Sender is not current developer!'
19
20 Contract()._driver.set_var(contract=contract,
21 variable='developer',
22 value=new_developer)
23