Skip to main content

Questions tagged [solidity-0.8.x]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Transaction 0x6a19aa91361ce2b93b7515962821540af2aab0ebff0fcdcb90ee252fbe64c107 is pending: true

Any insight into this? I am attempting to deploy a smart contract using Go-Ethereum but it is pending forever until my context timeout. In order to minimize the complexity I use a worthless contract. /...
pigfox's user avatar
  • 71
0 votes
1 answer
25 views

I want to clone pancakeSwap V3-core-contracts. i need deployment step to run pancakeSwap clone succcessfully. github deployments not working properly

Add Key in .env file. It's a private key of the account that will deploy the contracts and should be gitignored. bscTestnet KEY_TESTNET or bsc KEY_MAINNET add ETHERSCAN_API_KEY in .env file. It's an ...
user135270's user avatar
0 votes
0 answers
16 views

Docker compiled bytecode not equal to Remix deployed bytecode

Any ideas to what I can do to fix this? I am using Go-Ethereum to compile a deploy a smart contract and the deployment just hangs. The contract compiles and deploys using Remix on Sepolia. The byte ...
pigfox's user avatar
  • 71
0 votes
0 answers
22 views

The deployed contract bytecode does not match the compiled bytecode

first some context, I am building a Go-Ethereum tool that can compile, deploy, verify and finally run some functions on the deployed contract on Sepolia. It works fine with the exception of the ...
pigfox's user avatar
  • 71
0 votes
1 answer
35 views

Foundry tests fail with `[NotActivated] EvmError: NotActivated` while fork test

The fork tests works perfectly well with Hardhat. But when I tried with Foundry using different evm_version in foundry.toml file and also tried compiling with different versions solc = "0.8.18&...
Pankaj Jagtap's user avatar
0 votes
0 answers
30 views

How to use Forge remappings when the complete backend is in its own folder

I am making a project in Solidity using Foundry for backend and Typescript for frontend. I decided to put the complete backend part in a backend folder and frontend part in frontend folder. The ...
Solblaze's user avatar
0 votes
1 answer
20 views

Issue with msg.sender. Calling contract B from contract A

There is currently a published contract (contract A), I must use another(contract B) to call withdraw() from contract A. But the function withdraw() already uses msg.sender as a security check. In ...
Olivia Nicole's user avatar
0 votes
0 answers
30 views

I have a problem with calling a function from another contract. I don't know why it is not working

I'm trying to solve a CTF challenge and can't seems to call the claim function from the vuln contract. I must use my "EOA" address to solve task to mark it solved, because my "EOA" ...
jose celis's user avatar
0 votes
1 answer
33 views

Runtime ABI-encoded contract method

I am building an application that gets tokens at runtime, I need to transfer some of them and I am attempting to calculate the required gas. Below is a example of the gas calculation code, but it ...
pigfox's user avatar
  • 71
0 votes
0 answers
53 views

Solc too slow compiling

The solc compiler that I'm using (0.8.21) is taking too much time to compile. It's compiling 20 files for a foundry test campaign in ~90 seconds when it should be milliseconds. Any ideas on what I ...
dNyrM's user avatar
  • 928
0 votes
1 answer
25 views

ABI and BIN Files generated by solc and Etherscan verified code are not identical

I have a file that is composed of multiple imports, too much code to drop here so I will illustrate my question with a very simplified example. My compilers: $ abigen --version abigen version 1.11.7-...
pigfox's user avatar
  • 71
1 vote
1 answer
30 views

Abigen from flattened contract files

I have a file that is composed of 5 imports, too much code to drop here so I will illustrate my question with a very simplified example. My Test.sol file: // SPDX-License-Identifier: MIT pragma ...
pigfox's user avatar
  • 71
1 vote
0 answers
24 views

Implementing BLS Verification using the precompile altbn_128 contract

