Code Monkey home page Code Monkey logo

naming_contract's Introduction

Starknet.id naming service

What's a Starknet.id domain?

A starknet.id domain ends in .stark. It is part of a Starkned.id and its owner can chose what is its target address. For example, if I own the starknet.id having the domain th0rgal.stark, I can decide that it should resolve to my own starknet account address.

naming_contract's People

Contributors

fricoben avatar irisdv avatar th0rgal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

naming_contract's Issues

Fix naming contract upgrade

It is required to update the naming contract in order to support the referral system. Unfortunately I couldn't upgrade the new naming contract correctly.

Update naming contract to cairo 2

Enhance the naming contract as part of the upgrade to Cairo 2 from Cairo 0, focusing on code optimization and comprehensive testing.

Auto renewal discount

If you have auto renewal enabled on a domain, you should be able to renew it for free for 3 months.

Make starknet-py integration

Is your feature request related to a problem? Please describe.

We want to add a domain resolving hook/script to all the starknet libraries out there. We already worked on starknet.js, Starknet React and Starknet-rs.

It's now the time to do it in starknet.py.

These hooks permit to easily access a .starkdomain with the address and conversely.

Describe the solution you'd like

Make a PR in the https://github.com/software-mansion/starknet.py repo following their repo rules and recommendations.

Add a domain_to_address function and a address_to_domain

Naming contract update on mainnet

  • Verify recent updates to naming_contract
  • Disable small renew
  • Disable small purchase
  • Check if expired to see if a starknetid contains a domain
  • Remove whitelist related code
  • Try to upgrade on testnet
  • Upgrade on mainnet

Check balance before doing `IERC20.transferFrom`

Problem

https://github.com/starknet-id/naming_contract/blob/8d7f4b7a06b895df1d612e9ae739d09502e1dd80/src/naming/registration.cairo#L60

Here, you execute transferFrom on ERC20 without checking for balance. So if the balance is not enough, it throws error on wallets when estimateFee is called by the wallets. OZ's ERC20 contracts doesn't show errors properly. So it becomes very difficult for the wallets to handle it and users to know what the actual error is.

This is what the error looks like:

Error in the called contract (0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678):
Error at pc=0:15:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:214)
Unknown location (pc=0:200)

Error in the called contract (0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678):
Error at pc=0:178:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:2822)
Unknown location (pc=0:2800)
Unknown location (pc=0:1712)
Unknown location (pc=0:1380)

Error in the called contract (0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7):
Error at pc=0:104:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:1678)
Unknown location (pc=0:1664)

Error in the called contract (0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7):
Error at pc=0:9:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:1434)
Unknown location (pc=0:1395)
Unknown location (pc=0:915)

Traceback (most recent call last):
  File "<hint1>", line 3, in <module>
AssertionError: assert_not_zero failed: 0 = 0.

Possible Solution

I would suggest to check for balance before doing this transferFrom and use an assert statement with with_attr error_message to display correct message.

Create a new contract and front-end that will be a template for subdomain delegation

Create a contract that will help our partners project for subdomain delegation (Speak with gabin and Iris about it to make sure the contract fill their needs).

UPDATES :

Here is what the templates should have:

Front-end ==> A cool Front end that is easy to replicate for almost every branding (one image + Three colors) + an Next.js API that permits to verify whitelist easily (It's centralized but after all the whole processus of whitelisting is centralized so that's not a problem to me).

Contract ==> Two contracts, one that enables everyone to mint and one that is a WL. The contract will be tested in testnet but no unite tests needed cause the complexity is in the naming contract, not in the delegation contract.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.