Questions tagged [require]
The require tag has no usage guidance.
9
questions with no upvoted or accepted answers
1
vote
0answers
46 views
Require not working on geth private node
I have created this contract to manage a votation:
pragma solidity ^0.5.7;
contract Votacion{
mapping(uint => address[]) private votosCandidatos;
uint[] listaCandidatos;
bool abierta;
address ...
1
vote
1answer
290 views
Handling require/assert failure errors correctly from a Node.JS app?
I have a getter function in my smart contract that returns one of the string values in statically defined string array. Upon entry to the function, it does a bounds check on the incoming index using ...
1
vote
0answers
194 views
cannot get return variable(s) in javascript when using require in solidity
I have a function in solidity that returns a few bytes32 variables. I cannot for the life of me access those variables. Can someone please help?
function getData() public returns (bytes32, bytes32, ...
1
vote
0answers
269 views
Catch a “require()” in frontend
I was trying to validate a transaction with some conditions on contract level and was wondering if it was possible in any way to give user feedback in the frontend if a require() fails - aka if it ...
0
votes
2answers
30 views
how to set a require for a string to not be null
I want to write a require condition for string that string variable could not be null. How to write because string is not taking the != operator
function createOrder(address _seller, string memory ...
0
votes
0answers
61 views
Error message shown as [object Object] when use require, how to get actual error message string in Remix IDE Console?
I have used require function as:
require(owner == msg.sender, "Sender must be owner");
But in the remix console I got,
transact to Contract.setAdmin errored: [object Object]
What should I ...
0
votes
0answers
14 views
require() statement to use for including Ganache GUI in the Dapp not Canache-cli
When using ganache-cli, we assign it using the require() statement. How do we do the same for ganache GUI? I don't want to use the ganache-cli for my app execution.
Also how do I assign the provider ...
0
votes
1answer
165 views
ERROR: Web3 not defined
I'm trying to build a browser UI to interact with my Solidity smart contract that is deployed on my local Ganache blockchain. But I can't seem to get my index.html file to connect to Metamask. I keep ...
0
votes
1answer
114 views
Geth Node doesn't revert a transaction not satisfying a require
i'm testing my smart contract on remix with local ganache cli, when i try to test case that doesn't satisfy a require on the SC i correctly receive message "transact to Contract.function errored: VM ...