Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
6551.js is a tiny library to help working with Non-fungible Token Bound Accounts. You can read more about them here:
You'll need to install the 6551.js package and have an instance of ethers.
npm install 6551.js --save
Then import in your project:
const { ethers } = require("ethers");
const ERC6551Registry = require("6551.js");
const provider = new ethers.JsonRpcProvider("https://rpc.ankr.com/eth_goerli");
const Registry = new ERC6551Registry(provider);
This will generate the transaction data needed to deploy an account for a specifi NFT.
const NFT_CONTRACT = "0x5af0d9827e0c53e4799bb226655a1de152a425a5";
const NFT_ID = 1;
let unsignedTX = await Registry.prepareCreateAccount(NFT_CONTRACT, NFT_ID, Registry.DEFAULT_IMPLEMENTATION); // Implementation address and Salt are optional
let pendingTX = await signer.sendTransaction(unsignedTX)
let expectedAddress = await Registry.getAccountAddress(NFT_CONTRACT, NFT_ID); // Implementation address and Salt are optional
There is two way to get an instance of an Account. The Account is then used to make calls/get informations.
// From parameters
let Account = await Registry.getAccount(NFT_CONTRACT, NFT_ID); // Implementation address and Salt are optional
// From a known address
let Account2 = await Registry.getAccountFromAddress("0x324..4323434");
You can make a call to an account using prepareExecuteCall. This will generate an unsigned transaction:
// target contract, data, value in wei
let unsignedTX = await Account.prepareExecuteCall("0x324..4323434", "0x", 0);
let pendingTX = await signer.sendTransaction(unsignedTX)
let nonce = await Account.owner();
let nonce = await Account.nonce();
let nonce = await Account.isCreated(); // returns if the given account is properly deployed at the address
MIT License, feel free to PR or open new issues.
FAQs
NFT Bound account JS toolkit
We found that 6551.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.