#Composing zkApps

2 messages · Page 1 of 1 (latest)

eager spruce
#

Hey all, In the composable section the example was provided as :

class HelloWorld extends SmartContract {
@method myMethod(otherAddress: PublicKey) {
const calledContract = new OtherContract(otherAddress);
calledContract.otherMethod();
}
}

class OtherContract extends SmartContract {
@method otherMethod() {}
}

My question is do we explicitly need to provide the OtherContract in the same manner like we make interface() in Ethereum contracts under the same file to use some method of that specific contract or we can omit the definition and maybe use an import? Any suggestion/answer is appreciated. Thanks 🙂

fervent fern
#

You can definitely use an import instead of having all contracts in a single file! 😄 You could even have a smart contract as an NPM package that you install and import it that way as well.