2
votes
Accepted
Are immutable variables part of the contract storage?
You are correct. The bar in this example will be stored in slot 0. The reason for this is because the compiler doesn't reserve a storage slot for constant/immutable variables, rather than copying the ...
- 343
2
votes
Accepted
Why is it called tokenURI instead of tokenURL?
The name "tokenURI" refers to the Uniform Resource Identifier (URI) that represents the metadata associated with a non-fungible token (NFT). While the URI may often be a URL (Uniform ...
- 357
1
vote
Why's it all being displayed as Big Number if I am using ethers.utils.parseEther? Is this normally how it displays in console?
Yes, it is normal for the values to be displayed as a BigNumber in the console, even after converting them with ethers.utils.parseEther.
BigNumber is a data type used by the Ethers.js library to ...
- 357
1
vote
Accepted
Troubling shooting hardhat test failure - ERC20 approve & transferFrom issues
The problem is with the beforeEach() function:
beforeEach(async () => {
CrowdCoin = await ethers.getContractFactory("CrowdCoin");
crowdcoin = await CrowdCoin.deploy();
...
- 26
1
vote
Accepted
How does Reentrancy Attack is avoided this case?
Let's see.
When you assign an integer in Solidity, it copies the value. So regardless of what happens to the origin of the value for amountToWithdraw, the value of amountToWithdraw remains the ...
- 27.1k
1
vote
Arguments Definition To Smart Contract
Coz you are defining transactions after writing the line
let tx = await transaction.wait()
- 295
1
vote
Accepted
Why am I getting `undefined` when trying to access array elements in Truffle Console?
Truffle functions return a Future so you need to await for the result:
> myArray = await myContract.getMyArray()
[
BN {
negative: 0,
words: [ 0, <1 empty item> ],
length: 1,
...
- 30.2k
1
vote
Cannot read properties of undefined (reading 'WebSocketProvider')
What version of ethers.js you are using? Try downgrading your ethers to v5.4.0 and check if it's working.
You can find more details in this post EthersJS Listening to events with NodeJS Strange Errors
- 343
1
vote
Accepted
How to splitt smart conract for reducing size of smart contract
It depends a lot on your use case. There are many options.
In your case, the size of the contract is huge, so "small" saving tricks will not work. So I propose one of the following.
You ...
- 1,819
1
vote
ERC1155 and ERC1155UriStorage Question
If you want to use ERC1155URIStorage, it is already inheriting from ERC1155, so you do not need to inherit both in your contract. Just inherit from ERC1155URIStorage and you get what you need.
Your ...
- 328
1
vote
Accepted
Uniswap DAI / ETH: TypeError: exchangeContract.methods.getEthToTokenInputPrice is not a function
getEthToTokenInputPrice is a method only available on uniswap v1's exchange contract.
For DAI and Eth, the exchange's address is 0x2a1530C4C41db0B0b2bB646CB5Eb1A67b7158667.
Uniswap V1 is not the most ...
1
vote
Error when trying to call function from deployed contract
Address you are trying to cast in not payable here.
You can resolve the issue by making the address payable first before do the casting as follows
ReservoirV6_0_0 reservoirContract = ReservoirV6_0_0(...
- 508
1
vote
What is Ticks on Uniswap?
Ticks are simply a way to represent token prices in Solidity. It's one way to work around the peculiar nature of performing complex math operations in Solidity, since it enables representing token ...
- 4,062
1
vote
What is Ticks on Uniswap?
Basically bondaires between price space (according to they doc). In pratice the price of the currency can be aways represented as a tick, thus it will be in a range represented by ticker upper and ...
- 631
1
vote
Accepted
I have an existing ERC721A smart contract deployed but how can I change public mint price and open that contract?
There is a function in your contract named updatePublicSalePrice(), which lets you update the price of your public sale.
function updatePublicSalePrice(uint256 _newPrice) public onlyOwner {
...
- 741
1
vote
What induces the large bytecode warning, and how can I fix it?
Here's something you can try that might work
Enable the optimizer in solidity
pragma solidity ^0.8.0;
// Enable the optimizer with 200 runs
pragma solidity optimizer enabled 200;
or alternatively if ...
1
vote
What are the experimental smart contract languages?
This is an old question, but that comes in the Google search, so here is the 2023 update. Happy to report that a lot of smart contract language research and development happened since 2016.
A lot of ...
- 19.8k
1
vote
Is LLL still used as language?
As of 2023 the short answer is "kinda".
There were two major LLL implementations:
Solidity/LLL, written in C++, which actually predates the Solidity compiler and started out in February ...
- 1,836
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
contract-development × 4626solidity × 2555
contract-design × 1084
remix × 490
contract-deployment × 405
tokens × 372
contract-invocation × 364
go-ethereum × 361
web3js × 356
contract-debugging × 282
blockchain × 260
erc-20 × 244
truffle × 236
transactions × 231
ether × 139
gas × 139
dapp-development × 113
dapps × 88
security × 88
arrays × 83
evm × 82
nft × 79
storage × 77
metamask × 76
events × 74