All Questions
52,608
questions
0
votes
0
answers
5
views
reentrancy vulnerability Replication Failure
Vulnerability replication fails, returns false when calling Amoney.withdraw via the Battack contract, and fails to trigger the fallback function.help!
//victim contract
// SPDX-License-Identifier: MIT
...
0
votes
0
answers
3
views
Audit requirements for a Safe{Wallet} app
I am working on a Safe app and thus I am curious: what are the requirements for the smart contract audit?
0
votes
0
answers
7
views
UniswapV2 swapExactTokensForTokens Question
I have question does UniswapV2 swapExactTokensForTokens function charge fees ? And if yes does expected amount input should be like this Expected price after fee subtraction?
0
votes
1
answer
34
views
Connecting to MetaMask using Web3.js: Web3.givenProvider vs window.ethereum
I am a newcomer to DApp development and am currently attempting to programmatically connect to MetaMask using Web3.js. I am following the Getting Started guide (https://web3js.readthedocs.io/en/v3.0.0-...
0
votes
0
answers
8
views
Safe, Secure, Random Number using only Vyper smart contracts (NO CHAINLINK VRF)
For the purposes of my gaming project I am ditching chainlink VRF in order to obtain a random number because honestly... I hate everything about chainlink. Paying .1 link for a random number is absurd ...
0
votes
1
answer
5
views
Does Anyone Know How To Implement CHAINLINK AUTOAMTION (Keepers) To be the "Executor" of the "Timelock" contract in a DAO?
I am trying to add a different element to a DAO - and that is to make Chainlink be the automatic "executor" of the "timelock" contract when the minDelay amount of time has passed. ...
1
vote
3
answers
16
views
Prices on Dexes
Hi I have code that fetches price from uniswap v2
ratio0ToPrice = (amount0In, amount1Out) => {
if (Number(amount1Out) === 0) {
return "Infinity";
}
return 1 / (Number(amount0In)...
1
vote
0
answers
3
views
Calling private functions using Yul ( Solidity )
I'm currently learning Yul in Solidity and experimenting with the call() function to call other functions in inline assembly. I've noticed that as soon as a function is set to private, I receive a ...
0
votes
0
answers
4
views
Opensea nft seller problem
I tried selling my nft on opensea the buyer is clean and am clean, he purchased my nft and then it asked for gas fee payment which wasn’t successful and i messed up since i was new to this and couldn’...
0
votes
0
answers
6
views
How to perform Swap (via uniswap) only when requirement is true?
I am currently in the process of writing a contract for a token on the Ethereum blockchain. However, I have encountered a problem. I am trying to link a swap function for uniswap to a condition (that ...
0
votes
0
answers
10
views
Why can't the gas be estimated?
I'm trying to use another contract to give my leasingContracts unique IDs, but I can't call the function as the code crashes, and I don't understand why.
This is the contract for IDs:
// SPDX-License-...
0
votes
0
answers
5
views
Getting error when connecting my ether js websocket provider to local node web socket server
So I am building my backend to listen for events. So I used the websocket provider of ether js to listen. Since it requires a websocket server url so I built my local websocket server.
But I am ...
0
votes
0
answers
13
views
Segmentation fault when running forge init
I got the "Segmentation fault" when I tried to run the command "forge init".chatgpt answer is
"A Segmentation fault is a specific kind of error caused by accessing memory that ...
0
votes
0
answers
3
views
Why to deposit more ETH than the gas fee when minting?
I try to mint on SuperRare and when I push the button Mint I get a system message that I should deposit more ETH, altough there is 4x amount of ETH in my SR wallet than the estimated amount needed for ...
0
votes
0
answers
16
views
Safe UI cannot show transaction history for a local setup
Appreciate the hard work of team! I am following the doc to setup everything locally and on aws, seems every thing works fine including safe wallet creation, transaction submission and signing, but ...
1
vote
0
answers
10
views
Go-ethereum full node uses 32 GB memory
My Go-ethereum full node constantly uses 98% of the available 32 GB RAM on my Windows computer, is this normal? Go-ethereum specs says that you only need 16 GB. Should I buy more memory or is Go-...
0
votes
0
answers
6
views
Why does truffle test break my migrations?
I have created a deployment script for an upgradable token contract which takes a flag from the command line for the deployment type.
I type...
truffle migrate --reset --type initial
truffle migrate --...
0
votes
0
answers
9
views
How to build Timelock Dao with Access Control?
import {TimelockController} from "@openzeppelin/contracts/governance/TimelockController.sol";
contract DaoTimelockController is TimelockController {
constructor(
address _core,
...
0
votes
0
answers
8
views
Have Gnosis Safe Pay Transaction Gas Fee
I am currently using gnosis safe. When the execution of any transaction is made, the signer has to pay the gas fee. I want all gas fees to be paid by the safe, not the signers, how can I make this ...
0
votes
0
answers
11
views
DeclarationError: Undeclared identifier. contracts/GorillaNFT.sol:98:5: | 98 | _setTokenURI(tokenId, tokenURI); CAN ANYONE HELP PLZ?
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/...
0
votes
0
answers
3
views
I am creating a hierarchy RBAC, should you use _grantRole or _setRoleAdmin first?
Was wondering if you should _grantRole first or _setRoleAdmin first based on OZ AccessControl
_grantRole(CoreRoles.GOVERNOR, msg.sender);
// Initial roles setup: direct hierarchy, ...
0
votes
0
answers
5
views
Error: cannot estimate gas; transaction may fail or may require manual gas limit. I cannot se which gas limit it refers
I am trying to deploy a SimpleStorage solidity contract using javascript on WSL studio and Ganache.
The terminal talks about gas fees though neither my solidity code nor my javascript code talks about ...
0
votes
0
answers
13
views
What is the equalievent of transfer() in zksync
I have a payable nft mint contract that send ETH fee to owner, when calling mint() function I recieve
Error function_selector = 0x, data = 0x
tx -> https://goerli.explorer.zksync.io/tx/...
0
votes
2
answers
13
views
Sent ETH from exchange to arbitrum one network instead of ETH network
Is it possible to retrieve the ETH by creating an exact same address on Arbitrum One network?
Is it the same steps as described here on this other similar question: Recovering ETH Sent to Wrong ...
0
votes
0
answers
5
views
How to set COUNTING_MODE for openzeppelin?
My question is there anything wrong with my function?
function COUNTING_MODE()
public
pure
virtual
override
returns (string memory)
{
return &...
0
votes
1
answer
21
views
ERC20 make new token with Buy & Sell contract, Is it ok? I am not sure whether safe to use or not!
D_Test_1.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol";
contract D_Test_1 is ERC20 {
constructor() ERC20(&...
1
vote
0
answers
8
views
Why I can't speed up a speed up transaction in MetaMask?
I was working MetaMask:
Send (do) a transaction
two buttons for controlling the transaction appear Cancel & Speed up
Speed up transaction
Only cancel button is there and I can't speed up the ...
0
votes
1
answer
32
views
Can't send eth + data into contract with etherjs
I want to send eth + data into this contract: 0x5293Bb897db0B64FFd11E0194984E8c5F1f06178 like this transaction: https://sepolia.etherscan.io/tx/...
0
votes
1
answer
19
views
Avoiding loops in Solidity for a simple situation
Suppose I have a pool that contains some coin say ETH. Imagine there are 100 users that benefit from this pool and I want to keep track of how much ETH in that pool is allocated to each user. When new ...
0
votes
0
answers
9
views
Eip838ExecutionError: execution reverted, while deploying contract with web3js
I maintain a web3 application, for each customer I deploy a smart-contract through the application. The contract was good and I were able to deploy it on polygon, but it isn't comply with the ERC721 ...
0
votes
1
answer
19
views
Eth price dont update after another function iteration
Hi i have an issue i created a function that fetches prices from dex.This is looped every 5 sec and the prices should be up to date every 5 sec.The issues start because the price refreshes every few ...
0
votes
0
answers
7
views
Javascript FundMe Solidity Test code troubleshooting
Code 1 returns error while Code 2 doesn't, why?
CODE 1
const { assert, expect } = require("chai")
const { ethers } = require("hardhat")
describe("FundMe", function () {
...
0
votes
1
answer
8
views
How to advance blocks in a Hardhat test that uses block.timestamp?
I have this code for a Voting smart contract test:
it("Should return true if end time is less than the current timestamp", async function () {
const { votingSmartContract } = await ...
1
vote
2
answers
22
views
Implement smart contract that can spend user's tokens with just one approve
I am looking for a way to implement smart contract that can spend user's ETH or erc-20 tokens with just one approve, without anything else required from user.
USECASE
1.User approves token spending(...
0
votes
1
answer
13
views
My swap smart contract doesn't seem to swap the tokens
I have made a smart contract on Avalanche Fuji chain to test swapping tokens. When I call the smart contract on Remix, my AVAX gets sent, but I never get the USDC I am supposed to get for my AVAX. I ...
1
vote
1
answer
19
views
Using .call to send funds to Smart Contract Wallet account
I have the following function in my smart contract which fails to send funds to a Smart Contract Wallet (SCW). It works fine with standard accounts. I explicitly set gas to 0 because this is an ...
1
vote
1
answer
34
views
What's the best way to raise a number to the power of a fractional exponent in Solidity
I am trying to raise a number to a fractional exponent in solidity. I have tried using the Bancor (https://github.com/bancorprotocol/contracts-solidity/blob/v0.3.1/solidity/contracts/BancorFormula.sol)...
0
votes
1
answer
11
views
Vulnerable when using swapExactETHForTokens
I thought that setting block.timestamp to a deadline prevents MEV sandwich attacks.But my question is does it do the work well?
address destinationAddress,
uint256 minAmountOut
) ...
0
votes
0
answers
12
views
Spot the problem in the contract of the unsellable token
I am currently trying to understand how the smart contracts work. I have bought a tiny amount of a token that I suspect to be honeypot and indeed it is unsellable, PancakeSwap gives the error: ...
0
votes
0
answers
7
views
revert: No run-latest.json file found for specified chain
here is my integration script.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Script, console} from "forge-std/Script.sol";
import {DevOpsTools} from "lib/foundry-...
0
votes
1
answer
24
views
I think i have a sweeper bot on my account
I'm having an issue where eth deposited is being swept straight from my wallet.
I haven't used the wallet in quite a while
I recently signed upto to a private sale of tokens.
Sent 0.0205 ETH TO MY ...
0
votes
0
answers
3
views
Is brownie supporting OpenZeppelin/[email protected]?
I got the following answer after runing
brownie pm install OpenZeppelin/[email protected]
WARNING: Unable to compile OpenZeppelin/[email protected] due to a AttributeError - you ...
0
votes
0
answers
10
views
How to use the uniswap subgraph to search the pools of a token that you are deploying to the sepolia testnet?
How to use the uniswap subgraph to search the pools of a token that you are deploying to the sepolia testnet?
I have already tried with both including georli but it always returns an empty array.
url: ...
0
votes
0
answers
16
views
A little help with the Uniswap V3 flash loan arbitrage code
I'm trying to use flash loans on Uniswap V3 to trade across different pools (two of these four: 0.01%, 0.05%, 0.30%, 1.00%)
I've tried running codes from multiple tutorials:
https://solidity-by-...
0
votes
0
answers
2
views
Gnosis Safe App Metrics
Is there a way to get the metrics on the volume of transactions that are used through the gnosis apps? Specifically curious about ETH staking platforms such as lido if possible.
0
votes
0
answers
6
views
Transaction UnderPriced error ethers.js
https://www.youtube.com/watch?v=gyMwXuJrbJQ&t=9348s
I was following this course (I was about 7:15 ~ 7:20 in)
I tried to deploy the contract my manually sending a transaction as below:
and I got ...
0
votes
0
answers
5
views
Web3 Could not find name 'Web3'. Did you mean 'web3'
My code works but I am getting this with Web3 dotted.
Could not find name 'Web3'. Did you mean 'web3'?
const web3 = new Web3(Web3.givenProvider || infuraUrl);
When I try to fix it by doing this:
...
1
vote
1
answer
25
views
Cannot create the same ECDSA signature with Web3.py and ethers.js
I have the following (simplified) contract that uses ECDSA to validate message authenticity:
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
...
0
votes
0
answers
12
views
Safely converting 1 WEI to the current ETH/USD Chainlink price
Let c be the current floating point price of ETH/USD precise to 8 decimal places.
Since Solidity cannot store floating points, getting the current price of ETH/USD from Chainlink's data feed returns c ...
0
votes
0
answers
4
views
Error occurs when my gas fee isn't zero. Otherwise transaction runs fine with 0 gas fee
I've created a smart contract that helps user to buy erc-20 tokens in exchange of matics.
I am getting this error whenever I do some calculations in my function, which increases gas fee.
I have 0....