-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Currently SWC offers only one way of calling other contract - ie. reading its current state:
SmartWeave.contracts.readContractState(contractId: string): Promise<any>
This is somewhat limiting, as it prevents from calling any logic from external contract.
As "interactRead" does not change state (ie. it only returns "result", not new "state"), adding a feature to call it from another contract doesn't seem to introduce any security risks.
Having such feature would allow to split business logic between different contracts (eg. vesting or staking contract and PST contract).
Current workaround forces to firstly call state update on the callee contract (and wait for a transaction to be mined) - only then the caller contract can read updated state from callee contract and perform its logic - that's really inconvenient.