Questions tagged [solidity]

Solidity is a language for smart contracts for blockchain technologies like Ethereum. It is designed to compile code for the Ethereum Virtual Machine. Use this tag for questions about programming smart contracts using the Solidity language.

Solidity is an object-oriented language whose syntax is similar to that of ECMAScript, but with static typing, and it is designed to compile to code for the Ethereum Virtual Machine for use in smart contracts in blockchain technologies.

6642 questions
1
vote
0 answers

ParserError: Expected identifier but got 'ILLEGAL'

Error: ParserError: Expected identifier but got 'ILLEGAL' --> 22omo.sol:560:10: | 560 | contract 2omo is Context, IERC20, Ownable { | ^ CODE (to note this is not line 1): contract 2omo is Context, IERC20, Ownable { using…
mikehoncho
  • 11
  • 2
1
vote
1 answer

how to call an external function in YUL?

How can I accomplish the next behavior(more specific to implement callMint) in Yul? I couldn't find anything related to this contract Token is ERC20{ .... function mint(address addr, uint256 amount) external { _mint(addr, amount); …
bogdy9912
  • 172
  • 1
  • 1
  • 10
1
vote
0 answers

How to Implement off chain Keepers for Decentralize Perpetual Exchanges like GMX.io?

I'm attempting to clone gmx.io. I understand most of the on-chain and Dex concepts, but I'm stumped on how to establish an off-chain. Keepers they did not opensource the code for that, so could you kindly assist me in determining what the specific…
1
vote
0 answers

Advantage/Disadvantage between Chainlink VRF and an off-chain random number transaction performed by your server?

As I understand it Chainlink VRF uses the request-response approach for providing contracts with a "trusted random number". You (the developer) create a smart contract and inherit the Chainlink VRFConsumerBase contract, declare a storage variable…
1
vote
0 answers

Solidity Deployment Error - "ProviderError: HttpProviderError"

Been attempting to deploy a new instance of a contract I've deployed before, from an environment I haven't used in a while (though which has successfully deployed before). None of the details of the contracts or my configuration have changed, and it…
1
vote
1 answer

How to stop a hardhat node running on localhost?

I am running a hardhat node on locahost using hardhat version 2.12.5 on a windows operating system for learning purpose. At times I close terminals without stopping the running node by CTRL+C. Is there a way for me to to stop the node without having…
Hassam Ullah
  • 79
  • 1
  • 10
1
vote
1 answer

i am trying to install a package in my terminal and they give an error message that said

up to date, audited 704 packages in 2s 121 packages are looking for funding run npm fund for details 8 vulnerabilities (5 high, 3 critical) To address all issues (including breaking changes), run: npm audit fix --force Run npm audit for details. I…
1
vote
0 answers

My function call is returning expensive gas cost on metamask

To context. I want to make a contract that receives USDC and send custom tokens to the buyer. After that, in the same call, the contract forwards those USDCs to another wallet. I have done tests, and calls. When I do it through Remix, I'm able to…
Tsss
  • 11
  • 2
1
vote
1 answer

Can enum be extended in upgradeable contract?

Can enum be extended in upgradeable contract, adding new value into the enum? If it can be extended, what are the consideration I should do before extending the enum?
1
vote
2 answers

Foundry not outputting console.log (solidity)

Followed docs at https://book.getfoundry.sh/reference/forge-std/console-log Tests are passing but console.log is not doing anything. I excepted it would print the output in the terminal. Test contract is as follows: pragma solidity =0.8.17; import…
Delvir0
  • 11
  • 2
1
vote
0 answers

How to make a Factory Contract which deploys a UUPS Proxy?

I have UUPS erc721 contract. I have deployed them. Now I have a proxy contract and a logic contract. Lets say logic contract has address 0x1234 I want a factory contract to deploy multiple upgradeable proxies by copying a already deployed proxy from…
1
vote
1 answer

My balance is always 0 but in my my remix is 1000000000000000 (solidity)

enter image description here enter image description here from the picture above it shows that in solidty my balance is 1000000000000000 but in my website it shows 0 I have test it with gananche provider and it works but when i changed to metamask…
1
vote
1 answer

ParserError: Source "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol" not found: File outside of allowed directories

I'm trying to compile a "FundMe.sol" contract: the issue is that when I try to compile it I keep getting the following Compiler Error: Brownie v1.19.2 - Python development framework for Ethereum New compatible solc version available:…
1
vote
1 answer

pytest: TypeError: int() can't convert non-string with explicit base

def _get_trace(self) -> None: """Retrieves the stack trace via debug_traceTransaction and finds the return value, revert message and event logs in the trace. """ # check if trace has already been retrieved, or the tx warrants it …
1
vote
1 answer

Reentrancy attack implementation

I'm trying to solve the reentrancy attack ethernaut challenge. Here is the solidity code for the target contract: pragma solidity ^0.8.0; import…