
How to get Uniswap V3 liquidity pool address for whitelisting?
Similar to what we did for Uniswap V2 on how to find address of smart contract pool that will be generated we can do the same for V3 https://mirror.xyz/n00b21337.eth/0QkNt3NnLnnUSy4jFmWnaeRr_38Z3wlYKKf1O6URG3c Depending on what chain we are at, you can find all the addresses of Factories here https://github.com/Uniswap/sdk-core/blob/5365ae4cd021ab53b94b0879ec6ceb6ad3ebdce9/src/addresses.ts#L135 Aim for the v3CoreFactoryAddress values.**So there are a few methods to do that, one could be to us...
Clear browser storage when developing
Different wallet scripts usually use window.localStorage for saving data for reuse and determination of what is the status of wallet connect, sometimes this could be awire and you need to clear it, you could delete all in browser like cookies, stored data and all the rest but you can also call first this in consolewindow.localStorage to check what is saved and then you can delete it all withlocalStorage.clear(); orlocalStorage.removeItem("name of localStorage variable you want to remov...
Transaction Bytecode vs Deployed Bytecode, differences and how to read them
Main difference between deployed bytecode or runtime bytecode and bytecode that is shown in deployed transaction is that later has initial code in it and its bigger in size. So what is initial(init) code?A smart contract's constructor is a one-time function not stored on the blockchain but present in the initial code. When creating a contract, users can also send native currency. It's vital to ensure the contract can accept this currency at deployment. If it can't, the creation...
R4Nd0m k0lLEC7I0N 0F U5EFul PHindiN92 0N mY j0URney PhR0m n00b 2 1337. rAmBL1N92 aBoUt 5Ol1d17y, rE4C7, nf7, dEfi, WE83

How to get Uniswap V3 liquidity pool address for whitelisting?
Similar to what we did for Uniswap V2 on how to find address of smart contract pool that will be generated we can do the same for V3 https://mirror.xyz/n00b21337.eth/0QkNt3NnLnnUSy4jFmWnaeRr_38Z3wlYKKf1O6URG3c Depending on what chain we are at, you can find all the addresses of Factories here https://github.com/Uniswap/sdk-core/blob/5365ae4cd021ab53b94b0879ec6ceb6ad3ebdce9/src/addresses.ts#L135 Aim for the v3CoreFactoryAddress values.**So there are a few methods to do that, one could be to us...
Clear browser storage when developing
Different wallet scripts usually use window.localStorage for saving data for reuse and determination of what is the status of wallet connect, sometimes this could be awire and you need to clear it, you could delete all in browser like cookies, stored data and all the rest but you can also call first this in consolewindow.localStorage to check what is saved and then you can delete it all withlocalStorage.clear(); orlocalStorage.removeItem("name of localStorage variable you want to remov...
Transaction Bytecode vs Deployed Bytecode, differences and how to read them
Main difference between deployed bytecode or runtime bytecode and bytecode that is shown in deployed transaction is that later has initial code in it and its bigger in size. So what is initial(init) code?A smart contract's constructor is a one-time function not stored on the blockchain but present in the initial code. When creating a contract, users can also send native currency. It's vital to ensure the contract can accept this currency at deployment. If it can't, the creation...
R4Nd0m k0lLEC7I0N 0F U5EFul PHindiN92 0N mY j0URney PhR0m n00b 2 1337. rAmBL1N92 aBoUt 5Ol1d17y, rE4C7, nf7, dEfi, WE83
Share Dialog
Share Dialog

Subscribe to N00b21337

Subscribe to N00b21337
<100 subscribers
<100 subscribers
EIP 4096 has an interesting method of updating your metadata with events, more details here.
https://eips.ethereum.org/EIPS/eip-4906
So lets see how to implement it with an example. First you need to create a file with interface that has this code in it
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165 {
/// @dev This event emits when the metadata of a token is changed.
/// Third-party platforms such as NFT marketplaces can listen to
/// the event and auto-update the tokens in their apps.
event MetadataUpdate(uint256 _tokenId);
/// @dev This event emits when the metadata of a range of tokens is changed.
/// So that the third-party platforms such as NFT market could
/// timely update the images and related attributes of the NFTs.
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}
then we can implement that interface like example below (we also need to use supportsInterface function) and call our event BatchMetadataUpdate in the case of updating of _baseTokenURI as this means all NFTs have new URIs and probably new metadata.
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./IERC4906.sol";
contract ERC4906 is ERC721, IERC4906 {
string private _baseTokenURI = "some URI"
constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) {
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721A, IERC165) returns (bool) {
return super.supportsInterface(interfaceId);
}
function setBaseURI(string calldata baseURI) external onlyOwner {
emit BatchMetadataUpdate(1, type(uint256).max);
_baseTokenURI = baseURI;
}
}
One of the good things is that this EIP has been supported by Open Sea, which means it should be useful and standardized across industry.
https://docs.opensea.io/docs/metadata-standards#metadata-updates
EIP 4096 has an interesting method of updating your metadata with events, more details here.
https://eips.ethereum.org/EIPS/eip-4906
So lets see how to implement it with an example. First you need to create a file with interface that has this code in it
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/// @title EIP-721 Metadata Update Extension
interface IERC4906 is IERC165 {
/// @dev This event emits when the metadata of a token is changed.
/// Third-party platforms such as NFT marketplaces can listen to
/// the event and auto-update the tokens in their apps.
event MetadataUpdate(uint256 _tokenId);
/// @dev This event emits when the metadata of a range of tokens is changed.
/// So that the third-party platforms such as NFT market could
/// timely update the images and related attributes of the NFTs.
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}
then we can implement that interface like example below (we also need to use supportsInterface function) and call our event BatchMetadataUpdate in the case of updating of _baseTokenURI as this means all NFTs have new URIs and probably new metadata.
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./IERC4906.sol";
contract ERC4906 is ERC721, IERC4906 {
string private _baseTokenURI = "some URI"
constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) {
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721A, IERC165) returns (bool) {
return super.supportsInterface(interfaceId);
}
function setBaseURI(string calldata baseURI) external onlyOwner {
emit BatchMetadataUpdate(1, type(uint256).max);
_baseTokenURI = baseURI;
}
}
One of the good things is that this EIP has been supported by Open Sea, which means it should be useful and standardized across industry.
https://docs.opensea.io/docs/metadata-standards#metadata-updates
No activity yet