Giter Site home page Giter Site logo

dens's Introduction

DeNS

tonred team

TODO

  • Unreserve domain
  • Versionable

Resolve

To get a dns record for a specific domain:

On root contract for specific TLD call:

resolve(string path) public view responsible returns (address certificate).

This method will return the address of the domain certificate. Check if such account exists and then call methods for obtaining DNS records from it:

query(uint32 key) public view responsible returns (optional(TvmCell))

ID description ABI
0 Everscale account address (target address) address
1 ADNL address uint256
todo

Example

// fake code
mapping(string => address) tld;
tld["ever"] = address(0:abc..);
string toResolve = "somedomain.ever";

Root root = Root(tld.find(toResolve));
address certificateAddr = root.resolve(toResolve);
if (!isAccountActive(certificateAddr)) return;
// Certificate can be domain or subdomain or just use Certificate interface
Domain domain = Domain(certificateAddr);
// id=0 to get Everscale account address record; 
optional(TvmCell) targetRecord = domain.query(0);
if(!targetRecord.hasValue()) return;
address target = targetRecord.get();
return target

Methods

Root

  1. Find certificate address by full path
  2. Create new domain
  3. Renew exist domains
  4. Confiscate domain via DAO voting
  5. Reserve and unreserve domain via DAO voting
  6. Execute any action via DAO voting
  7. Activate or deactivate root contracts (only admin)

+ All TIP4 (TIP4.1, TIP4.2, TIP4.3) methods

Subdomain

  1. Resolve domain
  2. Query record(s)
  3. Change target or record
  4. Create subdomain

+ All TIP4 (TIP4.1, TIP4.2, TIP4.3) methods

Domain

All domain methods

+ Start auction in from new domains

+ All TIP4 (TIP4.1, TIP4.2, TIP4.3) methods

Workflow

  1. RESERVED - reserved by dao
  2. NEW - first N days domain is new, anybody can start auction
  3. IN_ZERO_AUCTION - new domain that in auction new
  4. COMMON - common certificate, nothing special
  5. EXPIRING - domain will be expired in N days, user cannot create auction for it
  6. GRACE - N days after expiring, where user can renew it for additional fee
  7. EXPIRED - domain is fully expired (after grace period), anybody can destroy it

Register new domain

Anyone can call

  1. Get price via expectedRegisterAmount in root
  2. Build payload via buildRegisterPayload in root
  3. Send tokens and payload to root's TIP3 wallet with notify
  4. Sender will receive
    • onMinted callback if success
    • Get tokens back with TransferBackReason.ALREADY_EXIST reason if domain already exist
    • Get tokens back with TransferBackReason.* reason in case of another errors

Renew exist domain

Only domain owner can call

  1. Get expectedRenewAmount in domain
  2. Build payload via buildRenewPayload in root
  3. Send tokens and payload to root's TIP3 wallet with notify
  4. Sender will receive
    • onRenewed callback if success
    • Get tokens back with TransferBackReason.DURATION_OVERFLOW reason if duration is too big
    • Get tokens back with TransferBackReason.* reason in case of another errors

Renew subdomain

todo...

Create subdomain

  1. Call createSubdomain in domain/subdomain, where:
    • name - name of subdomain
    • owner - owner of new subdomain
    • renewable - a flag that marks if owner of subdomain can renew it in any time
  2. owner received:
    • onMinted callback if success
    • onCreateSubdomainError with TransferBackReason.* reason callback in case of error

Architecture

todo image

dens's People

Contributors

abionics avatar pavelkhachatrian avatar

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.