immutable / imx-contracts Goto Github PK
View Code? Open in Web Editor NEWSmart contracts and smart contract utilities for use with Immutable X.
Smart contracts and smart contract utilities for use with Immutable X.
Following instructions under "No Code Usage" fails and once I figured out (or think I did) what needs to change.
npm install typescript and some other stuff,
rename .env.example to .env,
provide DEPLOYER_MAINNET_PRIVATE_KEY (even though I want to go to ropsten.
It still fails because it seems its trying to deploy to the main ethereum even though the command I run is "yarn hardhat run deploy/asset.ts --network ropsten"
If I leave out the mainnet key It complains about that.
This is the result
No need to generate any newer typings. Deploying Contract with the account: 0x75965652aC872E3A9fd3c9ad8E290473c23d763c Account Balance: 63000 Error: insufficient funds for intrinsic transaction cost [ See: https://links.ethers.org/v5-errors-INSUFFICIENT_FUNDS ] (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDS, version=providers/5.6.2) at Logger.makeError (/Users/rick/dev/projects/weav/backend/nftPlayground/imx-contracts/node_modules/@ethersproject/logger/src.ts/index.ts:261:28) at Logger.throwError (/Users/rick/dev/projects/weav/backend/nftPlayground/imx-contracts/node_modules/@ethersproject/logger/src.ts/index.ts:273:20) at checkError (/Users/rick/dev/projects/weav/backend/nftPlayground/imx-contracts/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:81:16) at /Users/rick/dev/projects/weav/backend/nftPlayground/imx-contracts/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:243:24 at processTicksAndRejections (internal/process/task_queues.js:97:5) { reason: 'insufficient funds for intrinsic transaction cost', code: 'INSUFFICIENT_FUNDS', error: ProviderError: insufficient funds for gas * price + value at HttpProvider.request (/Users/rick/dev/projects/weav/backend/nftPlayground/imx-contracts/node_modules/hardhat/src/internal/core/providers/http.ts:74:19) at LocalAccountsProvider.request (/Users/rick/dev/projects/weav/backend/nftPlayground/imx-contracts/node_modules/hardhat/src/internal/core/providers/accounts.ts:182:36) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async EthersProviderWrapper.send (/Users/rick/dev/projects/weav/backend/nftPlayground/imx-contracts/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20), method: 'sendTransaction', transaction: undefined } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. imx-contracts[main]$ yarn hardhat run deploy/asset.ts --network ropsten yarn run v1.22.18
execution reverted. This is usually caused by a mismatch between your token's ID/blueprint and your smart contract's mintFor logic.
Curious on leveraging totalSupply() based off IERC721Enumerable, is this possible. Any reference point yall can point me to for it to work with IMX
I'm trying to go through the documentation and deploy the GU contract but I'm unable to create a Ropsten alchemy node. In addition, it seems that the code does not support any other testnets?
within ./deploy of imx-contracts there is the registration.ts:
import { ethers, hardhatArguments, run } from "hardhat";
import { getIMXAddress } from "./utils";
async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying Contracts with the account:", deployer.address);
console.log("Account Balance:", (await deployer.getBalance()).toString());
if (!hardhatArguments.network) {
throw new Error("please pass --network");
}
await deploy(hardhatArguments.network);
}
function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function deploy(network: string) {
const Registration = await ethers.getContractFactory("Registration");
const imx_address = getIMXAddress(network);
const asset = await Registration.deploy(imx_address);
console.log("Deployed Contract Address:", asset.address);
console.log('Verifying contract in 5 minutes...');
await sleep(60000 * 5);
await run("verify:verify", {
address: asset.address,
constructorArguments: [
imx_address
],
});
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
Where imx_address is 0x3e6e01355bB66925a65D372bf9c9f3835d9964fA
, 0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623
or 0x5FDCCA53617f4d2b9134B29090C87D01058e27e9
; one of the Core (StarkEx Bridge) Contract addresses. Shouldn't imx_address be one of the User Registration Contract addresses?
There's a typo in a external
function.
function regsiterAndWithdrawAndMint()
https://github.com/immutable/imx-contracts/blob/main/contracts/registration/Registration.sol#L102
in the readme it mentions for "basic usage" we should subclass Mintable and _mintFor - and for advanaced usage we should subclass IMintable and mintFor -
Looking at their code, I see mintable will unpack the mintingblob for us, put it in storage, and pass it on to _mintFor - which we can then subclass with the unpacked mintingblob as a blueprint.
But uhh what is advanced usage? Is there any reason we would want to do anything different than what Mintable does?
Are there any sample BluePrints and MintingBlobs out there I can look help to help understand?
I really want to use immutable, but run npm install @imtbl/imx-contracts
give fatal error
1604 timing build:link Completed in 15ms
1605 info run [email protected] install node_modules/keccak node-gyp-build || exit 0
1606 info run [email protected] install node_modules/secp256k1 node-gyp rebuild
1607 info run [email protected] install { code: 0, signal: null }
1608 timing build:run:install:node_modules/keccak Completed in 86ms
1609 info run [email protected] install { code: 1, signal: null }
1610 timing reify:rollback:createSparse Completed in 481ms
1611 timing reify:rollback:retireShallow Completed in 0ms
1612 timing command:install Completed in 9314ms
1613 verbose stack Error: command failed
1613 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
1613 verbose stack at ChildProcess.emit (node:events:520:28)
1613 verbose stack at maybeClose (node:internal/child_process:1092:16)
1613 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
1614 verbose pkgid [email protected]
1615 verbose cwd R:\html\immxTest
1616 verbose Windows_NT 10.0.19044
1617 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "@imtbl/imx-contracts"
1618 verbose node v16.14.0
1619 verbose npm v8.3.1
1620 error code 1
1621 error path R:\html\immxTest\node_modules\secp256k1
1622 error command failed
1623 error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
here is error log:
2022-04-08T16_27_04_010Z-debug-0.log
Can't continue develop, what shoud I do, can you help me?
current ts-node
version is 10.2.0
, which will cause "False expression: Non-string value passed to ts.resolveTypeReferenceDirective"
when running step yarn run simple-deploy-ropsten
after upgrading to 10.7.0
, issue solved.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.