2

Whether or not you need to declare memory, storage, or calldata depends on if your variable is a "complex" variable or not. (See the note here.) This means things like structs and arrays. Simpler types are automatically assigned storage - see this question and anwser. To answer fully, bytes32 will automatically be storage even without a data ...


2

It is possible to have a private key in a solidity contract but everything on the blockchain is public so anyone will have access to the private key. In other words, it is not possible to properly place the private key on a verified contract while restricting the access only to a specified target. The private keyword doesn't obfuscate data. For example it is ...


1

It's a bit cryptic, but there's a typo in your function parameters - unit -> uint: Change: function mint(address receiver, unit amount) public { To: function mint(address receiver, uint amount) public {


1

How can I adjust the code size or any other method to resolve this error. The contract code size limit is 24kB (24,576 bytes). You'll need to reduce the size of the contract before deploying, or split it into several smaller contracts and libraries. Low hanging fruits would be any string literals (e.g. error strings in require() statements), and removing ...


1

When we see, both contracts have fallback function. So, they can receive and send some ether in the platform. As @Rob Hitchens answered the error comes from the balance value of BankA. BankA never can send ether more than its balance. To make your code smarter about this problem, i suggest the followed code that can tell you about BankA's balance: pragma ...


1

There are some cases maybe you didn't pay attention: You are executing naming() from A by .call() not by .sendTransaction(). Obviously, it never mutates the state. I did guess that because of truffle-contract that there is in the tags list of your question. Maybe, you made a mistake in inserting the real address of C when you call it in both A and B. I mean ...


1

The solution to my issue was removing AggV3Int as a required artifact, assigning the address of an already deployed oracle, and changing the deployer function to be async awaiting deployer.deploy.


1

Not necessarily. The EIP 721 specification only defines an interface. It is up to the tokens how they implement each function.


1

The error is coming from here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/0d40f705a7d4a42ff622ae3a0e1a90305fc5b93e/contracts/token/ERC721/ERC721.sol#L153 The error means that you can't issue transferFrom from an account which hasn't approved the transfer (or you're not the owner). Whenever you use transferFrom, the token owner has to first ...


1

You can try this code : pragma solidity ^0.8.0; contract Agent { struct Agent { uint idAgent; address direction; uint[] preferences; } Agent[] agents; uint256 public numAgents; mapping(address=>bool) _isRegistered; /// @notice Registra a un nuevo agente a la subasta /// @param _preferences preferencias del agente function regAgent(uint[] ...


1

Have a look at this: Sign message with web3 and verify with openzeppelin-solidity ECDSA.sol Notice this little switcheroo: signature = signature.substr(0, 130) + (signature.substr(130) == "00" ? "1b" : "1c"); Hope it helps.


1

Beside of typo in function modifier view you'll require data location provided for string return type pragma solidity ^0.8.1; contract MyContract { string value; function get() public view returns(string memory) { return value; } }


1

When you use a command in a form like: ax1.pay.sendTransaction(<address>,{from:<address>, value:<value>, gas:<...>, gasPrice:<...>}) you should define the sender's address in field from: , otherwise, accounts[0] in Ganache accounts will be considered as the sender and its balance will be decreased. Now, if your sender is a ...


1

All of those FF... sequences are the same length - 40 hex characters, which is 20 bytes: ffffffffffffffffffffffffffffffffffffffff ^ ^ +-------------- 20 bytes --------------+ What else is 20 bytes? Ethereum addresses. (Background: How are ethereum addresses generated?) What these sequences of bytes represent are bitmasks ...


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