All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

users -> proxy -> proxy -> smart contract

I'm writing smart contract for Ethereum using Solidity and OpenZeppelin. I wish to implement this kind of situation Where I deploy a proxy for each user and a proxy uses the same smart contract with ...
  • 1
1 vote
0 answers
10 views

How to correctly get PubKey from PrivateKey in Python

I'm trying to master the basics of cryptography behind ethereum etc, mean very basics. trying to calculate the Pub Key via basic Pub = Priv * Generator Poing G in python, so basically from ecdsa....
0 votes
0 answers
3 views

What is the difference between 'watch' and 'cacheOnBlock' in the WAGMI library

I'm using WAGMI in a web app and I'm seeing some slowness in having read values updated in my app when the blockchain state changes. Looking at the docs, I see two potentially relevant options in the ...
0 votes
0 answers
7 views

Understanding EIP 1559 Economics

TL;DR: I couldn't find a tokenomics analysis I was convinced by. It currently seems to me as though, given constant Ethereum network demand, the APY you earn from dividends by holding Ether does not ...
  • 1
0 votes
0 answers
5 views

Gas limit error on mainnet with custom claim function

I'm trying to create a claim function that allows holders of another ERC721a token to claim the same amount of another token and this is the code I have but on mainnet we're getting a gas limit error ...
0 votes
1 answer
19 views

How secure and trusted Web3Auth is?

So my question is about the to which degree Web3Auth is trusted? I played around with their SDK a bit, and after user logs into the DApp, the application can even retrieve user's private key and ...
0 votes
0 answers
8 views

error: "Address given is not a valid Safe address" [closed]

We are using the Gnosis safe sdk to create gnosis safe through our frontend. We are not able to import the created safe on the Add Existing Safe section of Gnosis Safe app. It gives the following ...
0 votes
0 answers
8 views

I got rugpulled on BSC by a token with locked liquidity, how could it be?

This below is the contract in question. What i would like to know is how did he do it exactly? Which part of this code is responsible? What did he actually do to unlock a locked liquidity and rugpull ...
  • 1
0 votes
0 answers
23 views

Unable to compile the FullMath.sol of Uniswap v3 with Hardhat [duplicate]

I've been trying to compile the FullMath.sol in a project using Hardhat. However I have this error and I didn't seem to find any solution except for an issue created for that very same problem. The ...
0 votes
0 answers
14 views

Security caveats upgrading ERC20 contracts

I have an ERC20 upgradeable contract using UUPS from OpenZeppelin and was curious about the security risks involved with upgrading the contract while transactions are occurring or while the contract ...
0 votes
0 answers
13 views

to.be.reverted function showing invalid chai property

