All Questions
44,989
questions
0
votes
0
answers
5
views
Cryptozombies transferFrom function
What happens if function transferFrom is called by owner of _tokenId but with different _from parameter than msg.sender?
require() is not checking that msg.sender is equal to _from so I can pass any ...
0
votes
0
answers
4
views
Contract initialization opcodes
Every contract I compile starts with the following opcodes:
Is this just a design choice by Solidity, or a "rule" in Ethereum? Otherwise it seems like every time the EVM starts up, it would ...
0
votes
0
answers
4
views
How can I download the latest BSC block using python?
I've tried looking for API's to download that latest block but I can't find anything for BSC. So far the best I can do is browsing to BSCscan.com/blocks, and maybe using curl but I'm sure someone ...
0
votes
0
answers
4
views
swapExactTokensForTokensSupportingFeeOnTransferTokens
According to Uniswap, we need to use swapExactTokensForTokensSupportingFeeOnTransferTokens for tokens that take a fee on transfer. My question is, when does this token fee paid? Also, how does this ...
0
votes
0
answers
4
views
Arbitrum transaction queue STUCK in UI
I have tried to work with the support on the web site. My safe on Arbutrim only is having an issue and was working for weeks up until about 2 days ago.
My safe in the iOS app shows 24 is latest nonce ...
0
votes
1
answer
4
views
Error : contract.methods.myfunction().call() is not a function
i am new to web 3 and i am trying to interact with a contract deployed with ganache and i get an error here is a screenshot
`
0
votes
0
answers
4
views
Returned error: VM Exception while processing transaction: out of gas
My contract
pragma solidity ^0.8.0;
contract CRUD {
uint public maxId = 1;
struct User {
uint id;
string name;
}
User[] public users;
// get index for id
function getUserIndex(uint ...
0
votes
0
answers
4
views
NFT marketplace: transfer NFT directly from seller to buyer, or go through the marketplace first?
I'm developing a simple NFT marketplace where people can connect their own collections (each one having its own smart contract) and put those collection's NFTs for sale.
I saw a tutorial where the ...
0
votes
0
answers
2
views
Discord and Ethereum/Polygon
I hope you are all well.
Does anyone know if it is possible to connect discord to Ethereum and Polygon?
Thank you
Take care
Pierre
0
votes
0
answers
4
views
Error calling collaborator contract
I get the following error when a contract is invoking another injected contract:
Error: call revert exception [ See:
https://links.ethers.org/v5-errors-CALL_EXCEPTION ]
(method="...
0
votes
0
answers
6
views
Mocha Test Error
When running commands for testing such as npm run test,
the following error occurs.
Note: I have the LTS node.js v.16.15 installed.
0
votes
0
answers
7
views
How to encode string as bytes array?
A similar question has been asked but using web3 in java, however, I would like to encode a string to bytes[] in solidity itself.
0
votes
0
answers
10
views
0x Orderbook Explained
I'm trying to query the USDC/WETH orderbook for the best bid and ask. However, I don't think the response data makes much sense. There is a makerAmount and takerAmount. Does this mean that to interact ...
0
votes
0
answers
5
views
Gnosis Safe UI does not register a transaction has executed. Cannot execute further transactions
The gnosis-safe transaction in question
Hey guys! Essentially the problem we are having is that the UI thinks the transaction has not been executed, but it has. This means we cannot execute the next ...
0
votes
0
answers
3
views
Increase block size in BROWNIE
Brownie, by default, mines new block per tx. How to increae block size in brownie so it doesnt keep mining block?
0
votes
0
answers
4
views
StableSwap invariant and price computation
Having issue reproducing the price Curve.fi propose for swaping tokens.
Let's take tricrypto2 pool for example.
As I'm writing this, the actual balance of the pool is the following:
I'm trying to re-...
0
votes
0
answers
6
views
How to give approval to all addresses to transfer my tokens?
I am trying to develop an erc 1155 marketplace?
I am using the function :
ERC1155.setApprovalForAll(to, true);
To provide approval to all tokens that the owner owns to a particular address.
Now, I ...
0
votes
1
answer
11
views
Why would you use a signed message to verify the sender?
In the Ghost contract they have:
function mint(uint8 quantity, bytes calldata signature)
public
payable
callerIsUser
{
require(DA_ACTIVE == true, "DA isnt ...
0
votes
0
answers
7
views
Verifying a message in python signed with Coinbase Wallet doesn't work, but using Brave Wallet works
I'm trying to verify that a message was signed by a certain address using different wallets. The signature is completed using a Vue app and the verification will happen in Python. My code works with ...
0
votes
0
answers
4
views
Do any clients provide separate Beacon nodes and Validator clients?
According to EthHub, these re the list of "eth 2.0" clients:
Teku
Harmony
Lighthouse
Lodestar
Nimbus
Prysm
Shasper
Trinity
Nethermind
Yeeth
My question is: what is the difference between ...
0
votes
0
answers
6
views
Why should I use sstore method in solidity?
assembly
What is the difference between using storage and this method?
assembly {
//allows you to store a value in storage
sstore(slot, _admin)
}
0
votes
0
answers
11
views
Python bytes not being read into solidity bytes
I have this code for returning bytes from a python script:
blockbounds is a list of integers
component.length and component.color are both integers
def buildBytes():
componentsToBytes = bytearray()...
0
votes
2
answers
22
views
Do binance trades happen on the blockchain?
When I trade (ethereum based) tokens on binance, do the tokens actually trade on the blockchain, or does binance just change the ownership in an internal database and only invokes the blockchain when ...
0
votes
0
answers
10
views
setApprovalForAll(..) with OpenSea
I'm still bothering with OpenSea...
I'm creating some tokens in OpenSea in Rinkeby, and I'm transferring them via web3 (ethers) through some scripts that I built myself.
Question, I have had to ...
0
votes
1
answer
12
views
How do node providers (e.g. Infura, Alchemy) determine gas pricing on contract writes?
When writing to a smart contract, we can specify the priority and fee per gas.
await contract.connect(owner).foo({
maxFeePerGas: "<YOUR FEE>"
maxPriorityFeePerGas: "<YOUR ...
0
votes
0
answers
16
views
openseaJs SDK error TypeError: Cannot read properties of undefined (reading 'target')
I am receiving this error from openseaJs while calling fullfillorder
TypeError: Cannot read properties of undefined (reading 'target')
at computeOrderParams (/…/node_modules/opensea-js/src/seaport.ts:...
0
votes
0
answers
14
views
Is there a way to deterministically get a txHash (rather than the safeTxHash) for a given safe transaction before that safe transaction is executed?
I have been trying different ways of doing this with ethers such as attempting to form a transaction object with populateTransaction on the execTransaction function in the Safe contract for signing ...
0
votes
1
answer
14
views
Solidity: Neither address.send nor address.transfer nor address.call is working
Problem
Whenever I call the paytest function (please see code snippet below) from javascript (please see code snippet below) i receive the below posted error message. Whether i use address.send, ...
0
votes
0
answers
5
views
How would I link multiple tokens to a single token?
So I'm trying to allow a user to stake a token and have users stake their tokens from a different collection within that token if that makes sense. Kind of like storing cars in a garage. The contract ...
0
votes
0
answers
10
views
0x fillQuote fails on mainnet fork. i am sending a delegate call (i want to save transaction context) to the 0x proxy contract but transactions fail
function fillQuote(
// The `sellTokenAddress` field from the API response.
IERC20 sellToken,
// The `buyTokenAddress` field from the API response.
IERC20 buyToken,
// The `...
0
votes
1
answer
9
views
Methods that only return arrays are very common. But, in the 'returns' argument, do I use memory or storage? and why?
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
contract MyContract{
address[] public myAddresses;
function getMyAddresses() public view returns(address[] [[...
0
votes
1
answer
12
views
Does calling a read function with input leave any trace?
I want to call a read function which does a calculation and returns a result. It is important that the input will not be saved on the blockchain.
If I were to use a write function then even if there ...
0
votes
2
answers
17
views
What happens to stakers' rewards when initial supply of coins are ended?
I was just reading about staking. Came to know that stakers stake their coins in the blockchain, validate the blocks and earn rewards. These rewards are from the initial supply of coins that is being ...
0
votes
0
answers
8
views
How to send ether to a contract with receive( ) in hardhat?
I have written the Ether Wallet Contract.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
contract EtherWallet {
address payable public owner;
// solhint-disable-next-line no-empty-...
0
votes
0
answers
6
views
Best way to import a user's existing gnosis safe?
My platform helps people group invest in NFTs and we offer team wallets via gnosis safe. Some new teams on our app, however, already have a gnosis safe and want to import it instead of creating a ...
0
votes
1
answer
13
views
How to send custom order to a contract with Metamask
I'm trying to figure out how I can send custom interaction with contract using Metamask.
I am trying to approve a token spend on MM.finance before it goes live so I'll be ready but their website won't ...
0
votes
1
answer
9
views
How To Convert Hex String to A Uint in Solidity ^8.0.0
I have this function that converts a unit to a hex string:
function uintToHexString(uint i) public pure returns (string memory) {
if (i == 0) return "0";
uint j = i;
uint length;
...
0
votes
0
answers
6
views
Storing addresses of all users deposits
I'm trying to allow all users to deposit tokens into my contract which I keep tracking of using a mapping mapping(address => uint256) public playerBalance; which is fantastic. But I later need to ...
0
votes
0
answers
14
views
Uniswap Rinkeby Token Pairs Don't Exist
I am putting together a demo contract which swap some token pairs on Uniswap. I'm testing my contract on Rinkeby. I don't care which token pairs to run the demo on. I grabbed multiple token addresses ...
0
votes
1
answer
9
views
Iterating over a list of payable addresses throws error that "the value you send should be less than your current balance"
Stuck with this for a few days already, looking for some help.
I write a contract that allows users to bet on a certain event and then once the result of the event is evaluated it should change their ...
0
votes
0
answers
3
views
what does 2miner.com's "hr2" and "rhr" numbers mean?
2miner.com's JSON stats returns stuff like
{
"workers": {
"Rig1Name": {
"lastBeat": 1652915927,
"hr": 29087609,
&...
0
votes
1
answer
15
views
Where is the single-parameter version of function sub() defined in SafeMath?
I'm going through the Ethernaut challenges to learn Solidity, and in challenge 3 ("Coin Flip"), they show the following code which subtracts 1 from the current block number:
I assumed that ...
0
votes
2
answers
8
views
Why and when to user require(bool) on functions
I want to understand when (and why) it's necessary to use this statement :
require(sent, "failed to send ether")
i could just do somethink like this instead:
0
votes
1
answer
8
views
can we call constructor in another function of the same contract in solidity?
can we call constructor in another function of the same contract in solidity ? Curious, Kindly reply asap. Thanks
0
votes
1
answer
10
views
Understanding memory type solidity in function's return type
pragma solidity ^0.8.0;
contract Crud {
struct Users{
uint id;
string name;
}
Users[] users; // this is type storage
uint length = 0;
function addUser(string ...
0
votes
0
answers
5
views
CALL_EXCEPTION when calling a simple view function with ethers.js, but not in my hardhat test
UPDATE:
The short description is this function works the contract is deployed on Mumbai Polygon, but fails in Hardhat locally.
Details:
Here is my simple function which has no issue when testing, but ...
0
votes
0
answers
4
views
What is the difference between polygon-ethereum relationship and solana-ethereum?
I understand that side chain has some kinda 2 way connection with its mainnet. But for this connection is it inheriting something more or What is actually happening?
I mean can we distinguish the ...
0
votes
0
answers
6
views
How to deploy a contract from a different account (using truffle)
I want to use an account different than the default account to deploy a contract.
I'm looking for the equivalent of ethers connect() function and I can't seem to find it.
Currently deploying like so ...
0
votes
1
answer
7
views
mapped struct storage layout (slots) and collsions
I want to establish a pattern that ensures no storage slot collisions between current and future (compliant) versions of a contract behind a transparent proxy. In particular, contracts that are meant ...
0
votes
1
answer
14
views
`should be marked as abstract` for a contract that inherits from ERC721Enumerable
I'm trying to understand why this very simple contract returns the error should be marked as abstract.
I don't have this error when I don't inherit from ERC721Enumerable.
pragma solidity ^0.8.0;
...