Truffle test calling another contract in a smart contract #5136
Unanswered
EmmanuelTom
asked this question in
General Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
`const Token = artifacts.require("MyToken");
const TokenSale = artifacts.require("MyTokenSale");
contract("TokenSale", async function(accounts) {
const [ initialHolder, recipient, anotherAccount ] = accounts;
}); `
This code is actually from a course Im taking, they is something I don't really understand here:
In the code the Token and TokenSale are different smart contracts then from the test why did we
let instance = await Token.deployed();
to check for the balance of TokenSale contract by doinglet balance = await instance.balanceOf.call(TokenSale.address);
?Can't we just use the instance of TokenSale ?
Beta Was this translation helpful? Give feedback.
All reactions