I am trying to implement BLS using the alt_bn128 curve. so far my code looks as follows: function verify( uint256[2] memory signature, uint256[4] memory pubkey, uint256[2] memory ...
Wheatley's user avatar
0 votes
1 answer
16 views

TypeError: Contract "TestContract" should be marked as abstract

I have issues so I slowly add one library at a time. This code compiles. // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/access/Ownable.sol"; import ...
pigfox's user avatar
  • 71
1 vote
1 answer
23 views

Contract reverts at deploy when sending 2 ethers

This contract deploys fine when no value is added and get reverted when I try to send 2 ether on the remix VM.......which is exactly the opposite of what I expected or should be happening. I retraced ...
Bohn Bohn's user avatar
0 votes
1 answer
47 views

Transaction is getting reverted on calling bookRoom() function

I'm deploying my contract by passing these constructor params: (["Hotel Red","Hotel Radisson"],[1,2],[12,13],[3300000000000000,3500000000000000],[12,13]) The contract is getting ...
Zeeshan Sayeed's user avatar
0 votes
1 answer
43 views

Large price discrepancy between swapExactTokensForTokens and official swap

I am testing performing swaps using solidity ^0.8.24 smart contracts with hardhat on Polygon and Quickswap exchange. But I am getting relatively large price discrepancies between my swap and one ...
SolTester's user avatar
1 vote
1 answer
65 views

No tests to run

I am attempting to run a test on one file with forge test --match-path test/DonutBurger.t.sol but I get No tests to run despite being able to run forge test successfully. Any ideas? $ forge test [⠊] ...
pigfox's user avatar
  • 71
1 vote
0 answers
18 views

Solidity: getStudentNotifications Retrieves notifications to other metamask account instead of one metamask account

I have two metamask accounts, one is Vamshi (student) and Mike(University). I use Vamshi's account to call the function sendRecordsToUniversity and the university address, I use here is Mike's. so the ...
Robert Downey Jr.'s user avatar
0 votes
1 answer
45 views

Execution reverted - transaction mined but execution failed

I have looked at previous answers for this title but they don't seem to help me. My contract contract is deployed and verified on the Sepolia test net using Remix. This is the failed transaction The ...
pigfox's user avatar
  • 71
0 votes
0 answers
14 views

Smart Contract calling another contract not effecting any changes

I have two smart contracts, a LeaderBoard contract and a Reward contract. I have the Reward contract call the LeaderBoard contract to add/update values, and I am testing everything using HardHat and ...
ndrb's user avatar
  • 1
1 vote
1 answer
26 views

Try Catch, Function returns x values, but returns clause has x-1 variables

Disclaimer I came across an not so well documented issue so I decided to share it and show the solution I found. This is a very simple problem with a very simple solution, I just didn't found any ...
Saucy's user avatar
  • 23
2 votes
0 answers
43 views

Solidity: float causes funds that are stuck on the contract

I'm making my own contract which pays out tokens to its members depending of their shares amount. To calculate payment I'm using the following formula: function calculatePaymentValue( uint ...
Radek_pl's user avatar
  • 791
1 vote
0 answers
364 views

What are examples of high-liquidity ERC777 tokens on ETHEREUM? Any other token standards apply too, as long as there's a beforeTransfer callback

I'm looking to make a list of popular tokens that implement hooks on transferFrom(address owner, address receiver, uint256 amount) and are deployed on the Ethereum blockchain in particular. For ...
Mila A's user avatar
  • 1,254
0 votes
1 answer
69 views

How to withdraw funds in foundry test

I want to test a function from an existing smart contract written in solidity 0.4. I'm using foundry/forge for that and I managed to test all the functions within this contract except the withdraw. //...
Átila Ferreira's user avatar
0 votes
2 answers
16 views

Return an array of selected structs or values picked from an array of structs

Lottery time! At every new lottery initialized, each User is given n tickets. All the participants tickets are registered in a mapping called "allEntered" which collects tickets from every ...
Kappa's user avatar
  • 1
0 votes
2 answers
75 views

Fail with error 'This pool does not exist on router1'

I was attempting to make a token swap and got an error: This pool does not exist on router1. This is my transaction: Etherscan link Any idea how I can prevent this error and verify that the pool ...
pigfox's user avatar
  • 71
0 votes
0 answers
21 views

Error: The called function should be payable if you send value and the value you send should be less than your current balance for view function

I am doing this is Remix This is my solidity contract. I just have 3 interfaces which are being used to call methods from 3 different contracts. The ITaco and IDoodle methods work fine and call ...
Risavdeb Patra's user avatar
0 votes
0 answers
13 views

Error in smart contract [duplicate]

// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract SupplyChain { //Smart Contract owner will be the person who deploys the contract only he can authorize various roles ...
Trakshan Mishra's user avatar
0 votes
0 answers
21 views

Error in smart contract

// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract SupplyChain { //Smart Contract owner will be the person who deploys the contract only he can authorize various ...
Trakshan Mishra's user avatar
0 votes
1 answer
49 views

How To Withdraw From A Smart Contract

I have a smart contract with the below method: function send(address payable _to) public payable isOwner{ (bool sent, bytes memory data) = _to.call{value: msg.value}("");...
amelongo's user avatar
0 votes
1 answer
202 views

quoteExactInputSingle is returning error

I'm working on solidity code that uses pancakeswapV3 quoter contract to call quoteExactInputSingle. Here is the code snippet function AnalyseTnx(address tokenPath0,address tokenPath1,uint256 amtIn)...
Biruk Damte's user avatar
1 vote
0 answers
30 views

Calling Mint And Change Balance From Another Smart Contract

My Project is about a Token in which the Holder can disable their token at the Old Address and Receive a New Minted token. It uses 2 different contacts. I put the functions in the BBB contract and ...
Suka Kasu's user avatar
1 vote
2 answers
72 views

Optimizing Gas Costs and Replacing For Loops in Solidity Function with Large Dataset

I have a Solidity smart contract with a function drawLottery that processes a large dataset of potentially 1 million tickets. The function contains several for loops for iterating through the tickets ...
PraveenMatheesha's user avatar
1 vote
1 answer
81 views

Weak RNG vulnerability proving

Hi guys I am auditing a smart contract and I found a WeakRNG in order to prove it I have written 2 smart contracts which simulate the work of this function( a bit ) here is the 1 a have changed block....
NeoRusI's user avatar
  • 11
0 votes
1 answer
491 views

Solidity: How to decode / trace / search custom error byte code

I ran into this Custom Error during my Foundry test: [FAIL. Reason: Custom Error cd786059:(0xF628...)] and I had no idea about what it means... then I figured out where it went wrong after tracing ...
Russo's user avatar
  • 1,784
1 vote
1 answer
24 views

How to cache the result of an inherited function before overriding it

contract A { function getUINT() public virtual view returns (uint) { return 100000; } } contract B is A { uint trycache; uint public trycache2 = getUINT(); // still 200000 ...
Ashraile's user avatar
  • 125
1 vote
1 answer
50 views

Call or assignment expected. Getting this error while upgrading solidity version

I am not aware of the Assembly code. I copied the ERC1820 registry contract from here. This is written in 0.5.3. When I tried to compile it with 0.8.0 it gave me this error : I know it's because of ...
Zartaj Afser's user avatar
  • 4,474
0 votes
1 answer
38 views

local initialization

I was working in this solidity code. here is the code sample from my project interface customeInterface { function token0() external view returns (address); function token1() external view ...
Biruk Damte's user avatar
0 votes
1 answer
142 views

can eth_call simulate approve and transfer?

I have a solidity contract that contains a logic to approve and transfer balance, swap and flashloan. But when i use eth_call to call my function that perform swap, it reverts. I tried by ...
Biruk Damte's user avatar
0 votes
1 answer
33 views

transaction fails when i use address[] memory

i was practicing on BSC testnet and my solidity code is // SPDX-License-Identifier: MIT pragma solidity 0.8.0; interface IUniswapV2Pair { function factory() external view returns (address); ...
Biruk Damte's user avatar
0 votes
1 answer
49 views

Hardhat deploy same contract to multiple addresses fails

I need to deploy the same contract to multiple wallets and I have this shell script. #!/bin/bash set -x contractName=MyContract network=sepolia npm cache clean --force yarn hardhat clean yarn hardhat ...
pigfox's user avatar
  • 71
1 vote
1 answer
38 views

how to revert transaction excuted by low level call

Hello ethereum community. I'm experimenting with low level calls and i want to revert the transaction made by low level call, if i didn't get the desired result. Is it possible? (bool success, ) = ...
Biruk Damte's user avatar
0 votes
3 answers
361 views

Despite calculation I get contract creation code storage out of gas

My smart contract is deployed on https://sepolia.etherscan.io/tx/0x1b1742a3ff2ac160d5f245ab91828fcc56a803cb3826b6cbdb9f3cb2f293ba66 Once deployed I get contract creation code storage out of gas error ...
pigfox's user avatar
  • 71
0 votes
1 answer
31 views

Creating a local variable in an if statement?

I'm looking at a function that creates a local variable in an if statement. If someone called that function and the condition to the if statement was not triggered, that local variable wouldn't exist, ...
auditor_chick's user avatar
0 votes
1 answer
226 views

Tick range of negative tick - Uniswap v3

I am looking for a formula to calculate the tick range for a negative tick. Ex1: tick: -15 tickSpacing: 10 range: [-20, -10) Ex2: tick: -20 tickSpacing: 10 range: [-20, -10) I was ...
KunLun's user avatar
  • 197
2 votes
1 answer
83 views

Where in the code of this unstake function is ETH actually transferred?

I am looking at this repo, which is contracts for a decentralized pegged asset issuance system backed by liquid staking tokens like rETH. Specifically, I have a question about the functions unstake in ...
auditor_chick's user avatar
0 votes
1 answer
93 views

Smart contract deployment pending forever

I have a smart contract that is compiled and deployed using Remix and verified on Sepolia testnet. https://sepolia.etherscan.io/verifyContract-solc?a=0xA3Bc4ac115CF4C57b507797731F43c14Ff6A2A6c&c=...
pigfox's user avatar
  • 71
0 votes
0 answers
20 views

Treating two assets as equal in a smart contract that aren't equal

I am auditing a protocol that creates a token yETH representing a basket of liquid staking tokens such as rETH and stETH. I noticed that the protocol treats yETH as if it is 1:1 with ETH when it's ...
auditor_chick's user avatar
0 votes
1 answer
20 views

Can you refer to a contract inside itself?

Sorry this is a very minor question but the following is part of a contract called LibOrders.sol. The function below calls LibOrders.cancelOrder....normally I think you would just put "...
auditor_chick's user avatar

1
2 3 4 5
8