You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"why only read methods can return values in the simulator and now write methods? in eth write methods can return something as well (and genvm supports it)"
The text was updated successfully, but these errors were encountered:
Use case:
I would like to get the address of the new contract from a factory contract, which is from a write method
@gl.public.writedefcreate_campaign(
self,
title: str,
goal: str,
knowledge_base: str,
rules: str,
style: str,
token: str,
start_datetime_iso: str,
duration_days: int,
missions: dict[str, dict[str, typing.Any]],
) ->str:
""" Creates a new Campaign contract and stores its address. Returns the address of the newly created contract. """# Deploy the new Campaign contractsalt_nonce=len(self.contract_addresses) +1# salt_nonce cannot be 0print(f"Salt nonce: {salt_nonce}")
campaign_address=gl.deploy_contract(
code=campaign_code.encode("utf-8"),
args=[
title,
goal,
knowledge_base,
rules,
style,
token,
start_datetime_iso,
duration_days,
missions,
self.x_id_contract,
gl.message.sender_account,
],
salt_nonce=salt_nonce, # Use the current count as nonce
)
# Store the contract addressprint(f"Created campaign at address: {campaign_address}")
self.contract_addresses.append(campaign_address.as_hex)
returncampaign_address
In @kp2pml30 's words
"why only read methods can return values in the simulator and now write methods? in eth write methods can return something as well (and genvm supports it)"
The text was updated successfully, but these errors were encountered: