【发布时间】:2021-11-09 01:09:38
【问题描述】:
所以我一直试图在 contract.methods.registerVoter 函数通过后执行 mint 函数,但我没有运气。只有 contract.methods.registerVoter 函数被执行,而 then 函数中什么也没有发生。我做错了什么?
export async function registerVoter(walletAddress) {
const contract = await getContract();
const votingToken = await getTokenCotract();
const tokenAddress = await getTokenAddress();
const web3 = window.web3;
contract.methods.registerVoter(walletAddress, tokenAddress).send({from: walletAddress}).then(() => {
votingToken.methods.mint(walletAddress, 1).send({from: walletAddress})
})
}
【问题讨论】: