-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mini v0 #14
base: main
Are you sure you want to change the base?
Mini v0 #14
Conversation
…eedback from PR 7
from: deployer, | ||
proxy: { | ||
owner: deployer, | ||
proxyContract: 'EIP173Proxy', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is EIP173Proxy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a simple proxy used by hardhat-deploy. We have update this now to use ERC1967Proxy.sol
which is UUPS compatible and is held under the deployments folder
} | ||
|
||
console.log('operators:', JSON.stringify(initialOperators)) | ||
const deployedContract = await deploy('MiniWallet', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where can we control and store deployed proxy address, storage address, and logic contract address?
console.log('MiniID Name : ', await miniID.name()) | ||
console.log('MiniID Symbol : ', await miniID.symbol()) | ||
// Mint test tokens | ||
if (chainId !== '1666600000,') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored approach and commit are here
let contractUri | ||
|
||
console.log(`chainId: ${chainId}`) | ||
if (chainId === '1666600000,') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and no hard coding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored approach and commit are here
console.log('Mini721 Symbol : ', await mini721.symbol()) | ||
|
||
// Mint test tokens | ||
if (chainId !== '1666600000,') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored approach and commit are here
|
||
const deployedMini721 = await deploy('Mini721', { | ||
from: deployer, | ||
gasLimit: 4000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed 🙏
Was initially put in as was getting unexpected gas limit, but this was due to errors in deploy logic
let contractUri | ||
|
||
console.log(`chainId: ${chainId}`) | ||
if (chainId === '1666600000,') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored approach and commit are here
console.log('Mini1155 Symbol : ', await mini1155.symbol()) | ||
|
||
// Mint test tokens | ||
if (chainId !== '1666600000,') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored approach and commit are here
from: deployer, | ||
proxy: { | ||
owner: deployer, | ||
proxyContract: 'EIP173Proxy' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue here, not sure where eip173proxy is and whether it is safe and how it can be controlled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a simple proxy used by hardhat-deploy. We have update this now to use ERC1967Proxy.sol
which is UUPS compatible and is held under the deployments folder
Can you gitignore everything under |
Can all Mini1155 and 721 related deployment and testing stuff be removed? They are launch templates other developers may use, and have nothing to do with SMS Wallet features. The contract themselves may be moved to separate places as well |
Can you move all work-in-progress and MiniID related items to separate PR? Let's make one thing perfectly good, solid for production, and as minimal as possible in code, before moving on to the next. |
There is still the issue unresolved, related to recording proxy, logic, and storage addresses for those hardhat deployed contracts, and fine-control on these contract's upgrade process. We can't just use |
miniwallet/test/Mini1155.ts
Outdated
@@ -0,0 +1,489 @@ | |||
import { expect } from 'chai' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way we can continue the review of these files in the other PR where they were originally reviewed? Several hours were spent reviewing the files, so it would be nice to continue from existing reviewing checkpoint, rather than starting from scratch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through the code again this time. Let's keep reviewed PRs open in the future
}) | ||
} | ||
|
||
export async function communityMint721 (testEnvironment, owner, numTokens) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?
@@ -0,0 +1,39 @@ | |||
import { ethers } from 'hardhat' | |||
|
|||
export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is in server config, it can be moved to a constant in a single place
Let's also move development notes to We can polish and move things out to component-root folder after they are ready for production and presentable for external audience |
miniwallet/test/Mini1155.ts
Outdated
expect(await this.mini1155.balanceOf(owner, c1.s.tokenId)).to.equal(0) | ||
expect((await this.mini1155.balanceOfBatch([owner, owner], [1, 2])).map(x => x.toString())).to.deep.equal(['0', '0']) | ||
expect(await this.mini1155.baseUri()).to.equal('ipfs://QmPcY4yVQu4J2z3ztHWziWkoUEugpzdfftbGH8xD49DvRx/') | ||
expect(await this.mini1155.contractURI()).to.equal('ipfs://QmdKB6d1zT7R8dNmEQzc6N1m5p2LDJZ66Hzu8F4fGhdVrq') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these specific project urls all need to be sanitized and removed from tests and default config parameters
I have two more files to read: NFTID.md and PROXY.md. I went through other files. Let's break down this PR into multiple parts (each has its own PR):
The PRs can be made in chains (each PR's branch merge into the branch of previous PR) rather than all pointing to the base (main) branch, since each may be dependent on some of the work in previous PR |
On a second thought - I think (2) can be merged in after using a better proxy, so we can get it up and running ASAP. We can improve this process in a later PR |
…NFTs and improve deployment and testing configuration
let config | ||
if (fs.existsSync(configPath)) { | ||
configPath = configPath.substring(0, configPath.length - 3) | ||
const { default: configNetwork } = await import(configPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be used to executed malicious script in temporary / mounted / remote folders
return res.status(StatusCodes.BAD_REQUEST).json({ error: `phone number not registered: ${phoneNumber}` }) | ||
} | ||
} | ||
console.log(`u: ${JSON.stringify(u)}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove - leaking user info in console
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed 🙏
Version 0 work based on #13