it("money",async()=>{ console.log(await instance.hasRole("0xc5d48d6799b0d7d7cdfebe6afd6fac6dff6746359d2e02d434f8172e9a93fe97",accounts[8])); console.log(await ...
0 votes
2 answers
13 views

Why getting error creation of constructor pending?

getting message, in terminal of Remix IDE creation of constructor pending...
  • 11
0 votes
2 answers
29 views

How can I set Gas Price in Solidity?

Can I set gas price in internal transactions, of my functions? For example: // SPDX-License-Identifier: MIT pragma solidity 0.8.17; interface Itest { function sendToken(address to) external; } ...
0 votes
0 answers
18 views

Convert kecka256 hash string back to bytes32

I am storing kecccak256 to hash some string value and store it as mapping. mapping(bytes32 => address) internal _owners; and my mint function looks like this - function _mint(address to, string ...
0 votes
1 answer
18 views

How to fix etherscan contract verification error with hardhat?

Verifying contract... Nothing to compile Successfully submitted source code for contract contracts/Raffle.sol:Raffle at 0x2d47dB0600dcef1B269e7960D627ee4dc777914b for verification on ...
0 votes
0 answers
10 views

'UNPREDICTABLE_GAS_LIMIT' when deploying contract

_ hey everyone, I am receiving 'UNPREDICTABLE_GAS_LIMIT' when trying to deploy a copy of the PYROmatic contract to hardhat. Has anyone else ran into this issue? I am not sure if the error is ...
0 votes
2 answers
26 views

Do OpenZeppelin Clones support ancestor contracts?

I would like to know whether clones made using the OpenZeppelin Clones Library supports functions of inherited contracts (eg: using override functions, etc). I would like my cloned contract to make ...
0 votes
2 answers
32 views

Is it possible to use metamask to sign a plaintext message?

I've figured out the mechanism to use Metamask and ethers for the user to sign an arbitrary message, but it involved computing a hash of the message, arrayifying it, and then calling verify message. ...
  • 527
0 votes
0 answers
14 views

ChainLink Keepers not performing upkeep

So I've created a contract which programmatically registers Upkeeps. The Upkeep is successfully being registered (I can see it on the website) and is funded well above the minimum balance, however the ...
0 votes
1 answer
6 views

Create Function Gas Fees to have a Dynamic Fees based on Gas Fees

is it possible in solidity create a function to estimate a gas fee and apply a % of fees based on gas fees ? Thanks
  • 1
1 vote
1 answer
42 views

Deposit Contract: What is the point of the Merkle tree?

The Deposit Contract inserts all deposits into a Merkle tree. According to the Beacon Chains spec, when a deposit is processed on the Beacon Chain, it must be verified that the deposit is indeed a ...
  • 111
0 votes
0 answers
7 views

Get public array values with Web3py

Is there a way to get poolInfo[0] public array element value (represented by Struct) via call request by Web3py library (without writing getter function)? Contract snippet: struct PoolInfo { ...
2 votes
1 answer
21 views

Multiplying fixed-point types in Solidity

I would like to define a function like this: function convert(ufixed x) external pure returns (uint256 result) { result = x * 1e18; } Unfortunately, the code above does not compile: TypeError: ...
0 votes
1 answer
26 views

How to get balance from a chain different than the one currently connected?

I am building a small bridge in order to learn about web3 and I would like to show the balance from the destination chain/network. For example, if I want to pass Ethereum from Ethereum mainnet to ...
0 votes
0 answers
13 views

Balance of WETH is 0 despite calling deposit in truffle

ganache-cli --fork rpc@12121 --unblock address_with_ether I've set the forked network inside truffle-config.js as mainfork SOLIDITY CODE: interface IERC20 { ... } interface IUniswapV2Router { ...
  • 223
0 votes
2 answers
16 views

Which way of initiating constant variable is better

If I want to initiate a constant variable in my smart contract which out these two is better and why I set it outside the constructor like address token = '0xabc' or In a constructor by accepting ...
0 votes
1 answer
24 views

Events Emitted in logs but not mentioned in the contracts

Event EvProfit is the second event emitted in this transaction on etherscan. However, when i click on "view source" & get redirected to the contracts on 0x743123, I couldn't find where ...
0 votes
1 answer
10 views

How do I call a function in truffle console by specifying function parameters, value, to, from and gas values?

Solidity function: function abc(address x, address y, address z) external payable returns (uint256 x) { // something } In web3.py (python), I have called it successfully after deploying using ...
  • 223
0 votes
1 answer
21 views

What are the many 0 and 2,1 after the encodeWithSignature result?

// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; contract testABI { function getEncodePacked(string calldata _func,bytes calldata _data) public pure returns(bytes memory) { ...
  • 105
1 vote
1 answer
14 views

Weird issue with ERC1155

I have write a simple smart contract ERC1155 allow ppl to mint NFTs and everything was ok except for the mint function. The transaction was ok but when i checked the balanceOf it always returned 0 ...
  • 11
1 vote
0 answers
20 views

How to accurately estimate the gas cost of smart function F call inside F itself (ie: without using `estimateGas` rpc call offchain)

Use case: I need to estimate the accurate gas cost of state-changing smart contract function F on-chain. I need to do this on-chain and inside F itself because I need to estimate the gas cost of ...
0 votes
0 answers
6 views

How to get the safe_address node_url(polygon network) [closed]

i need your help.Website tips me 、、、 This Safe was created with an unsupported base contract. The web interface might not work correctly. We recommend using the command line interface instead. 、、、 I ...
  • 1
0 votes
0 answers
8 views

How does an ethereum node validate the execution of a contract?

I would like to know how ethereum nodes validate the execution of a smart contract in a transaction. Do they all execute the same transaction to validate that their output is correct? For example, let'...
  • 1
0 votes
1 answer
14 views

Flashloan Equalizer

I try to understand how to get a flashloan from euqlizer finance and make something with it. There is a documentation where they say I have to call the onFlashLoan(...) function to borrow the ...
  • 1
0 votes
1 answer
21 views

Why dont Ethereum use bigger base system?

My reasoning is that a bigger base system would allow for same level of security with less characters, allowing for a better user expereince. Since you would need to memorise a smaller number to do a ...
  • 1
0 votes
1 answer
15 views

What happens to LPs if liquidity of uniswap extinguish?

I have a doubt that if an LP provided its tokens to the uniswap pool but someone else in the world swapped and took all of the tokens from the pool so how can he/she withdraw its tokens? Will it get ...
0 votes
0 answers
6 views

Cannot remove liquidity [closed]

I deployed a contract to a random guy and transfered the ownership to him, No the guy has been IMA for 2 months and he never transfered the ownership back to me! I have the ownership OG the LP andbi ...
0 votes
1 answer
23 views

How to properly format an argument that is a struct with nested structs, with web3.py?

I have the following ABI: { "inputs": [{ "components": [{ "internalType": "enum LibNFTOrder.TradeDirection", ...
0 votes
1 answer
21 views

Assigning values to dynamic array

I am trying to assign values to an Array, but it is giving me an error from solidity: TypeError: Type uint8[5] memory is not implicitly convertible to expected type uint256[] memory. --> Web3/Array....
  • 191
0 votes
0 answers
5 views

Idiomatic way to store a large key value list with allocations?

For a work project, I have to divide an ERC-20 token over a number of wallets. The allocation (wallet a is entitled to x, wallet b is entitled to y) is already done off-chain and available in json ...
  • 3
0 votes
1 answer
20 views

Does it makes sense to use address(this).call()?

I have such following smart contract: function a() external onlyOwner { _a(); } function b() external onlyOwner { _b(); } function _a() internal { // do smh } function _b() internal { // do ...
0 votes
0 answers
3 views

Need help with the code for Burn_fee and also need the code for putting a a time lock a percentage of tokens [duplicate]

If any one can send me the solidity functions for the 2 functions I would like my token to have I would apricate it greatly. I am making a token that has a burn_fee on sell transactions of 8% and a 2% ...
  • 1
0 votes
1 answer
13 views

Can I call a library function from web3.py?

I first deploy the following library. library Array { function remove(uint[] storage arr, uint index) public { // Move the last element into the place to delete require(arr.length &...
0 votes
1 answer
10 views

Convert from Bytes[32] to bytes32 or bytes8 vyper

In vyper, how can I convert: response: Bytes[32] = raw_call(your_contract_address, call_data, max_outsize=32) to a bytes32 or even just take the first 8 bytes? response: bytes8 = ?
0 votes
1 answer
12 views

How does the openzeppelin library Bitmaps actually work?

The openzeppelin provides a data structure library namely BitMaps which can be found here - https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/BitMaps.sol Can ...
0 votes
1 answer
11 views

I want to track how many times a person has waved to me. What do I need to add then?

Hi I am pretty new to coding and am sometimes getting confused in how to do certain things. In my code, I want to track how many times a person has waved to me. What do I need to add then? here is my ...
0 votes
1 answer
18 views

Calculating staking rewards based on other users activity (fees)

I'm implementing a smart contract that allows users to stake one ERC20 token and receive rewards in another ERC20 token from a pool that is funded by accumulated transaction fees by the protocol. What'...
0 votes
1 answer
12 views

Im trying to create a basic voting contract in solidity, but got this only error. {help}

So I am trying to create a voting contract in solidity. error is, transact to voting.vote errored: VM error: revert. The transaction has been reverted to the initial state. Note: The called ...
  • 11
0 votes
3 answers
82 views
+150

How to deposit and withdraw WETH

When I try to make a deposit, Ethereum is transferred but the Wrapped ether is not received. Here is my code interface IWETH is IERC20 { receive() external payable; function deposit() external ...
1 vote
1 answer
19 views

Specifying msg.value in Ethers js in Front-End

I'm trying to call a smart contract function that gets three parameters, I also want to specify the msg.value in my front end to call this function using ethers js. I wanted to ask how I can achieve ...
  • 121

15 30 50 per page