For questions about the Ethereum Virtual Machine programming language, the programming language of smart contracts on the Ethereum blockchain.
Questions tagged [evm]
173 questions
0
votes
1 answer
Can't send ERC20 Token over Rinkeby Testnet? Terminal says Transaction has been reverted by the EVM
What do I need to change in order to have a successful transaction on the EVM? Where have I gone wrong in the below code.
What I have done
I'm trying to send tokens from my wallet address using Web3 to another wallet address. Below is how I…

Anthony Cavuoti
- 11
- 1
0
votes
1 answer
Solidity/Ethereum. Cheaper alternative regarding gas
I am learning solidity/ethereum and I came across this situation:
I have a mapping(address => unit) that keeps track of how much every address is paying my contract, and at some point, I have to compute how much % of the total pool has one user…

dani9837
- 11
- 2
0
votes
2 answers
Interacting with solidity library without source code
I am trying to interact with a solidity library without using its source code. The library is located at address 0xc0b843678E1E73c090De725Ee1Af6a9F728E2C47 on the rospten network. What I have attempted is to create an 'abstract contract' which I…
0
votes
0 answers
How to implement O(1) dividend algorithm in solidity
Language: solidity
Platform: Ethereum, EVM
Question: There is currently a dividend pool. 2% of the transaction fee will be distributed at 0 UTC every day, and 2% of each transaction must be distributed in real time. How to achieve that each user can…

G.Arthur
- 1
0
votes
2 answers
Do I need to pay gas fees to distribute my ethereum based crypto?
If I were to create my own Ethereum based crypto token named "ExampleCoin" with a supply of 1,000,000,000 and decided to distribute it to users for playing my game, would I need to pay a gas fee each time I give a user some ExampleCoin?
And if I had…

Brandon B
- 43
- 1
- 6
0
votes
1 answer
ParserError: Expected '{' but got 'memory'
Am using pragma solidity >=0.7.0 <0.9.0;.
Line 42 with the below function:
function addXtoAccName( address _accNumber, string _xtoName ) public memory {
accounts[_accNumber].xtoDisplayName = _xtoName;
…

SirBT
- 1,580
- 5
- 22
- 51
0
votes
1 answer
can't deploy contract from web3 to geth node , Error: Transaction has been reverted by the EVM
I have web3 running in a Nodejs project.
I have used this genesis.json:
{
"config": {
"chainId": 123456,
"homesteadBlock": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
…

h.kittany
- 1
- 1
0
votes
1 answer
Is there any way to fix hardhat Unable signature
Any time I try to deploy the contract I get this error
image; https://ibb.co/SfzQ1MW
gitpod /workspace/luck $ npx hardhat run scripts/deploy.js --network testnet
Downloading compiler 0.8.4
Compiling 16 files with 0.8.4
Compilation finished…

Rugg0
- 1
0
votes
1 answer
How to check how much ERC20 token is being sent in a smart contract call
I've got this piece of code:
function mint(uint amount) public payable {
require(amount <= 10, "token: max of 10 token per mint");
require(_openMint == true, "token: minting is closed");
require(msg.value == _price*amount, "token: must…

Pol
- 39
- 9
0
votes
1 answer
GET PROCESSING OPTIONS To get Data Bank Card (pscs-sharp)
In my case I'm using pcsc-sharp project.
I'm going to expose what I'm doing
Select AID (In this example, a Visa Card)
Request: 00 A4 04 00 A0000000031010 00
var array_byte = StringToByteArray("A0000000031010"); //VISA
var…

Daimler
- 39
- 4
0
votes
1 answer
Possible to cast uint256[100] memory to uint256[10] memory?
Is is possible to make getFirst10() to work? It seems impossible to cast the uint256[100] memory to uint256[10] memory.
contract Test {
uint256[100] private foo;
function get() external view returns (uint256[100] memory) {
return foo; …

Erik
- 87
- 3
0
votes
1 answer
Unexpected msg.sender in onERC721Received
I have an auction contract with a constructor like following:
address payable public beneficiary;
ERC721 nftContract;
bool tokenAdded;
uint256 public tokenId;
constructor() public payable {
beneficiary = msg.sender;
}
I have enabled the…

Kevvv
- 3,655
- 10
- 44
- 90
0
votes
1 answer
Reading totalsupply of a token on BSC Smart Contract from a ETH Smart Contract
My BSC smart contract needs to know the totalsupply of another token on an ETH smart contract. It seems difficult to read blockchain data between smart contract networks. Does anyone know how you can read the totalsupply of tokens that share the…

LWN
- 1
0
votes
1 answer
ZoKrates Invalid witness produces valid proof
I'm new to ZoKrates and ZK stuff in general. I am confused about how the witness works. If I compute an invalid witness the verifier still verifies the proof as correct. For example (based on ZoKrates "get started").
Given this program:
def…

GeraldHost
- 13
- 1
- 2
0
votes
2 answers
Is possible to call a function from another contract in assembly ? Solidity
This would be the code, but my problem is, I was doing the ethernaut challenge for solidity, and my code is always running out of gas, then I think "if I use assembly it cost less gas", so I ran into a problem, it is possible to call a function…

Wesler
- 41
- 7