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
if statement to activate a function after a time period (solidity)
I want the following function to activate after 6 mins(360 secs) of contract deployment because my task requires a withdrawal lock. should I put if (block.timestamp > 360) before the function or inside the function just before the remaining code?
…

XYZT
- 13
- 3
0
votes
0 answers
How to write a offchain method for Clones.predictDeterministicAddress(erc20TokenImplementation, salt);
I want to write javascript method for same
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
assembly {
let ptr := mload(0x40)
…
0
votes
1 answer
Solidity: How can I access a variable dynamically by name?
Is there a way to access variables in solidity using another variable?
Something like this:
contract Test {
uint age;
string varAge = "age";
function setAge() public {
// varAge should be able to access age variable
…

Savvy Sage
- 347
- 1
- 4
- 12
0
votes
1 answer
The bytecode size of LendingPool.sol is over 24k
I used the "npm run compile" command to compile the protocol-v2 in the aave. I found that bytecode size of LendingPool.sol is 43,892 bytes. It exceeds the 24k of the contract's max limit of evm. But the protocol-v2 can deploy this contract to…

郝丽锋
- 1
0
votes
1 answer
Gnosis Safe Contracts : Error deploying to custom Network
There is an error in deploying to custom network using deterministic deployment approach. The custom network is a evm based network. By adding PK and NODE_URL in the .env the code is expected to deploy all contracts in the custom network but I am…

Toniya
- 1
- 1
0
votes
0 answers
Can we convert a docker container or a simple nodejs app into EVM bytecode and run it on EVM compositable as smart contracts?
This might sound silly!
I have a thought, what if we built some kind of transpiler or compiler that will take a docker image and run it on EVM basically converting the docker image to EVM bytecode, is it possible?
don't cancel me, just a thought…

Satyam Kulkarni
- 1
- 1
- 3
0
votes
0 answers
find percentage of price impact using constant product formula
This is an ethereum question because it has to do with EVM reserve pools and exchange prices. How do I find percentage of price impact using constant product formula, rather than the value of amount and value of tokens?
Using typescript, I'm pulling…

seems
- 92
- 1
- 11
0
votes
4 answers
passing msg.data in external contract using delegate call
I am going through the ethernaut ctf challeneges and I am trying to take ownership of this contract through my own smart contract, here is the target code:
pragma solidity ^0.6.0;
contract Delegate {
address public owner;
constructor(address…

O Inuwa
- 91
- 1
- 5
0
votes
1 answer
Polkadot and Ethereum compatiblity
I've read that blockchains connected to the main relay chain of Polkadot can communicate with external blockchains such as Ethereum, using a bridge.
My question is:
Why would someone deploy a dapp to the Polkadot ecosystem, to Moonbeam for example,…

ujvariba
- 11
- 1
0
votes
0 answers
Avoid a hack when minting NFTs with abilities
I was recently made aware of a hack involving a contract where you have a 10% chance to mint a rare NFT.
The hacker was able to see the decision on whether it was a rare or regular and cancel the mint before it happened. This is the code:
uint256…

Pearl
- 392
- 2
- 12
0
votes
3 answers
Uniswap v3 nonfungiblePositionManager.mint revert after createAndInitializePoolIfNecessary
I use the official deploy tool "successfully" to deploy Uniswap v3 to a EVM comparable testnet. After NonfungiblePositionManager.createAndInitializePoolIfNecessary(), I call NonfungiblePositionManager.mint() to mint a new position but it always…

H.Li
- 171
- 2
- 12
0
votes
1 answer
How can i see which address Approved a WBNB spend for my address?
I have been looking for a few hours in vain.
Let's say that a wallet wants to authorize the WBNB expense by approving on the WBNB contract the address of my wallet (approve function).
How can I know what is the exact address of this wallet that has…

John Axis
- 29
- 1
- 4
0
votes
0 answers
Get program parameters/types for existing program
I would like to ask for the help.
I'm just starting with the Solana contract interacting (I have experiences with EVM) and I'm now struggling with how to call custom foreign programs. Is there any way how to obtain existing programs methods/types in…

Ludek Vodicka
- 1,610
- 1
- 18
- 33
0
votes
1 answer
Best plan of attack for digital certificates for proof of completion on EVM
I am looking to explore the option of creating a digital certificate (as in proof) when someone has completed a portion of training, and for this to be issued on an EVM-compatible blockchain using Solidity.
I have prototyped using ERC721 NFTs to…

Tujamo
- 93
- 8
0
votes
1 answer
How does makeLog instruction function works in Ethereum virtual machine
The following code snippet is a constituent piece of the instructions.go file in geth.
// make log instruction function
func makeLog(size int) executionFunc {
return func(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte,…

Proton
- 343
- 4
- 18