-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(Contracts): DApp registry contract using ENS and FDS registrar as base #27
base: master
Are you sure you want to change the base?
Conversation
please don't include other PR under review. please rebase it to the other branch and set this PR's base to that branch until it gets merged. |
c07a3d4
to
2cc22af
Compare
feat(contracts): rename sha3 method, apply recommend suggestions from code review feat(contracts): FDSRegistry is ENSRegistry, supports @ensdomains interface. fix prettier issues. removed subdomain feat(contracts): FDSRegistry is ENSRegistry, supports @ensdomains interface. fix prettier issues. removed subdomain feat(contracts): removing fdsregistry, not needed (typechain builds artifacts from npm packages ie ENSRegistry) feat(contracts): fixes
@nugaon ready for review |
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 have many concerns about the current implementation, please read my comments below.
Also, remove all ERC20 token related code, I don't know why did you commit those.
There are no methods in DappRegistry
to change the Record value of a dApp by the owner.
contracts/TestToken.sol
Outdated
|
||
import "./ERC20/ERC20.sol"; | ||
|
||
contract TestToken is ERC20 { |
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 is it needed?
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 the previous code based on token registry old design pattern that used ERC20 (I change to use ENS base registry in last commit). Will remove.
// indexation type | ||
uint8 indexType; | ||
// Data structure format | ||
bytes32 dataFormat; |
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.
can you elaborate this one please? it is related to BeeSon
or any other datastructure signiture?
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 think we should leave this agnostic, beeson by default, but they could use other dataformats. If is always beeson, then I wil remove it
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.
eg based on the multibase tables.csv values
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.
no it is fine as it is for now
contracts/DappRegistry.sol
Outdated
bytes32 indexed node, | ||
bytes32 label, | ||
uint256 duration, | ||
address indexed owner |
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 should we index owner
?
bytes32 indexed node, | |
bytes32 label, | |
uint256 duration, | |
address indexed owner | |
bytes32 indexed node, | |
bytes32 label, | |
uint256 duration, | |
address owner |
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 probably from the old design pattern, with ENS not required
contracts/DappRegistry.sol
Outdated
event TransferRecord( | ||
address from, | ||
address to, | ||
bytes32 node |
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.
maybe index node
?
bytes32 node | |
bytes32 indexed node |
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.
yes
|
||
|
||
// Global Variables | ||
ENS public ensInstance; |
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.
remove indent
yarn.lock
Outdated
@@ -0,0 +1,11492 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
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.
remove.
test/DappRegistry.ts
Outdated
dappRegistry = await DappRegistry.deploy(ens.address, registrar.address, keccak256FromUtf8Bytes('dappregistry')) | ||
await dappRegistry.deployed() | ||
// set subnode owner and add to controller | ||
await registrar.setSubnodeOwner(keccak256FromUtf8Bytes('dappregistry'), dappRegistry.address) |
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 got error:
Property 'setSubnodeOwner' does not exist on type 'FDSRegistrar'.ts(2339)
contracts/DappRegistry.sol
Outdated
bytes32 _node | ||
) { | ||
ensInstance = _ens; | ||
baseNode = _node; |
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 do you need this baseNode
? you don't use it for anything.
test/DappRegistry.ts
Outdated
|
||
const DappRegistry = await ethers.getContractFactory('DappRegistry') | ||
// set ENS and FDS addresses, and configure subdomain (eg dappregistry.fds) | ||
dappRegistry = await DappRegistry.deploy(ens.address, registrar.address, keccak256FromUtf8Bytes('dappregistry')) |
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 imagined like the names of dapps are on the same level as normal user names. e.g. nugaon.fds
a username, then anythread.fds
can be a dapp name
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.
yes
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.
let me make that change then
contracts/DappRegistry.sol
Outdated
// ENS app name | ||
bytes32 node; | ||
// owner | ||
address owner; |
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 should be tracked by the ENS contract.
…pp update, cleaning package.json/lock and fixes to unit tests
@nugaon will update this PR later this week |
Refactors to use ENS ERC721 token curated registry on top of FDS registrar.
Not implemented in this release/issue: deployment or migration scripts