4
votes
how to Get All tokens against a specific Walllet Addresse?
Here is an article that explains how to retrieve the balance of all ERC20 tokens from a wallet. It works with multiple blockchains (Ethereum, BNB, Polygon, Avalanche) and you can even check in a ...
4
votes
How can I use BLS12-381 curve operations:EIP-2537, Whether it's on a public or private chain
While EIP-2537 (featuring BLS12-381) has not been approved nor finalized yet, you can run a private network supporting that precompile.
In addition to that, there's a nice GitHub Solidity library (...
3
votes
Where in the code of this unstake function is ETH actually transferred?
The BridgeRouterFacet contract's unstakeETH() function:
function unstakeEth(address bridge, uint88 zethAmount)
external
nonReentrant
onlyValidBridge(bridge)
{
if (...
2
votes
Accepted
Does the EVM revert if a call is attempted to an address that doesn't have code?
Calls to non-contract addresses (that is, EOAs or inactive accounts) always set the success flag to true and leave the return data field empty, so the right question isnt "Why lows level calls to ...
2
votes
Accepted
How to concatenate 2 strings in Solidity?
With solidity 0.8.12 you can just do string.concat like so:
function strConcat(string memory one, string memory two) external returns(string memory) {
return string.concat(one, two);
}
...
2
votes
Accepted
Ethernaut Challenge Shop
The error is clear: since price() is view, then all expressions inside can't modify the state. The compiler thinks that isSold can modify state since it's not marked view, so we need to fix that.
...
2
votes
Two people calling this function at exactly the same time
Even if two transactions are created at virtually the same exact time, there will be a definite order decided upon by the miner/validator of the block where the transactions took place.
This means ...
2
votes
Uniswap Bot with AI Contract. Is it a scam or not?
All Scams...Why should someone make this available for free if it works or make it generally available? Then the bots would cancel each other out over time if too many do the same thing :D
2
votes
why is my loop not working in below solidity code
You are using 'return' inside a loop, so the code will return and stop the loop on the first iteration.
You can keep the warnings; they won't stop your code from working. However, it's better to ...
1
vote
verify if a token is not a honeypot
Currently it is not possible to reliable detect honeypot tokens, or other scam tokens, on Ethereum, as discussed here. Any statistical analysis about token features and distributions is quite easy to ...
1
vote
Can you refer to a contract inside itself?
Yes, it is perfectly valid to call a function from the same contract using the full contract name and function name, i.e. LibOrders.cancelOrder(). This is often done to avoid name collisions, ...
1
vote
Does address.code return runtime or creation code
The creation code is not stored in the blockchain, it runs only once when the contract is deployed. So the address.code is returning the runtime code.
1
vote
Store addresses in bytes variable
Agree with Alex that what you're asking is a bit suspicious and there may be a better way to achieve whatever you're doing. But since this is a Q/A forum and not a product review...
try:
abi....
1
vote
Can you return something only some of the time with a function in solidity?
In Solidity, a function that returns a value doesn't need to do so explicitly.
For example take the following two functions:
function sometimes(uint x) public pure returns(uint y) {
if(x == 7) ...
1
vote
Revert inside a for loop
Yes, a revert within a loop inside a function triggers a full function revert due to its stack-based execution model, rolling back all changes made within the function.
1
vote
Does the EVM revert if a call is attempted to an address that doesn't have code?
A call, any call, has a caller, can have a value and can have some data. The value can be zero, the data can be empty, doesn't matter. By default as explained in the chosen answer, all calls are valid....
1
vote
solidity doubt error unknown
This is not the case for you, but I'm going to leave this solution here for someone who may need this. I got this error when I forgot the semicolon ';' at the end of the first line pragma solidity ^0....
1
vote
Where can I find how the Ethereum protocol calculates transaction fees, supply issuance, and other key components?
The full specification of the EVM can be found in the Yellow Paper.
The Ethereum ecosystem has many client implementations of the Yellow Paper. The most widely used client is probably Geth (this ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
code × 43solidity × 26
solidity-0.8.x × 9
ether × 6
function × 6
blockchain × 5
remix × 5
transactions × 3
tokens × 3
bytecode × 3
contract-development × 2
wallets × 2
arrays × 2
verify × 2
staking × 2
vulnerability × 2
chaindata × 2
scam × 2
withdrawal × 2
contract-design × 1
metamask × 1
contract-deployment × 1
contract-invocation × 1
dapps × 1
ethereum-wallet-dapp × 1