Questions tagged [evm]

For questions about the Ethereum Virtual Machine programming language, the programming language of smart contracts on the Ethereum blockchain.

173 questions
-1
votes
2 answers

ParserError: Expected ',' but got 'memory'

I'm using pragma solidity >=0.4.0 <0.9.0; Line 34 with below code: event studentAdded(string memory full_name, uint256 memory st_id); I'm facing this error. Can anyone help? ParserError: Expected ',' but got 'memory' -->…
-1
votes
1 answer

How to use conditionals with modifiers?

I need to complete this task to let the function work only if the modifiers (that should be correct) work as shown in the image. Basically compPurch has always to be true and also realBuyer OR timeBought have to be true. modifier compPurch() { …
XYZT
  • 13
  • 3
-1
votes
1 answer

How does uniswap call the approve function

I am trying to build a no-code tool for users, I want to be able to transfer tokens on the user's behalf. anytime I call the IERC20(token address).approvefunction, my metamask does not a return a screen like the attached image and the IERC20(token…
dayo
  • 3
  • 2
-1
votes
1 answer

Solidity: How to type cast string memory to address and uint type?

I get the following errors when trying to type cast string memory to address and uint type. TypeError: Explicit type conversion not allowed from "string memory" to "address". TypeError: Explicit type conversion not allowed from "string memory" to…
Savvy Sage
  • 347
  • 1
  • 4
  • 12
-1
votes
2 answers

Checking validity of caller via a smart contract

I have a smart contract something like this contract Foo { struct Post() { .... } mapping (uint256 => Post) private posts; mapping (uint256 => address) private owners; } And I have a backend code written with…
Mirat Can Bayrak
  • 631
  • 7
  • 18
-2
votes
1 answer

Cannot Deploy Smart Conract to BSC TESTNET in Remix IDE

I am trying to deploy a smart contract using Remix and the injected Metamask provider connected to the Binance Smart Chain Testnet (BSC Testnet). Everything was working fine yesterday, but today I want to deploy the latest version of the smart…
-3
votes
0 answers

Is this line of code valid and using correct Solidity syntax?

(Language: Solidity | Version: Any) Is this line of code valid and using correct Solidity syntax? if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; I'm new to solidity, and I'm experimenting with smart contract in…
topg
  • 1
1 2 3
11
12