Hot answers tagged

1

First, be sure that you have defined the instance of the contract correctly. Then try to use async/await correctly in your orders in terminal. Finally, give this page a read : "https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts"


1

The approach I use is keep using React folder structure and add the folders and files Truffle requires. Ensure you have "contracts" folder, "migrations" folder with appropriate migrations.js files, and your truffle-config.js file in root.


1

So turns out both the front end and smart contract represent tokens in wei, so 1 token is 0.000000000000000001. In my front end I changed the 1 to web3.utils.toWei("1", 'ether'); and in my smart contract did 1 * 10 ** 18. This worked perfectly.


1

There are a few issues with your code. You should always use BigNumber when using integers. JavaScript can't handle big numbers. Even if you know the numbers will never be too big, in my opinion it's simply good habit to always use BigNumber. You are passing strings to your function. ‘1630972800’ is a string, not a number. My guess is that it gets ...


1

In case others have this problem the way it can be done is: function BindingTypeList() public pure returns(string[] memory) { string[] memory names = new string[5]; names[0] = "DocumentTemplate"; names[1] = "Definition"; ... names[4] = "Entitlement"; return names; }


Only top voted, non community-wiki answers of a minimum length are eligible