main
nico 2 years ago
parent ceb27d7356
commit 8a2c50ff22
  1. 27
      .github/workflows/main.yml
  2. 106
      .gitignore
  3. 900
      LICENSE
  4. 34
      README.md
  5. 37
      index.html
  6. 4729
      package-lock.json
  7. 33
      package.json
  8. BIN
      public/assets/cover.png
  9. BIN
      public/assets/favicon/android-chrome-192x192.png
  10. BIN
      public/assets/favicon/android-chrome-512x512.png
  11. BIN
      public/assets/favicon/apple-touch-icon.png
  12. BIN
      public/assets/favicon/favicon-16x16.png
  13. BIN
      public/assets/favicon/favicon-32x32.png
  14. BIN
      public/assets/favicon/favicon.ico
  15. 1
      public/assets/favicon/site.webmanifest
  16. 23489
      public/assets/js/walletConnect.js
  17. 145
      src/App.vue
  18. 1
      src/abi/DegenTLD.json
  19. 1
      src/abi/DegenTLDFactory.json
  20. 1
      src/abi/DegenTLDFactoryOld.json
  21. 1
      src/abi/DegenTLDOld.json
  22. 222
      src/abi/Erc20.json
  23. 1
      src/abi/FlexiDegenTLD.json
  24. 18
      src/abi/addresses.json
  25. 1
      src/abi/anon/AnonWhitelist.json
  26. 1
      src/abi/anon/DegenAnonMinter.json
  27. 1
      src/abi/anon/DegenAnonTraits.json
  28. 1
      src/abi/partners/crew/CrewMinter.json
  29. 14
      src/abi/resolver.json
  30. 67
      src/abi/tlds.json
  31. 84
      src/abi/tokens.json
  32. BIN
      src/assets/BalsamiqSans-Regular.ttf
  33. BIN
      src/assets/Cyber.ttf
  34. BIN
      src/assets/River Adventurer.ttf
  35. BIN
      src/assets/anons/anons.gif
  36. BIN
      src/assets/anons/anons1.gif
  37. BIN
      src/assets/anons/nft.jpg
  38. BIN
      src/assets/architecture.png
  39. BIN
      src/assets/architecture2.png
  40. BIN
      src/assets/chrome-logo.png
  41. BIN
      src/assets/cover.png
  42. BIN
      src/assets/firefox-logo.png
  43. BIN
      src/assets/font/BalsamiqSans-Regular.ttf
  44. BIN
      src/assets/font/Impacted.ttf
  45. BIN
      src/assets/font/River Adventurer.ttf
  46. BIN
      src/assets/font/impact.ttf
  47. BIN
      src/assets/font/unicode.impact.ttf
  48. 21
      src/assets/logo-white-300.svg
  49. BIN
      src/assets/logo.png
  50. 15
      src/assets/logo_white.svg
  51. BIN
      src/assets/partners/l2dao.png
  52. 95
      src/components/Footer.vue
  53. 67
      src/components/MyDomain.vue
  54. 84
      src/components/MyTlds.vue
  55. 173
      src/components/Navbar.vue
  56. 73
      src/components/Referral.vue
  57. 97
      src/components/Sidebar.vue
  58. 290
      src/components/domainEdit/EditOtherData.vue
  59. 243
      src/components/domainEdit/EditPfp.vue
  60. 188
      src/components/domainEdit/EditUrl.vue
  61. 13
      src/components/toasts/WaitingToast.vue
  62. 8
      src/env.d.ts
  63. 256
      src/hooks/useChainHelpers.ts
  64. 285
      src/hooks/useDomainHelpers.ts
  65. 109
      src/index.css
  66. 46
      src/main.ts
  67. 118
      src/router.ts
  68. 15
      src/store/index.ts
  69. 73
      src/store/modules/degen.ts
  70. 252
      src/store/modules/network.ts
  71. 19
      src/store/modules/template.ts
  72. 283
      src/store/modules/user.ts
  73. 87
      src/views/About.vue
  74. 86
      src/views/BrowserExtension.vue
  75. 113
      src/views/DegenDao.vue
  76. 258
      src/views/DomainDetails.vue
  77. 35
      src/views/Error404.vue
  78. 301
      src/views/Home.vue
  79. 101
      src/views/HowItWorks.vue
  80. 219
      src/views/Profile.vue
  81. 165
      src/views/SearchDomains.vue
  82. 512
      src/views/SendTokens.vue
  83. 88
      src/views/TldBuy.vue
  84. 455
      src/views/TldDetails.vue
  85. 34
      src/views/Tlds.vue
  86. 198
      src/views/TransferDomain.vue
  87. 663
      src/views/nft/DegenAnonMint.vue
  88. 283
      src/views/nft/DegenAnonNft.vue
  89. 540
      src/views/partners/Crew.vue
  90. 16
      tsconfig.json
  91. 30
      vite.config.ts

@ -0,0 +1,27 @@
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎
uses: actions/checkout@v2.3.1
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder.
env:
VITE_ALCHEMY_POLYGON_KEY: ${{ 56iPM_qFlrt5_HZ3tyFIK5CRW-Nl5kob }}
VITE_ALCHEMY_MUMBAI_KEY: ${{ 56iPM_qFlrt5_HZ3tyFIK5CRW-Nl5kob }}
VITE_ALCHEMY_OPTIMISM_KEY: ${{ 56iPM_qFlrt5_HZ3tyFIK5CRW-Nl5kob }}
VITE_ALCHEMY_ARBITRUM_KEY: ${{ 56iPM_qFlrt5_HZ3tyFIK5CRW-Nl5kob }}
VITE_ALCHEMY_ETHEREUM_KEY: ${{ 56iPM_qFlrt5_HZ3tyFIK5CRW-Nl5kob }}
run: |
npm install
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.

106
.gitignore vendored

@ -0,0 +1,106 @@
.DS_Store
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port

@ -1,232 +1,674 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works. The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
The licenses for most software and other practical works are designed
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. your programs, too.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
The precise terms and conditions for copying, distribution and modification follow.
To protect your rights, we need to prevent others from denying you
TERMS AND CONDITIONS these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
0. Definitions. you modify it: responsibilities to respect the freedom of others.
“This License” refers to version 3 of the GNU General Public License. For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. know their rights.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
A “covered work” means either the unmodified Program or a work based on the Program. giving you legal permission to copy, distribute and/or modify it.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. authors of previous versions.
1. Source Code. Some devices are designed to deny users access to install or run
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. of the GPL, as needed to protect the freedom of users.
The Corresponding Source for a work in source code form is that same work. Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
2. Basic Permissions. software on general-purpose computers, but in those that do, we wish to
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. patents cannot be used to render the program non-free.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. The precise terms and conditions for copying, distribution and
modification follow.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. TERMS AND CONDITIONS
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 0. Definitions.
4. Conveying Verbatim Copies. "This License" refers to version 3 of the GNU General Public License.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
"Copyright" also means copyright-like laws that apply to other kinds of
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. works, such as semiconductor masks.
5. Conveying Modified Source Versions. "The Program" refers to any copyrightable work licensed under this
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
To "modify" a work means to copy from or adapt all or part of the work
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. earlier work or a work "based on" the earlier work.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A "covered work" means either the unmodified Program or a work based
on the Program.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
To "propagate" a work means to do anything with it that, without
6. Conveying Non-Source Forms. permission, would make you directly or secondarily liable for
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. distribution (with or without modification), making available to the
public, and in some countries other activities as well.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
To "convey" a work means any kind of propagation that enables other
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
An interactive user interface displays "Appropriate Legal Notices"
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. menu, a prominent item in the list meets this criterion.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). 1. Source Code.
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. form of a work.
7. Additional Terms. A "Standard Interface" means an interface that either is an official
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. is widely used among developers working in that language.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or "Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or (if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
The "Corresponding Source" for a work in object code form means all
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
8. Termination. linked subprograms that the work is specifically designed to require,
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). such as by intimate data communication or control flow between those
subprograms and other parts of the work.
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
The Corresponding Source need not include anything that users
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. can regenerate automatically from other parts of the Corresponding
Source.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
The Corresponding Source for a work in source code form is that
9. Acceptance Not Required for Having Copies. same work.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
2. Basic Permissions.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
11. Patents. rights of fair use or other equivalent, as provided by copyright law.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
You may make, run and propagate covered works that you do not
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. your copyrighted material outside their relationship with you.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. makes it unnecessary.
12. No Surrender of Others' Freedom. 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
No covered work shall be deemed part of an effective technological
13. Use with the GNU Affero General Public License. measure under any applicable law fulfilling obligations under article
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
14. Revised Versions of this License. measures.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
When you convey a covered work, you waive any legal power to forbid
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. users, your or third parties' legal rights to forbid circumvention of
technological measures.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 4. Conveying Verbatim Copies.
16. Limitation of Liability. You may convey verbatim copies of the Program's source code as you
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
17. Interpretation of Sections 15 and 16. keep intact all notices stating that this License and any
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
END OF TERMS AND CONDITIONS recipients a copy of this License along with the Program.
How to Apply These Terms to Your New Programs You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
5. Conveying Modified Source Versions.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
You may convey a work based on the Program, or the modifications to
<one line to give the program's name and a brief idea of what it does.> produce it from the Program, in the form of source code under the
Copyright (C) <year> <name of author> terms of section 4, provided that you also meet all of these conditions:
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
b) The work must carry prominent notices stating that it is
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. <program> Copyright (C) <year> <name of author>
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. under certain conditions; type `show c' for details.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>. The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>. might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

@ -1,3 +1,33 @@
# degen-dapp # Degen Domain Name Service
Minting app for Degen Domains DegenDNS - Domains for Web3 Degens
https://degendomains.io
## Quickstart
```bash
npm install
npm run dev
```
## .env
Create the `.env` file with the following keys:
```bash
VITE_ALCHEMY_POLYGON_KEY=value
VITE_ALCHEMY_MUMBAI_KEY=value
VITE_ALCHEMY_OPTIMISM_KEY=value
VITE_ALCHEMY_ARBITRUM_KEY=value
VITE_ALCHEMY_ETHEREUM_KEY=value
```
## Development
Develop on the `develop` branch (or a temporary branch which is then merged to develop). Never develop directly on the `main` branch.
When you want to push your changes to production, merge `develop` branch into the `main` branch.
- Development server: https://degen-domains-develop.netlify.app/
- Production server: https://degendomains.io/

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/assets/favicon/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/android-chrome-512x512.png">
<link rel="manifest" href="/assets/favicon/site.webmanifest">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Degen Domains - On-Chain Web3 Domains</title>
<meta name="description" content="Degen Domains is a decentralized domain name service with plenty of top-level domains (.wagmi, .ape, .safu etc.) and running on multiple blockchains.">
<meta name="keywords" content="web3, domains, domain, DNS, TLD, blockchain, crypto, ethereum, polygon, optimism, arbitrum, dogechain, chain">
<meta name="author" content="DegenDomains">
<meta property="og:title" content="Degen Domains - On-Chain Web3 Domains" />
<meta property="og:description" content="Decentralized domain name service with plenty of top-level domains (.wagmi, .ape, .safu etc.) and running on multiple blockchains." />
<meta property="og:image" content="https://degendomains.io/assets/cover.png" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@DegenTLD">
<meta name="twitter:creator" content="@DegenTLD">
<meta name="twitter:title" content="Degen Domains - On-Chain Web3 Domains">
<meta name="twitter:description" content="Decentralized domain name service with plenty of top-level domains (.wagmi, .ape, .safu etc.) and running on multiple blockchains.">
<meta name="twitter:image" content="https://degendomains.io/assets/cover.png">
</head>
<body>
<div id="app"></div>
<script src="https://cdn.jsdelivr.net/npm/@walletconnect/web3-provider@1.6.5/dist/umd/index.min.js"></script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

4729
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,33 @@
{
"name": "degen-domains-frontend",
"version": "1.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"@popperjs/core": "^2.11.5",
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.7.2",
"buffer": "^6.0.3",
"ethers": "^5.6.9",
"vue": "^3.2.16",
"vue-dapp": "^0.4.2",
"vue-router": "4",
"vue-toastification": "^2.0.0-rc.5",
"vuex": "^4.0.2"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.9.2",
"typescript": "^4.4.3",
"vite": "^2.8.0",
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
"@rollup/plugin-inject": "^4.0.4",
"svelte": "^3.44.0",
"svelte-check": "^2.2.7",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
"svelte-preprocess": "^4.9.8",
"util": "^0.12.4"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}

File diff suppressed because one or more lines are too long

@ -0,0 +1,145 @@
<template>
<Navbar />
<div class="main-container">
<router-view></router-view>
<Footer />
</div>
<vdapp-board />
</template>
<script lang="ts">
import { onMounted } from "vue";
import { ethers } from 'ethers';
import { useEthers, useWallet } from 'vue-dapp';
import { mapActions, mapGetters, mapMutations } from 'vuex';
import Navbar from './components/Navbar.vue';
import Footer from './components/Footer.vue';
import tldsJson from './abi/tlds.json';
import tldAbi from './abi/DegenTLD.json';
export default {
components: {
Navbar,
Footer
},
created() {
this.fetchReferrer();
// reset localstorage
const v2 = localStorage.getItem("degenv2");
if (!v2) {
localStorage.clear();
localStorage.setItem("connected", "null");
localStorage.setItem("degenv2", "true");
}
},
computed: {
...mapGetters("user", ["getUserSelectedName"]),
...mapGetters("network", ["getFallbackProvider"]),
},
methods: {
...mapActions("degen", ["fetchTlds"]),
...mapActions("user", ["fetchUserDomainNames"]),
...mapMutations("user", ["setUserData"]),
...mapMutations("network", ["setNetworkData"]),
fetchAllData() {
this.setUserData();
this.setNetworkData();
this.fetchTlds();
},
async fetchReferrer() {
// check if any referral is present: ?ref=...
const urlParams = new URLSearchParams(window.location.search);
const referral = urlParams.get('ref');
// check if domain name or address in the ref field
if (referral && referral.split(".").length === 2) { // likely a domain name
// split referral into two (domain name and TLD)
const domArr = referral.split(".");
for (let netId in tldsJson) { // iterate through different chains
if (tldsJson[netId]["."+domArr[1]]) { // find the correct TLD
// get fallback provider based on network ID
const fProvider = this.getFallbackProvider(Number(netId));
// create TLD contract (only new ABIs)
const intfc = new ethers.utils.Interface(tldAbi);
const refContract = new ethers.Contract(tldsJson[netId]["."+domArr[1]], intfc, fProvider);
// fetch domain holder
const refDomainHolder = await refContract.getDomainHolder(domArr[0]);
if (refDomainHolder !== ethers.constants.AddressZero) {
localStorage.setItem("referral", refDomainHolder); // store referral address in local storafe
}
break;
}
}
} else if (referral && ethers.utils.isAddress(referral)) { // valid address
// the last found referral is considered
localStorage.setItem("referral", referral); // store referral address in local storafe
}
}
},
setup() {
const { address, chainId, isActivated } = useEthers();
const { connect } = useWallet();
onMounted(() => {
// if user already connected via MetaMask before, connect them automatically on the next visit
if (!isActivated.value && localStorage.getItem("connected") == "metamask") {
connect("metamask");
}
})
return {
address, chainId, connect, isActivated
}
},
watch: {
address(newVal, oldVal) {
if (newVal) {
this.setUserData();
this.fetchUserDomainNames(true);
}
},
chainId(newVal, oldVal) {
if (!this.isActivated && localStorage.getItem("connected") == "metamask") {
this.connect("metamask");
}
if (this.chainId >= 1) {
this.fetchAllData();
this.fetchUserDomainNames(true);
}
},
isActivated(newVal, oldVal) {
if (!localStorage.getItem("connected") && localStorage.getItem("connected") !== "null") {
// set this to auto-connect on next visit
localStorage.setItem("connected", "metamask");
}
}
},
}
</script>
<style scoped>
.main-container {
padding: 20px;
max-width: 1400px;
margin-left: auto;
margin-right: auto;
}
</style>

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
[{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"address","name":"_forbiddenTlds","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"string","name":"tldName","type":"string"},{"indexed":false,"internalType":"address","name":"tldAddress","type":"address"}],"name":"TldCreated","type":"event"},{"inputs":[],"name":"buyingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_forbiddenTlds","type":"address"}],"name":"changeForbiddenTldsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxLength","type":"uint256"}],"name":"changeNameMaxLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"changePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newProjectDescription","type":"string"}],"name":"changeProjectDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newProjectName","type":"string"}],"name":"changeProjectName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_royalty","type":"uint256"}],"name":"changeRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_tldOwner","type":"address"},{"internalType":"uint256","name":"_domainPrice","type":"uint256"},{"internalType":"bool","name":"_buyingEnabled","type":"bool"}],"name":"createTld","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"forbiddenTlds","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTldsArray","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nameMaxLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_tldOwner","type":"address"},{"internalType":"uint256","name":"_domainPrice","type":"uint256"},{"internalType":"bool","name":"_buyingEnabled","type":"bool"}],"name":"ownerCreateTld","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectDescription","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"tldNamesAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tlds","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleBuyingTlds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

@ -0,0 +1 @@
[{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"string","name":"tldName","type":"string"},{"indexed":false,"internalType":"address","name":"tldAddress","type":"address"}],"name":"TldCreated","type":"event"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"addForbiddenTld","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxLength","type":"uint256"}],"name":"changeNameMaxLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"changePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newProjectName","type":"string"}],"name":"changeProjectName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_royalty","type":"uint256"}],"name":"changeRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_tldOwner","type":"address"},{"internalType":"uint256","name":"_domainPrice","type":"uint256"},{"internalType":"bool","name":"_buyingEnabled","type":"bool"}],"name":"createTld","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"forbidden","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTldsArray","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nameMaxLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_tldOwner","type":"address"},{"internalType":"uint256","name":"_domainPrice","type":"uint256"},{"internalType":"bool","name":"_buyingEnabled","type":"bool"}],"name":"ownerCreateTld","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"removeForbiddenTld","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"tldNamesAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tlds","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleBuyingTlds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

File diff suppressed because one or more lines are too long

@ -0,0 +1,222 @@
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "decimals",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "symbol",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
},
{
"name": "_spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "owner",
"type": "address"
},
{
"indexed": true,
"name": "spender",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "from",
"type": "address"
},
{
"indexed": true,
"name": "to",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
}
]

File diff suppressed because one or more lines are too long

@ -0,0 +1,18 @@
{
"DegenTLDFactory": {
"3": "0xbb056744bB2Ab473058ED7F3e1764FCf4Bb1313D",
"4": "0x844d982FDc1F5C8eaD82E95d522F2486a7CBb3EE",
"10": "0xA8221890768603210c1a32d88374111084E46E6d",
"56": "0xTODO",
"69": "0x0F081cad5BCed7B2acA1c1D22CdafcB21322B280",
"77": "0xf6A44f61030115B5dA382b198B711130D98390d9",
"97": "0xTODO",
"100": "0xA8221890768603210c1a32d88374111084E46E6d",
"137": "0xB6cf67a0aCE92F357908C6eF716a34c9b196c1DC",
"568": "0xTODO",
"2000": "0xTODO",
"80001": "0xC74f279E5A7FDAd6624054518773ae4EC77E78D3",
"42161": "0x4bD57a848c56E6241296a1256FB2bDEbCdbb9dB0",
"421611": "0x844d982FDc1F5C8eaD82E95d522F2486a7CBb3EE"
}
}

@ -0,0 +1 @@
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UserJoinWhitelist","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"expectedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"joinWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"ownerAddToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"togglePaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAddresses","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"whitelistedAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
[{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_tldAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"price_","type":"uint256"}],"name":"PriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"referral_","type":"uint256"}],"name":"ReferralChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"royalty_","type":"uint256"}],"name":"RoyaltyChanged","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"MAX_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"changePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_referral","type":"uint256"}],"name":"changeReferralFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_royalty","type":"uint256"}],"name":"changeRoyaltyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_domainName","type":"string"},{"internalType":"address","name":"_domainHolder","type":"address"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress_","type":"address"},{"internalType":"uint256","name":"tokenAmount_","type":"uint256"},{"internalType":"address","name":"recipient_","type":"address"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"address","name":"recipient_","type":"address"}],"name":"recoverERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"referralFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tldContract","outputs":[{"internalType":"contract IFlexiDegenTLD","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"togglePaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

@ -0,0 +1,14 @@
{
"10": "0xF20fc12a4955c9d47194B8fEd591Fe01777D2b06",
"56": "0x4aBf8b364ac4aF048Ea077AAA2EDF3e1e1EC0f9c",
"69": "0xa1303d259B87f044404536638E2784DEe897B402",
"77": "0x7A84e7f48DCe4ab212c3511eC5ade0982eaBa8c4",
"97": "0xTODO",
"100": "0x7Df67B2ef4eEDf49Fc53Bb6E94e90e9546FC6c6B",
"137": "0x07884566cdED43eDaec7813C1523624202b060D3",
"568": "0xTODO",
"2000": "0xTODO",
"80001": "0xC17E9347Ce26D7630A98eC4158Bd7200E54bf4Cd",
"42161": "0xd64A2DF9d73CD1Cb50139A3eC3176070e00C67cA",
"421611": "0xe2b9bC4c1d65B5F5583144d9d5c5F0683158C372"
}

@ -0,0 +1,67 @@
{
"1": {
".wildbunch": "0xaa9E5Ade68C9C3Ea967Dc5dde731fd1f797152Cb"
},
"10": {
".wagmi": "0xC3E8922657686EC63eaaa9FC1Fe06826802e7e0f",
".l2": "0x9A7657d1593032C75d70950707870c3cC7ca45DC",
".op": "0xC16aCAdf99E4540E6f4E6Da816fd6D2A2C6E1d4F",
".optimism": "0xBca24d86e4Ad1e011278FaEFc4fF191a731411EC",
".spartan": "0x3490C9817C45A2a394b11A3807f58a8325235aE0"
},
"56": {
".safu": "0xBDACF94dDCAB51c39c2dD50BffEe60Bb8021949a"
},
"69": {
".optitest": "0xAc63b035e63d280c408549f5AFA64be7469470de",
".l2test": "0xB5B8AF8199777d471c0320BC11022433df6D100e",
".flexiop": "0xaE01D45b16Ca3A47670050934482c32B19e34b87"
},
"77": {
".testdao": "0x110cc3f64cdf8ffadc785dfa53906bcff76b3846"
},
"97": {
".bsctest": "0xTODO"
},
"100": {
".gnosis": "0xC3E8922657686EC63eaaa9FC1Fe06826802e7e0f",
".xdai": "0xbca24d86e4ad1e011278faefc4ff191a731411ec",
".bright": "0x3490c9817c45a2a394b11a3807f58a8325235ae0"
},
"137": {
".crew": "0xTODO",
".ape": "0x794a8390D94E32b086908D2bA9D66300aA163C62",
".degen": "0xC4999A3e91ef87c9EC5d8186D02B77F9A62458b9",
".web3": "0xb6Cf2874588d0fdFAf9d1b5E254ee6C49110C68B",
".klima": "0xe8b97542A433e7eCc7bB791872af04DF02A1a6E4",
".polygon": "0xa450bc33d0940d25fB0961c592fb440Fa63ABE03"
},
"568": {
".testdoge": "0xTODO"
},
"2000": {
".doge": "0xTODO",
".yode": "0xTODO"
},
"80001": {
".testsafu": "0x755F461d6a5854203b9B30C76f680356cC67556D",
".newflexi": "0xd3CEdCfAa00de70DB408528351665c55E1fFA603",
".freytest": "0x71C60ebce37cd6ee27807D5285b1acf9752e17Ee",
".testpoly": "0x4fd04c33E692B967F663B75A1976a1671E93B4dd",
".testanon": "0xBF113092d7ceabB5b891C4B232C910CDF2153AC5"
},
"42161": {
".arbi": "0xe97456E0fB121F65422F43ccbd4A07a0e269B534",
".arbitrum": "0x337EB5061943ECd247649d58D35Dbab0b40D67E0",
".smol": "0xE0d972817e94c5FF9BDc49a63d8927A0bA833E4f",
".degen": "0xcC66213645474a7B61BAf95330D01e50789eaF4b"
},
"421611": {
".fltestarbi": "0x396E60B4c971b053A2959296646B2eA5DD1f2160",
".twbtest": "0xEEAEED736cc6A6e68CC2F62be19Cf7E06ad9E94A",
".testcrew": "0x49651e70df13b8fd5684B0b82b1b3D7Cdc8cF80f",
".arbitest": "0xC6a628b1FF1aD4e304bEeACAff915559786deA2e",
".anontest": "0x61c567b26eB1B1965A1bD49febE1C1997237C519"
}
}

@ -0,0 +1,84 @@
{
"1": {
"ETH": "0x0"
},
"3": {
"ETH": "0x0"
},
"10": {
"ETH": "0x0",
"USDC": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607",
"USDT": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
"DAI": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
"sUSD": "0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9",
"SNX": "0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4"
},
"56": {
"BNB": "0x0",
"ETH": "0x2170ed0880ac9a755fd29b2688956bd959f933f8",
"USDC": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
"WBNB": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
"BUSD": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
"CREW": "0x03a2A7E95eCe3112b8d33F9bCC21F0c9BA843e35"
},
"69": {
"ETH": "0x0",
"AAVE": "0x1D882E64bb7f4D49e67018d81254236A2A6465a3",
"DAI": "0x7e8aB50697C7Abe63Bdab6B155C2FB8D285458cB"
},
"77": {
"SPOA": "0x0"
},
"97": {
"BNB": "0x0",
"ETH": "0x8babbb98678facc7342735486c851abd7a0d17ca",
"USDT": "0x7ef95a0fee0dd31b22626fa2e10ee6a223f8a684",
"WBNB": "0xae13d989dac2f0debff460ac112a837c89baa7cd",
"BUSD": "0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7"
},
"100": {
"XDAI": "0x0",
"USDC": "0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",
"GNO": "0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",
"ETH": "0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1",
"STAKE": "0xb7D311E2Eb55F2f68a9440da38e7989210b9A05e",
"USDT": "0x4ECaBa5870353805a9F068101A40E0f32ed605C6",
"AAVE": "0xDF613aF6B44a31299E48131e9347F034347E2F00"
},
"137": {
"MATIC": "0x0",
"ETH": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"DAI": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
"USDC": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"
},
"568": {
"DOGE": "0x0",
"ETH": "0xTODAO",
"DAI": "0xTODO",
"USDC": "0xTODO"
},
"2000": {
"DOGE": "0x0",
"WDOGE": "0xb7ddc6414bf4f5515b52d8bdd69973ae205ff101",
"ETH": "0xb44a9b6905af7c801311e8f4e76932ee959c663c",
"BUSD": "0x332730a4f6e03d9c55829435f10360e13cfa41ff",
"USDC": "0x765277eebeca2e31912c9946eae1021199b39c61"
},
"80001": {
"MATIC": "0x0",
"AAVE": "0x2b03FB8443A3a338f772C1EE29ACB4AeaA0Bc2ab",
"DAI": "0xFeBBF3F530A4fB3F0FBBAb9Ce72E4988972f2a08"
},
"42161": {
"ETH": "0x0",
"USDT": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
"USDC": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
"WBTC": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
"DAI": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
"LINK": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",
"UNI": "0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0"
},
"421611": {
"ETH": "0x0"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Binary file not shown.

@ -0,0 +1,21 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="34.348 16.797 238.87 271.74" width="238.87" height="271.74">
<g enable-background="new" transform="matrix(1.729551, 0, 0, 1.729551, -99.430664, -49.282986)" style="">
<g id="Layer-1" data-name="Layer">
<clipPath id="cp0">
<path transform="matrix(1,0,0,-1,0,283.465)" d="M 0 283.465 L 283.465 283.465 L 283.465 0 L 0 0 Z "></path>
</clipPath>
<g clip-path="url(#cp0)">
<path
transform="matrix(1,0,0,-1,100.9067,85.6357)"
d="M 0 0 C .105 .107 .201 .22 .307 .326 C 2.755 2.776 5.401 4.907 8.193 6.719 C 26.725 18.744 51.706 16.712 68.066 .636 C 86.548 -18.206 86.414 -48.431 67.719 -67.141 C 67.613 -67.248 67.59 -67.262 67.483 -67.367 C 67.483 -67.367 90.607 -90.355 90.732 -90.414 C 86.161 -81.059 79.218 -68.579 74.779 -59.343 C 85.139 -59.685 99.695 -59.853 110.106 -60.055 C 101.48 -53.653 90.139 -45.447 81.875 -39.027 C 91.307 -34.72 105.055 -28.543 114.553 -24.272 C 104.311 -22.116 89.834 -19.621 79.493 -17.625 C 86.126 -10.012 96.023 1.912 102.626 9.894 C 92.551 7.299 78.203 3.409 68.081 .65 C 70.939 10.781 74.614 25.553 77.153 35.568 C 69.229 28.807 57.681 18.661 49.822 12.073 C 48.031 22.067 45.177 37.32 43.088 47.429 C 38.72 37.922 32.64 23.948 28.438 14.458 C 22.278 22.728 13.505 34.793 7.171 43.318 C 7.474 32.906 7.802 17.796 8.14 7.354 C -1.087 12.103 -14.293 19.169 -23.558 23.775 C -23.499 23.65 0 0 0 0 "
fill="#DBDFEA">
</path>
<path
transform="matrix(1,0,0,-1,107.9644,195.3227)"
d="M 0 0 L -15.751 15.751 L -15.754 77.163 C -15.453 100.597 3.853 119.653 27.281 119.653 C 51.014 119.653 70.323 100.344 70.323 76.61 C 70.323 53.03 51.14 33.722 27.562 33.569 L 27.213 33.567 L 27.213 33.58 L 19.371 33.563 L 19.423 83.439 L 35.126 67.735 L 35.129 50.479 C 46.578 53.915 54.565 64.646 54.565 76.61 C 54.565 91.655 42.326 103.895 27.281 103.895 C 12.59 103.895 .357 91.946 .011 77.258 L 0 76.919 Z "
fill="#DBDFEA">
</path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="283.465pt" height="283.465pt" viewBox="0 0 283.465 283.465">
<g enable-background="new">
<g id="Layer-1" data-name="Layer">
<clipPath id="cp0">
<path transform="matrix(1,0,0,-1,0,283.465)" d="M 0 283.465 L 283.465 283.465 L 283.465 0 L 0 0 Z "/>
</clipPath>
<g clip-path="url(#cp0)">
<path transform="matrix(1,0,0,-1,100.9067,85.6357)" d="M 0 0 C .105 .107 .201 .22 .307 .326 C 2.755 2.776 5.401 4.907 8.193 6.719 C 26.725 18.744 51.706 16.712 68.066 .636 C 86.548 -18.206 86.414 -48.431 67.719 -67.141 C 67.613 -67.248 67.59 -67.262 67.483 -67.367 C 67.483 -67.367 90.607 -90.355 90.732 -90.414 C 86.161 -81.059 79.218 -68.579 74.779 -59.343 C 85.139 -59.685 99.695 -59.853 110.106 -60.055 C 101.48 -53.653 90.139 -45.447 81.875 -39.027 C 91.307 -34.72 105.055 -28.543 114.553 -24.272 C 104.311 -22.116 89.834 -19.621 79.493 -17.625 C 86.126 -10.012 96.023 1.912 102.626 9.894 C 92.551 7.299 78.203 3.409 68.081 .65 C 70.939 10.781 74.614 25.553 77.153 35.568 C 69.229 28.807 57.681 18.661 49.822 12.073 C 48.031 22.067 45.177 37.32 43.088 47.429 C 38.72 37.922 32.64 23.948 28.438 14.458 C 22.278 22.728 13.505 34.793 7.171 43.318 C 7.474 32.906 7.802 17.796 8.14 7.354 C -1.087 12.103 -14.293 19.169 -23.558 23.775 C -23.499 23.65 0 0 0 0 " fill="#ffffff"/>
<path transform="matrix(1,0,0,-1,107.9644,195.3227)" d="M 0 0 L -15.751 15.751 L -15.754 77.163 C -15.453 100.597 3.853 119.653 27.281 119.653 C 51.014 119.653 70.323 100.344 70.323 76.61 C 70.323 53.03 51.14 33.722 27.562 33.569 L 27.213 33.567 L 27.213 33.58 L 19.371 33.563 L 19.423 83.439 L 35.126 67.735 L 35.129 50.479 C 46.578 53.915 54.565 64.646 54.565 76.61 C 54.565 91.655 42.326 103.895 27.281 103.895 C 12.59 103.895 .357 91.946 .011 77.258 L 0 76.919 Z " fill="#ffffff"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@ -0,0 +1,95 @@
<template>
<div class="container-fluid text-center mt-3">
<router-link v-if="isActivated && isNetworkSupported" to="/profile">Profile</router-link>
<span v-if="isActivated && isNetworkSupported"> | </span>
<router-link to="/about">About</router-link>
<span> | </span>
<router-link to="/how">How it works</router-link>
<span> | </span>
<router-link to="/browser">Browser extension</router-link>
<span> | </span>
<a target="_blank" href="https://blog.degendomains.io">Blog</a>
<span> | </span>
<a target="_blank" href="https://github.com/degen-domains/brand-identity">Brand identity</a>
</div>
<div class="container-fluid text-center">
<a class="icons" href="http://docs.degendomains.io" target="_blank"><i class="bi bi-journal-text"></i></a>
<a class="icons" target="_blank" href="https://github.com/degen-domains"><i class="bi bi-github"></i></a>
<a class="icons" target="_blank" href="https://discord.gg/#"><i class="bi bi-discord"></i></a>
<a class="icons" target="_blank" href="https://twitter.com/DegenTLD"><i class="bi bi-twitter"></i></a>
<a class="icons" href="http://blog.degendomains.io" target="_blank"><i class="bi bi-pencil-square"></i></a>
</div>
</template>
<script>
import { useEthers } from 'vue-dapp';
import { mapGetters } from 'vuex';
export default {
name: "Footer",
computed: {
...mapGetters("network", ["isNetworkSupported"]),
},
setup() {
const { isActivated } = useEthers()
return { isActivated }
},
}
</script>
<style scoped>
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.container-fluid {
/*background-color: #24263A;*/
background-color: transparent;
padding: 20px 0px;
border-radius: 10px;
}
.icons {
margin-left: 15px;
margin-right: 15px;
font-size: 2em;
}
.polygon {
vertical-align: text-bottom;
width: 40px;
}
.polygon svg circle {
fill: #DBDFEA;
}
.polygon:hover svg circle {
fill: white;
}
</style>

@ -0,0 +1,67 @@
<template>
<td>
<span>{{domain}}</span>
</td>
<td>
<span
class="text-click"
@click="this.$router.push({name: 'DomainDetails', params: {domainChain: getChainId, tld: domain.split('.')[1], domainName: domain.split('.')[0]}})"
>
Edit domain data
</span>
</td>
<td>
<span
class="text-click"
@click="this.$router.push({name: 'TransferDomain', params: {tld: domain.split('.')[1], domainName: domain.split('.')[0]}})"
>
Transfer domain
</span>
</td>
<td>
<span v-if="getUserSelectedName === domain">
<i class="bi bi-check2-circle"></i> Default
</span>
<span
v-else
class="text-click"
@click="setAsMainName"
>
Set as main name
</span>
</td>
</template>
<script>
import { mapActions, mapGetters, mapMutations } from 'vuex';
export default {
name: "MyDomain",
props: ["domain"],
computed: {
...mapGetters("network", ["getChainId"]),
...mapGetters("user", ["getUserSelectedName"]),
},
methods: {
...mapActions("user", ["fetchSelectedNameData"]),
...mapMutations("user", ["setSelectedName"]),
setAsMainName() {
this.setSelectedName(this.domain);
this.fetchSelectedNameData();
}
}
}
</script>
<style scoped>
.text-click:hover {
color: white;
text-decoration: underline;
cursor: pointer;
}
</style>

@ -0,0 +1,84 @@
<template>
<div class="row">
<div class="col-md-12">
<div class="container">
<h3>My TLDs</h3>
<table class="table table-hover mt-4 mb-4">
<tbody>
<tr v-for="tld in ownedTlds">
<td>
<span
class="text-white text-click"
@click="this.$router.push({name: 'TldDetails', params: {domainChain: getChainId, tld: tld.substring(1) }})"
>
{{tld}}
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { useEthers } from 'vue-dapp';
import { mapGetters } from 'vuex';
export default {
name: "MyTlds",
data() {
return {
ownedTlds: null,
}
},
created() {
this.checkTldOwnership();
},
computed: {
...mapGetters("network", ["getChainId"]),
...mapGetters("degen", ["getTlds", "getTldAddresses", "getTldAbi"]),
},
methods: {
async checkTldOwnership() {
this.ownedTlds = [];
if (this.getTlds) {
for (let tld of this.getTlds) {
// construct contract
const intfc = new ethers.utils.Interface(this.getTldAbi);
const tldContract = new ethers.Contract(this.getTldAddresses[tld], intfc, this.signer);
const tldOwner = await tldContract.owner();
if (String(tldOwner).toLowerCase() === String(this.address).toLowerCase()) {
this.ownedTlds.push(tld);
}
}
}
},
},
setup() {
const { address, isActivated, signer } = useEthers()
return { address, isActivated, signer }
},
}
</script>
<style scoped>
.text-click:hover {
color: white;
text-decoration: underline;
cursor: pointer;
}
</style>

@ -0,0 +1,173 @@
<template>
<nav class="navbar sticky-top navbar-expand-lg navbar-dark">
<div class="container-fluid">
<router-link to="/" class="navbar-brand">
<img src="../assets/logo.png" alt="" width="80" class="d-inline-block navbar-img">
DEGEN DOMAINS
</router-link>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="d-flex ms-auto">
<div v-if="isActivated" class="navbar-menu-buttons">
<div class="btn-group mx-2 navbar-menu-btn navbar-other-item">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-expanded="false">
Partners
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton2">
<router-link tag="li" class="dropdown-item" to="/partners/crew">CREW (.crew domain)</router-link>
<li class="dropdown-item" @click="openUrl('http://cryptocrewnft.com')">Crypto Crew (.crew domain) <i class="bi bi-box-arrow-up-right"></i></li>
</ul>
</div>
<div class="btn-group mx-2 navbar-menu-btn navbar-other-item">
<router-link tag="button" class="btn btn-primary" to="/dao">Degen DAO</router-link>
</div>
<div v-if="isActivated" class="btn-group mx-2 navbar-menu-btn">
<router-link tag="button" class="btn btn-primary" to="/nft/anon">Mint a Degen Anon!</router-link>
</div>
<div class="btn-group mx-2 navbar-menu-btn">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
{{getNetworkName}}
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li>
<span
class="dropdown-item"
:key="network"
v-for="network in getSupportedNetworkNames"
@click="changeNetwork(network)"
>{{network}}</span>
</li>
</ul>
</div>
<div v-if="isActivated" class="btn-group mx-2">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-expanded="false">
{{ getNameOrAddress }}
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton2">
<router-link tag="li" class="dropdown-item" to="/profile">Profile</router-link>
<router-link tag="li" class="dropdown-item" to="/">Buy domain</router-link>
<router-link tag="li" class="dropdown-item" to="/search-domain">Search domain</router-link>
<router-link tag="li" class="dropdown-item" to="/send-tokens">Send tokens</router-link>
<li class="dropdown-item" @click="openUrl('http://blog.degendomains.io')">Blog</li>
<router-link tag="li" class="dropdown-item" to="/browser">Browser extension</router-link>
<li class="dropdown-item" @click="openUrl('http://docs.degendomains.io')">Docs</li>
<li class="dropdown-item" @click="logout">Disconnect</li>
</ul>
</div>
</div>
<button v-else class="btn btn-primary" @click="open">Connect wallet</button>
</div>
</div>
</div>
</nav>
</template>
<script lang="js">
import { mapGetters } from 'vuex';
import { useBoard, useEthers, useWallet } from 'vue-dapp';
import useChainHelpers from "../hooks/useChainHelpers";
export default {
name: "Navbar",
computed: {
...mapGetters("user", ["getUserShortAddress", "getUserSelectedName"]),
...mapGetters("network", ["getNetworkName", "getSupportedNetworks", "getSupportedNetworkNames"]),
getNameOrAddress() {
if (this.getUserSelectedName) {
return this.getUserSelectedName;
} else {
return this.getUserShortAddress;
}
},
},
methods: {
changeNetwork(networkName) {
const networkData = this.switchNetwork(networkName);
window.ethereum.request({
method: networkData.method,
params: networkData.params
});
},
logout() {
this.disconnect();
localStorage.clear();
localStorage.setItem("connected", "null");
},
openUrl(url) {
window.open(url, '_blank').focus();
}
},
setup() {
const { open } = useBoard();
const { disconnect } = useWallet();
const { isActivated } = useEthers();
const { switchNetwork } = useChainHelpers();
return {
isActivated, disconnect, open, switchNetwork
}
}
}
</script>
<style scoped>
.dropdown-item {
cursor: pointer;
}
.navbar-brand {
font-family: 'Panda-font', cursive;
}
.navbar-dark .navbar-brand {
color: #DBDFEA;
}
.navbar-dark {
background: rgb(63,94,251);
border-radius: 0px 0px 10px 10px;
padding: 20px;
}
.navbar-img {
margin-right: 5px;
}
@media only screen and (max-width: 767px) {
.navbar-menu-btn {
margin-bottom: 5px;
}
.navbar-other-item {
margin-top: 10px;
}
.navbar-menu-buttons {
display: flex;
flex-direction: column;
}
}
</style>

@ -0,0 +1,73 @@
<template>
<div class="row">
<div class="col-md-12 mt-3">
<div class="container text-center">
<h3>Referrals</h3>
<p>
Share this referral link and earn rewards from new domain mints!
</p>
<div class="row mt-1">
<div class="col-md-6 offset-md-3">
<input
class="form-control text-center clipboard"
:value="'https://degendomains.io/#/'+getUrlPath+'?ref=' + this.getNameOrAddress"
@click="copyToClipboard('https://degendomains.io/#/'+getUrlPath+'?ref=' + this.getNameOrAddress)"
readonly
>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { useToast, TYPE } from "vue-toastification";
export default {
name: "Referral",
props: ["urlpath"],
computed: {
...mapGetters("user", ["getUserAddress", "getUserSelectedName"]),
getNameOrAddress() {
if (this.getUserSelectedName) {
return this.getUserSelectedName;
} else {
return this.getUserAddress;
}
},
getUrlPath() {
if (this.urlpath) {
return this.urlpath;
} else {
return "";
}
}
},
methods: {
copyToClipboard(text) {
navigator.clipboard.writeText(text);
this.toast("Referral link copied to your clipboard!", {type: TYPE.SUCCESS});
}
},
setup() {
const toast = useToast();
return { toast }
},
}
</script>
<style scoped>
.clipboard {
cursor: pointer
}
</style>

@ -0,0 +1,97 @@
<template>
<div class="container">
<img :src="getUserImage" class="img-fluid img-thumbnail">
<h3 class="text-center mt-2 text-break">
{{getNameOrAddress}}
</h3>
<hr />
<router-link class="btn btn-sidebar text-start" to="/profile">
<i class="bi bi-person"></i> Profile
</router-link>
<router-link class="btn btn-sidebar text-start" to="/">
<i class="bi bi-cart4"></i> Buy domain
</router-link>
<router-link class="btn btn-sidebar text-start" to="/search-domain">
<i class="bi bi-search"></i> Search domain
</router-link>
<router-link class="btn btn-sidebar text-start" to="/send-tokens">
<i class="bi bi-send"></i> Send tokens
</router-link>
<router-link class="btn btn-sidebar text-start" to="/tlds">
<i class="bi bi-align-top"></i> TLDs
</router-link>
<router-link class="btn btn-sidebar text-start" to="/browser">
<i class="bi bi-window-plus"></i> Browser extension
</router-link>
<!--
<router-link class="btn btn-sidebar text-start" to="/buy-tld">
<i class="bi bi-window-plus"></i> Buy TLD
</router-link>
-->
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name: "Sidebar",
computed: {
...mapGetters("user", ["getUserSelectedName", "getUserShortAddress", "getUserSelectedNameImageSvg"]),
getNameOrAddress() {
if (this.getUserSelectedName) {
return this.getUserSelectedName;
} else {
return this.getUserShortAddress;
}
},
getUserImage() {
if (this.getUserSelectedNameImageSvg) {
return this.getUserSelectedNameImageSvg;
} else {
return "https://upload.wikimedia.org/wikipedia/commons/b/bc/Unknown_person.jpg"
}
}
}
}
</script>
<style scoped>
.bi {
margin-right: 5px;
}
.btn-sidebar, .btn-sidebar:focus {
padding: 10px;
width: 100%;
color: #DBDFEA;
text-decoration: none;
box-shadow: none;
}
.btn-sidebar:hover {
color: #DBDFEA;
border-color: #DBDFEA;
border-radius: 10px;
}
.img-thumbnail {
border-color: transparent;
border-radius: 15px;
}
</style>

@ -0,0 +1,290 @@
<template>
<div class="mb-3 row domain-data mt-4" v-if="customData" v-for="(dataValue, dataKey) in customData">
<div class="col-sm-3 degen-title">
{{dataKey.charAt(0).toUpperCase() + dataKey.slice(1)}}
</div>
<div class="col-sm-9 degen-text text-break">
<span v-if="dataKey=='url'"><a target="_blank" :href="dataValue">{{dataValue}}</a></span>
<span v-else-if="dataKey=='twitter'"><a target="_blank" :href="getTwitterUrl(dataValue)">{{dataValue}}</a></span>
<span v-else>{{dataValue}}</span>
</div>
</div>
<button
v-if="isOwner && isCorrectChainForDomain"
class="btn btn-primary btn-lg mx-3 mt-3"
data-bs-toggle="modal" data-bs-target="#editDataModal"
>
Edit data
</button>
<!-- Edit Other Data Modal -->
<div class="modal fade text-start" id="editDataModal" tabindex="-1" aria-labelledby="editDataModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editDataModalLabel">Edit other data</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
You can add custom data to this domain.
</p>
<p>
Example: twitter -> @myhandle
</p>
<div class="input-group mb-3 mt-4" v-if="fields" v-for="(item, index) in fields">
<input
type="text"
:key="'dataKey'+index"
class="form-control"
v-model="item.dataKey"
placeholder="Enter key (like twitter)"
>
<span class="input-group-text"><i class="bi bi-arrow-right"></i></span>
<input
type="text"
class="form-control"
:key="'dataValue'+index"
v-model="item.dataValue"
:placeholder="item.valuePlaceholder ? item.valuePlaceholder : 'Enter value'"
>
<span class="input-group-text" @click="removeField(index)"><i class="bi bi-x-circle"></i></span>
</div>
<button
class="btn btn-secondary btn-sm"
@click="addField"
>
Add new field
</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" @click="editData" :disabled="btnInactive">Edit data</button>
<button id="closeCustomDataModal" type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { mapGetters } from 'vuex';
import { useEthers } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../toasts/WaitingToast.vue";
export default {
name: "EditOtherData",
emits: ["fetchData"],
props: ["domainData", "tld", "domainName", "isCorrectChainForDomain"],
data() {
return {
btnInactive: false, // make the submit button inactive so that the user does not click on it multiple times while waiting for MetaMask to show up
fields: [
],
tldContract: null
}
},
computed: {
...mapGetters("degen", ["getTldAddresses", "getTldAbi"]),
...mapGetters("network", ["getBlockExplorerBaseUrl"]),
customData() {
if (this.domainData) {
try {
return JSON.parse(this.domainData.data);
} catch {
return null
}
}
return null
},
isOwner() {
if (this.domainData) {
return String(this.address).toLowerCase() === String(this.domainData.holder).toLowerCase();
}
},
},
methods: {
addField() {
this.fields.push({dataKey: "", dataValue: ""});
},
removeField(index) {
this.fields.splice(index, 1);
},
async editData() {
this.btnInactive = true;
if (!this.tldContract) {
this.setContract();
}
const finalData = {};
for (let item of this.fields) {
if (item.dataKey && item.dataValue) {
finalData[item.dataKey] = item.dataValue;
}
}
if (this.tldContract) {
try {
const tx = await this.tldContract.editData(this.domainName, JSON.stringify(finalData));
document.getElementById('closeCustomDataModal').click();
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully updated your domain's custom data!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.$emit("fetchData");
this.btnInactive = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.btnInactive = false;
this.inputUrl = this.domainData.url;
}
} catch (e) {
this.btnInactive = false;
console.log(e);
this.toast(e.message, {type: TYPE.ERROR});
this.inputUrl = this.domainData.url;
}
}
},
getTwitterUrl(entry) {
if (typeof entry === 'string') {
if (entry.startsWith("http")) {
return entry;
} else if (entry.startsWith("www")) {
return "https://" + entry;
} else if (entry.startsWith("twitter.com")) {
return "https://" + entry;
} else if (entry.startsWith("@")) {
return "https://twitter.com/" + entry;
} else {
return "https://twitter.com/" + entry;
}
}
},
setContract() {
let tldAddresses = this.getTldAddresses;
if (tldAddresses && JSON.stringify(tldAddresses) != "{}") {
const tldAddr = tldAddresses["."+this.tld];
// construct contract
const intfc = new ethers.utils.Interface(this.getTldAbi);
this.tldContract = new ethers.Contract(tldAddr, intfc, this.signer);
}
}
},
setup() {
const { address, signer } = useEthers();
const toast = useToast();
return { address, signer, toast }
},
watch: {
domainData() {
if (this.domainData && this.domainData.data) {
const cstmData = JSON.parse(this.domainData.data);
for (const [key, value] of Object.entries(cstmData)) {
if(this.fields.findIndex(x => x.dataKey == key) === -1) {
this.fields.push({dataKey: key, dataValue: value});
}
}
}
if(this.fields.findIndex(x => x.dataKey == "imgAddress") === -1) {
this.fields.push({dataKey: "imgAddress", dataValue: "", valuePlaceholder: "HTTP, or 0x address if NFT"});
}
if(this.fields.findIndex(x => x.dataKey == "imgTokenId") === -1) {
this.fields.push({dataKey: "imgTokenId", dataValue: "", valuePlaceholder: "Only needed if img is NFT"});
}
if(this.fields.findIndex(x => x.dataKey == "imgChainId") === -1) {
this.fields.push({dataKey: "ImgChainId", dataValue: "", valuePlaceholder: "Only needed if NFT is on a different chain than domain"});
}
if(this.fields.findIndex(x => x.dataKey == "url") === -1) {
this.fields.push({dataKey: "url", dataValue: "", valuePlaceholder: "Add any URL to redirect domain to"});
}
if(this.fields.findIndex(x => x.dataKey == "twitter") === -1) {
this.fields.push({dataKey: "twitter", dataValue: "", valuePlaceholder: "Enter your Twitter handle"});
}
if (this.isOwner && this.isCorrectChainForDomain) {
this.setContract();
}
}
}
}
</script>
<style scoped>
.form-control-plaintext {
color: #DBDFEA;
}
.degen-text {
text-align: left;
}
@media only screen and (max-width: 767px) {
.degen-text {
text-align: center;
}
.degen-title {
font-size: 1.1em;
margin-bottom: 5px;
font-weight: bold;
}
}
</style>

@ -0,0 +1,243 @@
<template>
<div class="mb-3 row domain-data mt-4" v-if="domainData">
<div class="col-sm-3 degen-title">
Custom PFP
</div>
<div class="col-sm-9 degen-text">
<span>{{customPfp}}</span>
<button
v-if="isOwner"
class="btn btn-primary btn-sm mx-3"
data-bs-toggle="modal" data-bs-target="#editPfpModal"
>Edit</button>
</div>
</div>
<!-- Edit PFP Modal -->
<div class="modal fade text-start" id="editPfpModal" tabindex="-1" aria-labelledby="editPfpModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editPfpModalLabel">Edit PFP</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
Enter the address and token ID of an NFT that you own and want to designate as the main PFP of the
{{domainName}}.{{tld}} domain.
</p>
<div class="mb-3" v-if="domainData">
<label class="form-label">Enter NFT address:</label>
<input
type="text"
class="form-control"
placeholder="0x..."
v-model="inputPfpAddress"
>
</div>
<div class="mb-3" v-if="domainData">
<label class="form-label">Enter NFT token ID:</label>
<input
type="text"
class="form-control"
v-model="inputPfpId"
>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" @click="editPfp" :disabled="btnInactive">Edit PFP data</button>
<button id="closePfpModal" type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { mapGetters } from 'vuex';
import { useEthers, shortenAddress } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../toasts/WaitingToast.vue";
export default {
name: "EditPfp",
emits: ["fetchData"],
props: ["domainData", "tld", "domainName"],
data() {
return {
inputPfpAddress: null,
inputPfpId: null,
tldContract: null,
btnInactive: false // make the submit button inactive so that the user does not click on it multiple times while waiting for MetaMask to show up
}
},
computed: {
...mapGetters("degen", ["getTldAddresses", "getTldAbi"]),
...mapGetters("network", ["getBlockExplorerBaseUrl"]),
customPfp() {
if (this.domainData.pfpAddress != ethers.constants.AddressZero) {
return this.shortenAddress(this.domainData.pfpAddress) + " (token ID: " + this.domainData.pfpTokenId + ")";
}
return "Custom PFP not set yet."
},
isOwner() {
return String(this.address).toLowerCase() === String(this.domainData.holder).toLowerCase();
},
pfpAddress() {
if (this.domainData.pfpAddress != ethers.constants.AddressZero) {
return this.domainData.pfpAddress;
}
return null
}
},
methods: {
async editPfp() {
this.btnInactive = true;
// first check if domain holder really owns this NFT
const enteredPfpAddress = this.inputPfpAddress;
const enteredPfpId = this.inputPfpId;
const pfpInterface = new ethers.utils.Interface([
"function ownerOf(uint256 tokenId) public view returns (address)"
]);
const pfpContract = new ethers.Contract(enteredPfpAddress, pfpInterface, this.signer);
let nftOwner;
try {
nftOwner = await pfpContract.ownerOf(enteredPfpId);
} catch (e) {
this.btnInactive = false;
console.log(e);
this.toast(e.message, {type: TYPE.ERROR});
this.inputPfpAddress = this.domainData.pfpAddress;
this.inputPfpId = this.domainData.pfpTokenId;
}
if (nftOwner && String(this.address).toLowerCase() != String(nftOwner).toLowerCase()) {
// if holder is not the owner, return an error toast
this.toast("It looks like your current address is not this NFT owner.", {type: TYPE.ERROR});
this.btnInactive = false;
this.inputPfpAddress = this.domainData.pfpAddress;
this.inputPfpId = this.domainData.pfpTokenId;
} else if (nftOwner && String(this.address).toLowerCase() === String(nftOwner).toLowerCase()) {
// update the NFT address and token ID for this domain
if (!this.tldContract) {
this.setContract();
}
if (this.tldContract) {
try {
const tx = await this.tldContract.editPfp(this.domainName, enteredPfpAddress, enteredPfpId);
document.getElementById('closePfpModal').click();
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.btnInactive = false;
this.toast.dismiss(toastWait);
this.toast("You have successfully updated your PFP data!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.$emit("fetchData");
} else {
this.btnInactive = false;
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.inputPfpAddress = this.domainData.pfpAddress;
this.inputPfpId = this.domainData.pfpTokenId;
}
} catch (e) {
this.btnInactive = false;
console.log(e);
this.toast(e.message, {type: TYPE.ERROR});
this.inputPfpAddress = this.domainData.pfpAddress;
this.inputPfpId = this.domainData.pfpTokenId;
}
}
}
},
setContract() {
let tldAddresses = this.getTldAddresses;
if (tldAddresses && JSON.stringify(tldAddresses) != "{}") {
const tldAddr = tldAddresses["."+this.tld];
// construct contract
const intfc = new ethers.utils.Interface(this.getTldAbi);
this.tldContract = new ethers.Contract(tldAddr, intfc, this.signer);
}
}
},
setup() {
const { address, signer } = useEthers();
const toast = useToast();
return { address, shortenAddress, signer, toast }
},
watch: {
domainData() {
if (this.domainData.pfpAddress != ethers.constants.AddressZero) {
this.inputPfpAddress = this.domainData.pfpAddress;
this.inputPfpId = this.domainData.pfpTokenId;
}
}
}
}
</script>
<style scoped>
.degen-text {
text-align: left;
}
@media only screen and (max-width: 767px) {
.degen-text {
text-align: center;
}
.degen-title {
font-size: 1.1em;
margin-bottom: 5px;
font-weight: bold;
}
}
</style>

@ -0,0 +1,188 @@
<template>
<div class="mb-3 row domain-data mt-4" v-if="domainData">
<div class="col-sm-3 degen-title">
URL
</div>
<div class="col-sm-9 degen-text">
<span>{{urlData}}</span>
<button
v-if="isOwner"
class="btn btn-primary btn-sm mx-3"
data-bs-toggle="modal" data-bs-target="#editUrlModal"
>Edit</button>
</div>
</div>
<!-- Edit URL Modal -->
<div class="modal fade" id="editUrlModal" tabindex="-1" aria-labelledby="editUrlModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editUrlModalLabel">Edit URL</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
Anyone who's using the Degen browser extension will get redirected to this URL if they enter
{{domainName}}.{{tld}} in the browser URL bar.
</p>
<div class="mb-3" v-if="domainData">
<input
type="text"
class="form-control"
placeholder="Enter URL"
v-model="inputUrl"
>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" @click="editUrl" :disabled="btnInactive">Edit URL</button>
<button id="closeUrlModal" type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { mapGetters } from 'vuex';
import { useEthers } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../toasts/WaitingToast.vue";
export default {
name: "EditUrl",
emits: ["fetchData"],
props: ["domainData", "tld", "domainName"],
data() {
return {
inputUrl: null,
tldContract: null,
btnInactive: false // make the submit button inactive so that the user does not click on it multiple times while waiting for MetaMask to show up
}
},
computed: {
...mapGetters("degen", ["getTldAddresses", "getTldAbi"]),
...mapGetters("network", ["getBlockExplorerBaseUrl"]),
isOwner() {
return String(this.address).toLowerCase() === String(this.domainData.holder).toLowerCase();
},
urlData() {
if (this.domainData.url) {
return this.domainData.url;
}
return "Redirect URL not set yet."
}
},
methods: {
async editUrl() {
this.btnInactive = true;
if (!this.tldContract) {
this.setContract();
}
if (this.tldContract) {
try {
const tx = await this.tldContract.editUrl(this.domainName, this.inputUrl);
document.getElementById('closeUrlModal').click();
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully updated the URL!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.$emit("fetchData");
this.btnInactive = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.btnInactive = false;
this.inputUrl = this.domainData.url;
}
} catch (e) {
this.btnInactive = false;
console.log(e);
this.toast(e.message, {type: TYPE.ERROR});
this.inputUrl = this.domainData.url;
}
}
},
setContract() {
let tldAddresses = this.getTldAddresses;
if (tldAddresses && JSON.stringify(tldAddresses) != "{}") {
const tldAddr = tldAddresses["."+this.tld];
// construct contract
const intfc = new ethers.utils.Interface(this.getTldAbi);
this.tldContract = new ethers.Contract(tldAddr, intfc, this.signer);
}
}
},
setup() {
const { address, signer } = useEthers();
const toast = useToast();
return { address, signer, toast }
},
watch: {
domainData() {
this.inputUrl = this.domainData.url;
}
}
}
</script>
<style scoped>
.degen-text {
text-align: left;
}
@media only screen and (max-width: 767px) {
.degen-text {
text-align: center;
}
.degen-title {
font-size: 1.1em;
margin-bottom: 5px;
font-weight: bold;
}
}
</style>

@ -0,0 +1,13 @@
<template>
<div>
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span class="mx-2">{{text}}</span>
</div>
</template>
<script>
export default {
name: "WaitingToast",
props: ["text"]
}
</script>

8
src/env.d.ts vendored

@ -0,0 +1,8 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}

@ -0,0 +1,256 @@
import { ethers } from 'ethers';
export default function useChainHelpers() {
function getChainName(chainId) {
if (chainId === 137) {
return "Polygon";
} else if (chainId === 1) {
return "Ethereum";
} else if (chainId === 10) {
return "Optimism";
} else if (chainId === 56) {
return "BNB Smart Chain";
} else if (chainId === 97) {
return "BSC Testnet";
} else if (chainId === 69) {
return "Optimism Testnet";
} else if (chainId === 77) {
return "Gnosis Testnet";
} else if (chainId === 100) {
return "Gnosis Chain";
} else if (chainId === 137) {
return "Polygon";
} else if (chainId === 42161) {
return "Arbitrum";
} else if (chainId === 2000) {
return "Dogechain";
} else if (chainId === 421611) {
return "Arbitrum Testnet";
} else if (chainId === 80001) {
return "Polygon Testnet";
} else if (chainId === 3) {
return "Ropsten";
} else if (chainId === 4) {
return "Rinkeby";
} else if (chainId === 568) {
return "Doge Testnet";
} else {
return "Unsupported Network";
}
}
function getFallbackProvider(networkId) {
let urls;
if (networkId === 1) {
// Ethereum
urls = [
"https://eth-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_ETHEREUM_KEY
];
} else if (networkId === 137) {
// Polygon PoS Chain
urls = [
"https://polygon-rpc.com/",
"https://polygon-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_POLYGON_KEY
];
} else if (networkId === 80001) {
// Mumbai testnet (Polygon testnet)
urls = [
"https://matic-mumbai.chainstacklabs.com",
"https://polygon-mumbai.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_MUMBAI_KEY
]
} else if (networkId === 10) {
// Optimism
urls = [
"https://mainnet.optimism.io",
"https://opt-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_OPTIMISM_KEY
];
} else if (networkId === 56) {
// BSC mainnet
urls = [
"https://bscrpc.com"
];
} else if (networkId === 97) {
// BSC testnet
urls = [
"https://data-seed-prebsc-2-s2.binance.org:8545"
];
} else if (networkId === 77) {
// Gnosis Chain testnet (Sokol)
urls = [
"https://sokol.poa.network"
];
} else if (networkId === 100) {
// Gnosis Chain
urls = [
"https://rpc.xdaichain.com",
"https://rpc.gnosischain.com"
];
} else if (networkId === 42161) {
// Arbitrum
urls = [
"https://arb1.arbitrum.io/rpc",
"https://arb-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_ARBITRUM_KEY
];
} else if (networkId === 421611) {
// Arbitrum testnet
urls = [
"https://rinkeby.arbitrum.io/rpc"
];
} else if (networkId === 2000) {
// Dogechain
urls = [
"https://rpc.dogechain.dog"
];
} else if (networkId === 568) {
// Doge Testnet
urls = [
"https://rpc-testnet.dogechain.dog"
];
}
if (urls) {
const providers = urls.map(url => new ethers.providers.JsonRpcProvider(url));
return new ethers.providers.FallbackProvider(providers, 1); // return fallback provider
} else {
return null;
}
}
function switchNetwork(networkName) {
let method;
let params;
if (networkName == "Ethereum") {
method = "wallet_switchEthereumChain"
params = [{ chainId: "0x1" }]
} else if (networkName == "Ropsten") {
method = "wallet_switchEthereumChain"
params = [{ chainId: "0x3" }]
} else if (networkName == "Rinkeby") {
method = "wallet_switchEthereumChain"
params = [{ chainId: "0x4" }]
} else if (networkName == "Polygon Testnet") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://mumbai.polygonscan.com" ],
chainId: "0x13881",
chainName: "Mumbai Testnet",
nativeCurrency: { decimals: 18, name: "Matic", symbol: "MATIC" },
rpcUrls: ["https://matic-mumbai.chainstacklabs.com"]
}]
} else if (networkName == "Arbitrum Testnet") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://testnet.arbiscan.io" ],
chainId: "0x66EEB",
chainName: "Arbitrum Testnet",
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://rinkeby.arbitrum.io/rpc"]
}]
} else if (networkName == "Arbitrum") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://arbiscan.io" ],
chainId: "0xA4B1",
chainName: "Arbitrum One",
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://arb1.arbitrum.io/rpc"]
}]
} else if (networkName == "Optimism") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://optimistic.etherscan.io/" ],
chainId: "0xA",
chainName: "Optimism",
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://mainnet.optimism.io"]
}]
} else if (networkName == "Optimism Testnet") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://kovan-optimistic.etherscan.io/" ],
chainId: "0x45",
chainName: "Optimism Testnet",
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://kovan.optimism.io"]
}]
} else if (networkName == "Polygon") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://polygonscan.com" ],
chainId: "0x89",
chainName: "Polygon PoS Chain",
nativeCurrency: { decimals: 18, name: "MATIC", symbol: "MATIC" },
rpcUrls: ["https://polygon-rpc.com/"]
}]
} else if (networkName == "Gnosis Testnet") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://blockscout.com/poa/sokol" ],
chainId: "0x4D",
chainName: "Gnosis Testnet",
nativeCurrency: { decimals: 18, name: "SPOA", symbol: "SPOA" },
rpcUrls: ["https://sokol.poa.network"]
}]
} else if (networkName == "Gnosis Chain") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://blockscout.com/xdai/mainnet" ],
chainId: "0x64",
chainName: "Gnosis Chain",
nativeCurrency: { decimals: 18, name: "XDAI", symbol: "XDAI" },
rpcUrls: ["https://rpc.gnosischain.com"]
}]
} else if (networkName == "BNB Smart Chain") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://bscscan.com/" ],
chainId: "0x38",
chainName: "BNB Smart Chain",
nativeCurrency: { decimals: 18, name: "BNB", symbol: "BNB" },
rpcUrls: ["https://bscrpc.com"]
}]
} else if (networkName == "BSC Testnet") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://testnet.bscscan.com/" ],
chainId: "0x61",
chainName: "BSC Testnet",
nativeCurrency: { decimals: 18, name: "BNB", symbol: "BNB" },
rpcUrls: ["https://data-seed-prebsc-1-s3.binance.org:8545"]
}]
} else if (networkName == "Dogechain") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://explorer.dogechain.dog/" ],
chainId: "0x7D0",
chainName: "Dogechain",
nativeCurrency: { decimals: 18, name: "DOGE", symbol: "DOGE" },
rpcUrls: ["https://rpc.dogechain.dog"]
}]
} else if (networkName == "Doge Testnet") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://explorer-testnet.dogechain.dog/" ],
chainId: "0x238",
chainName: "Doge Testnet",
nativeCurrency: { decimals: 18, name: "DOGE", symbol: "DOGE" },
rpcUrls: ["https://rpc-testnet.dogechain.dog"]
}]
}
return {
method: method,
params: params
}
}
// RETURN
return {
getChainName,
getFallbackProvider,
switchNetwork
}
}

@ -0,0 +1,285 @@
export default function useDomainHelpers() {
function buyNotValid(domainName: string) {
if (domainName === "") {
return {invalid: true, message: null};
} else if (domainName === null) {
return {invalid: true, message: null};
} else if (domainName.includes(".")) {
return {invalid: true, message: "Dots not allowed"};
} else if (domainName.includes(" ")) {
return {invalid: true, message: "Spaces not allowed"};
} else if (domainName.includes("%")) {
return {invalid: true, message: "% not allowed"};
} else if (domainName.includes("&")) {
return {invalid: true, message: "& not allowed"};
} else if (domainName.includes("?")) {
return {invalid: true, message: "? not allowed"};
} else if (domainName.includes("#")) {
return {invalid: true, message: "# not allowed"};
} else if (domainName.includes("/")) {
return {invalid: true, message: "/ not allowed"};
} else if (domainName.includes(",")) {
return {invalid: true, message: "Comma not allowed"};
} else if (domainName.length < 2) {
return {invalid: true, message: "Domain name must be longer than 1 character"};
} else if (
domainName.includes("\\") ||
domainName.includes("­") ||
domainName.includes(" ") ||
domainName.includes("͏") ||
domainName.includes("؜") ||
domainName.includes("܏") ||
domainName.includes("ᅟ") ||
domainName.includes("ᅠ") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes(" ") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes(" ") ||
domainName.includes("⠀") ||
domainName.includes("ㅤ") ||
domainName.includes("ᅠ") ||
domainName.includes("𑂱") ||
domainName.includes("𛲠") ||
domainName.includes("𛲡") ||
domainName.includes("𛲢") ||
domainName.includes("𛲣") ||
domainName.includes("𝅙") ||
domainName.includes("𝅳") ||
domainName.includes("𝅴") ||
domainName.includes("𝅵") ||
domainName.includes("𝅶") ||
domainName.includes("𝅷") ||
domainName.includes("𝅸") ||
domainName.includes("𝅹") ||
domainName.includes("𝅺") ||
domainName.includes(" ") ||
domainName.includes(" ") ||
domainName.includes("…")
) {
return {invalid: true, message: "This character is not allowed"};
}
return false;
}
function buyNotValidFlexi(domainName: string) {
if (domainName === "") {
return {invalid: true, message: null};
} else if (domainName === null) {
return {invalid: true, message: null};
} else if (domainName.includes(".")) {
return {invalid: true, message: "Dots not allowed"};
} else if (domainName.includes(" ")) {
return {invalid: true, message: "Spaces not allowed"};
} else if (domainName.includes("%")) {
return {invalid: true, message: "% not allowed"};
} else if (domainName.includes("&")) {
return {invalid: true, message: "& not allowed"};
} else if (domainName.includes("?")) {
return {invalid: true, message: "? not allowed"};
} else if (domainName.includes("#")) {
return {invalid: true, message: "# not allowed"};
} else if (domainName.includes("/")) {
return {invalid: true, message: "/ not allowed"};
} else if (domainName.includes(",")) {
return {invalid: true, message: "Comma not allowed"};
} else if (
domainName.includes("\\") ||
domainName.includes("­") ||
domainName.includes(" ") ||
domainName.includes("͏") ||
domainName.includes("؜") ||
domainName.includes("܏") ||
domainName.includes("ᅟ") ||
domainName.includes("ᅠ") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes(" ") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes(" ") ||
domainName.includes("⠀") ||
domainName.includes("ㅤ") ||
domainName.includes("ᅠ") ||
domainName.includes("𑂱") ||
domainName.includes("𛲠") ||
domainName.includes("𛲡") ||
domainName.includes("𛲢") ||
domainName.includes("𛲣") ||
domainName.includes("𝅙") ||
domainName.includes("𝅳") ||
domainName.includes("𝅴") ||
domainName.includes("𝅵") ||
domainName.includes("𝅶") ||
domainName.includes("𝅷") ||
domainName.includes("𝅸") ||
domainName.includes("𝅹") ||
domainName.includes("𝅺") ||
domainName.includes(" ") ||
domainName.includes(" ") ||
domainName.includes("…")
) {
return {invalid: true, message: "This character is not allowed"};
}
return false;
}
function tldBuyNotValid(domainName: string) {
if (domainName === "") {
return {invalid: true, message: null};
} else if (domainName === null) {
return {invalid: true, message: null};
} else if (domainName.includes(".")) {
return {invalid: true, message: "Dots not allowed"};
} else if (domainName.includes(" ")) {
return {invalid: true, message: "Spaces not allowed"};
} else if (domainName.includes("%")) {
return {invalid: true, message: "% not allowed"};
} else if (domainName.includes("&")) {
return {invalid: true, message: "& not allowed"};
} else if (domainName.includes("?")) {
return {invalid: true, message: "? not allowed"};
} else if (domainName.includes("#")) {
return {invalid: true, message: "# not allowed"};
} else if (domainName.includes("/")) {
return {invalid: true, message: "/ not allowed"};
} else if (domainName.includes(",")) {
return {invalid: true, message: "Comma not allowed"};
} else if (domainName.length < 2) {
return {invalid: true, message: "Domain name must be longer than 1 character"};
} else if (
domainName.includes("\\") ||
domainName.includes("­") ||
domainName.includes(" ") ||
domainName.includes("͏") ||
domainName.includes("؜") ||
domainName.includes("܏") ||
domainName.includes("ᅟ") ||
domainName.includes("ᅠ") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes(" ") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes("") ||
domainName.includes(" ") ||
domainName.includes("⠀") ||
domainName.includes("ㅤ") ||
domainName.includes("ᅠ") ||
domainName.includes("𑂱") ||
domainName.includes("𛲠") ||
domainName.includes("𛲡") ||
domainName.includes("𛲢") ||
domainName.includes("𛲣") ||
domainName.includes("𝅙") ||
domainName.includes("𝅳") ||
domainName.includes("𝅴") ||
domainName.includes("𝅵") ||
domainName.includes("𝅶") ||
domainName.includes("𝅷") ||
domainName.includes("𝅸") ||
domainName.includes("𝅹") ||
domainName.includes("𝅺") ||
domainName.includes(" ") ||
domainName.includes(" ") ||
domainName.includes("…")
) {
return {invalid: true, message: "This character is not allowed"};
}
return false;
}
// RETURN
return {
buyNotValid,
buyNotValidFlexi,
tldBuyNotValid
}
}

@ -0,0 +1,109 @@
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;700&display=swap');
@font-face {
font-family: "Panda-font";
src: url("assets/River Adventurer.ttf");
}
@font-face {
font-family: "bamboo";
src: url("assets/font/BalsamiqSans-Regular.ttf");
}
a {
color: #DBDFEA;
}
a:hover {
color: #ffffff;
}
body {
font-family: 'bamboo';
background: rgb(63,94,251);
color: #DBDFEA;
}
p {
font-size: 18px;
}
div {
font-size: 18px;
}
hr {
background-color: #DBDFEA;
}
.btn-primary, .btn-primary:active, .btn-primary:focus, .btn-primary:disabled {
background: transparent;
border-color: #DBDFEA;
box-shadow: none;
color: #DBDFEA;
}
.btn-primary:hover {
color: black;
border-color: #ffffff;
background: #ffffff;
}
.btn-secondary, .btn-secondary:active, .btn-secondary:focus, .btn-secondary:disabled {
background: white;
border-color: black;
box-shadow: none;
color: black;
}
.btn-secondary:hover {
color: black;
border-color: #ffffff;
background: #ffffff;
}
.container {
background: transparent;
padding: 20px;
border-radius: 10px;
border: 1px solid #DBDFEA;
}
.img-thumbnail {
background-color: transparent;
}
.modal-content {
color: black;
}
.span-link:hover {
color: white;
text-decoration: none;
cursor: pointer;
}
.span-link {
text-decoration: underline;
}
.Vue-Toastification__toast--info {
background-color: #3a1174;
border: 1px solid #DBDFEA;
}
.Vue-Toastification__toast--success {
background-color: #4b7411;
border: 1px solid #DBDFEA;
}
.Vue-Toastification__toast--error {
background-color: #741911;
border: 1px solid #DBDFEA;
}
@media only screen and (max-width: 767px) {
#sidebar-container {
margin-bottom: 15px;
}
}

@ -0,0 +1,46 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import "bootstrap/dist/css/bootstrap.min.css"
import "bootstrap"
import "bootstrap-icons/font/bootstrap-icons.css"
import Toast, { POSITION, TYPE } from "vue-toastification";
import "vue-toastification/dist/index.css";
import './index.css'
import { VueDapp } from 'vue-dapp'
import { Buffer } from 'buffer';
window.Buffer = Buffer;
const app = createApp(App)
const options = {
timeout: 5000,
hideProgressBar: true,
closeButton: "button",
position:POSITION.TOP_LEFT,
toastClassName: "degen-toast-class",
closeOnClick: false,
toastDefaults: {
// ToastOptions object for each type of toast
[TYPE.INFO]: {
timeout: false,
icon: false
}
}
}
app.use(router)
app.use(store)
app.use(VueDapp, {
infuraId: 'wallet',
appName: 'Domain',
appUrl: 'localhost'
})
app.use(Toast, options);
app.mount('#app')

@ -0,0 +1,118 @@
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import About from './views/About.vue'
import BrowserExtension from './views/BrowserExtension.vue'
import DomainDetails from './views/DomainDetails.vue'
import Home from './views/Home.vue'
import HowItWorks from './views/HowItWorks.vue'
import DegenDao from './views/DegenDao.vue'
import Crew from './views/partners/Crew.vue'
import Profile from './views/Profile.vue'
import DegenAnonNft from './views/nft/DegenAnonNft.vue'
import DegenAnonMint from './views/nft/DegenAnonMint.vue'
import SearchDomains from './views/SearchDomains.vue'
import SendTokens from './views/SendTokens.vue'
import TldBuy from './views/TldBuy.vue'
import TldDetails from './views/TldDetails.vue'
import Tlds from './views/Tlds.vue'
import TransferDomain from './views/TransferDomain.vue'
// For info on using Vue Router with the Composition API, see https://next.router.vuejs.org/guide/advanced/composition-api.html
const routes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'Home',
component: Home,
},
{
path: '/about',
name: 'About',
component: About,
},
{
path: '/browser',
name: 'BrowserExtension',
component: BrowserExtension,
},
{
path: '/domain/:domainChain/:tld/:domainName',
name: 'DomainDetails',
component: DomainDetails,
props: true
},
{
path: '/how',
name: 'HowItWorks',
component: HowItWorks,
},
{
path: '/nft/anon',
name: 'DegenAnonNFT',
component: DegenAnonNft,
},
{
path: '/partners/crew',
name: 'Crew',
component: Crew,
props: true
},
{
path: '/profile',
name: 'Profile',
component: Profile,
},
{
path: '/search-domain',
name: 'SearchDomains',
component: SearchDomains,
},
{
path: '/send-tokens',
name: 'SendTokens',
component: SendTokens,
},
{
path: '/transfer/:tld/:domainName',
name: 'TransferDomain',
component: TransferDomain,
props: true
},
{
path: '/buy-tld',
name: 'TldBuy',
component: TldBuy,
props: true
},
{
path: '/tld/:domainChain/:tld',
name: 'TldDetails',
component: TldDetails,
props: true
},
{
path: '/tlds/',
name: 'Tlds',
component: Tlds,
},
{
path: '/dao/',
name: 'DegenDao',
component: DegenDao,
},
// Fallback route for handling 404s
{
path: '/:pathMatch(.*)*',
name: '404',
component: () => import('./views/Error404.vue'),
},
]
const router = createRouter({
// If app is not hosted at the domain root, make sure to pass the `base` input here: https://next.router.vuejs.org/api/#parameters
history: createWebHashHistory(),
routes,
})
export default router

@ -0,0 +1,15 @@
import { createStore } from 'vuex';
import network from "./modules/network";
import user from "./modules/user";
import degen from "./modules/degen";
const store = createStore({
modules: {
network,
user,
degen
}
})
export default store;

@ -0,0 +1,73 @@
import { ethers } from 'ethers';
import { useEthers } from 'vue-dapp';
import addresses from "../../abi/addresses.json";
import tldsJson from "../../abi/tlds.json";
import factoryAbi from "../../abi/DegenTLDFactory.json";
import tldAbi from "../../abi/DegenTLD.json";
const { chainId, signer } = useEthers();
export default {
namespaced: true,
state: () => ({
domainPrices: null, // object of key/value pairs where key is TLD name and value is domain price
factoryAddress: null,
tlds: [],
tldsKey: null,
tldAddresses: {}, // object of key/value pairs where key is TLD name and value is TLD address
tldAddressesKey: null
}),
getters: {
getDomainPrices(state) {
return state.domainPrices;
},
getTlds(state) {
return state.tlds;
},
getTldAddresses(state) {
return state.tldAddresses;
},
getTldAddressesKey(state) {
return state.tldAddressesKey;
},
getTldAbi() {
return tldAbi;
},
getFactoryAbi() {
return factoryAbi;
}
},
actions: {
async fetchTlds({ dispatch, commit, state, getters }) {
let networkId = 137;
if (chainId.value) {
networkId = chainId.value;
}
state.tlds = [];
for (let tld of Object.keys(tldsJson[networkId])) {
state.tlds.push(tld);
state.tldAddresses[tld] = tldsJson[networkId][tld];
const intfc = new ethers.utils.Interface(getters.getTldAbi);
const contract = new ethers.Contract(tldsJson[networkId][tld], intfc, signer.value);
const price = await contract.price();
if (!state.domainPrices) {
state.domainPrices = {}
}
state.domainPrices[tld] = price;
}
// fetch user's default names
dispatch('user/fetchUserDomainNames', null, { root: true });
}
}
};

@ -0,0 +1,252 @@
import { ethers } from 'ethers';
import { useEthers } from 'vue-dapp';
import tokens from "../../abi/tokens.json";
const { chainId } = useEthers();
export default {
namespaced: true,
state: () => ({
networkCurrency: "ETH",
networkName: "Unsupported Network",
supportedNetworks: {
10: "Optimism",
100: "Gnosis Chain",
137: "Polygon",
42161: "Arbitrum",
56: "BNB Smart Chain",
97: "BSC Testnet",
2000: "Dogechain",
568: "Doge Testnet"
}
}),
getters: {
getBlockExplorerBaseUrl() {
if (chainId.value === 1) {
return "https://etherscan.io";
} else if (chainId.value === 3) {
return "https://ropsten.etherscan.io";
} else if (chainId.value === 4) {
return "https://rinkeby.etherscan.io";
} else if (chainId.value === 10) {
return "https://optimistic.etherscan.io";
} else if (chainId.value === 56) {
return "https://bscscan.com";
} else if (chainId.value === 97) {
return "https://testnet.bscscan.com";
} else if (chainId.value === 69) {
return "https://kovan-optimistic.etherscan.io";
} else if (chainId.value === 77) {
return "https://blockscout.com/poa/sokol";
} else if (chainId.value === 100) {
return "https://blockscout.com/xdai/mainnet";
} else if (chainId.value === 137) {
return "https://polygonscan.com";
} else if (chainId.value === 42161) {
return "https://arbiscan.io";
} else if (chainId.value === 80001) {
return "https://mumbai.polygonscan.com";
} else if (chainId.value === 421611) {
return "https://testnet.arbiscan.io";
} else if (chainId.value === 2000) {
return "https://explorer.dogechain.dog/";
} else if (chainId.value === 568) {
return "https://explorer-testnet.dogechain.dog/";
}
},
getChainId() {
return chainId.value;
},
getFallbackProvider: (state) => (networkId) => {
let urls;
if (networkId === 1) {
// Ethereum
urls = [
"https://eth-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_ETHEREUM_KEY
];
} else if (networkId === 3) {
// Ropsten testnet
} else if (networkId === 4) {
// Rinkeby testnet
} else if (networkId === 10) {
// Optimism
urls = [
"https://mainnet.optimism.io",
"https://opt-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_OPTIMISM_KEY
];
} else if (networkId === 56) {
// BSC mainnet
urls = [
"https://bscrpc.com"
];
} else if (networkId === 97) {
// BSC testner
urls = [
"https://data-seed-prebsc-1-s1.binance.org:8545"
];
} else if (networkId === 69) {
// Optimism testnet
urls = [
"https://kovan.optimism.io"
];
} else if (networkId === 77) {
// Gnosis Chain testnet (Sokol)
urls = [
"https://sokol.poa.network"
];
} else if (networkId === 100) {
// Gnosis Chain
urls = [
"https://rpc.xdaichain.com",
"https://rpc.gnosischain.com"
];
} else if (networkId === 137) {
// Polygon PoS Chain
urls = [
"https://polygon-rpc.com/",
"https://polygon-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_POLYGON_KEY
];
} else if (networkId === 42161) {
// Arbitrum
urls = [
"https://arb1.arbitrum.io/rpc",
"https://arb-mainnet.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_ARBITRUM_KEY
];
} else if (networkId === 80001) {
// Mumbai testnet (Polygon testnet)
urls = [
"https://matic-mumbai.chainstacklabs.com",
"https://polygon-mumbai.g.alchemy.com/v2/" + import.meta.env.VITE_ALCHEMY_MUMBAI_KEY
]
} else if (networkId === 421611) {
// Arbitrum testnet
urls = [
"https://rinkeby.arbitrum.io/rpc"
];
} else if (networkId === 568) {
// Dogechain testnet
urls = [
"https://rpc-testnet.dogechain.dog"
];
} else if (networkId === 2000) {
// Dogechain Mainnet
urls = [
"https://rpc02-sg.dogechain.dog"
];
}
if (urls) {
const providers = urls.map(url => new ethers.providers.JsonRpcProvider(url));
return new ethers.providers.FallbackProvider(providers, 1); // return fallback provider
} else {
return null;
}
},
getNetworkCurrency(state) {
return state.networkCurrency;
},
getNetworkName(state) {
const supportedIds = Object.keys(state.supportedNetworks);
if (supportedIds && supportedIds.includes(String(chainId.value))) {
return state.networkName;
}
return "Unsupported Network";
},
getSupportedNetworks(state) {
return state.supportedNetworks;
},
getSupportedNetworkIds(state) {
return Object.keys(state.supportedNetworks);
},
getSupportedNetworkNames(state) {
return Object.values(state.supportedNetworks);
},
getTokens(state) {
return tokens[String(chainId.value)]
},
isNetworkSupported(state) {
const supportedIds = Object.keys(state.supportedNetworks);
if (supportedIds && supportedIds.includes(String(chainId.value))) {
return true;
}
return false;
}
},
mutations: {
setNetworkData(state) {
if (chainId.value === 137) {
state.networkName = "Polygon";
state.networkCurrency = "MATIC";
} else if (chainId.value === 1) {
state.networkName = "Ethereum";
state.networkCurrency = "ETH";
} else if (chainId.value === 10) {
state.networkName = "Optimism";
state.networkCurrency = "ETH";
} else if (chainId.value === 56) {
state.networkName = "BNB Smart Chain";
state.networkCurrency = "BNB";
} else if (chainId.value === 69) {
state.networkName = "Optimism Testnet";
state.networkCurrency = "ETH";
} else if (chainId.value === 77) {
state.networkName = "Gnosis Testnet";
state.networkCurrency = "SPOA";
} else if (chainId.value === 100) {
state.networkName = "Gnosis Chain";
state.networkCurrency = "XDAI";
} else if (chainId.value === 137) {
state.networkName = "Polygon";
state.networkCurrency = "MATIC";
} else if (chainId.value === 42161) {
state.networkName = "Arbitrum";
state.networkCurrency = "ETH";
} else if (chainId.value === 421611) {
state.networkName = "Arbitrum Testnet";
state.networkCurrency = "ETH";
} else if (chainId.value === 80001) {
state.networkName = "Polygon Testnet";
state.networkCurrency = "MATIC";
} else if (chainId.value === 3) {
state.networkName = "Ropsten";
state.networkCurrency = "ETH";
} else if (chainId.value === 568) {
state.networkName = "Doge Testnet";
state.networkCurrency = "DOGE";
} else if (chainId.value === 2000) {
state.networkName = "Dogechain";
state.networkCurrency = "DOGE";
} else if (chainId.value === 4) {
state.networkName = "Rinkeby";
state.networkCurrency = "ETH";
} else {
state.networkName = "Unsupported Network";
state.networkCurrency = "ETH";
}
}
},
actions: {
}
};

@ -0,0 +1,19 @@
export default {
namespaced: true,
state: () => ({
}),
getters: {
},
mutations: {
},
actions: {
}
};

@ -0,0 +1,283 @@
import { ethers } from 'ethers';
import { useEthers, displayEther, shortenAddress } from 'vue-dapp';
import useChainHelpers from "../../hooks/useChainHelpers";
const { getFallbackProvider } = useChainHelpers();
const { address, balance, chainId, signer } = useEthers();
export default {
namespaced: true,
state: () => ({
selectedName: null, // domain name that appears as the main profile name
selectedNameData: null,
selectedNameImageSvg: null,
selectedNameKey: null,
userAddress: null,
userAllDomainNames: [], // all domain names of current user (default + manually added)
userDomainNamesKey: null,
userShortAddress: null,
userBalanceWei: 0,
userBalance: 0
}),
getters: {
getUserAddress(state) {
return state.userAddress;
},
getUserBalance(state) {
return state.userBalance;
},
getUserBalanceWei(state) {
return state.userBalanceWei;
},
getUserAllDomainNames(state) {
return state.userAllDomainNames;
},
getUserSelectedName(state) {
return state.selectedName;
},
getUserSelectedNameData(state) {
return state.selectedNameData;
},
getUserSelectedNameImageSvg(state) {
return state.selectedNameImageSvg;
},
getUserShortAddress(state) {
return state.userShortAddress;
},
},
mutations: {
addDomainManually(state, domainName) {
let userDomainNames = [];
if (chainId.value) {
this.userDomainNamesKey = "userDomainNames" + String(chainId.value) + String(shortenAddress(address.value));
this.selectedNameKey = "selectedName" + String(chainId.value) + String(shortenAddress(address.value));
if (localStorage.getItem(this.userDomainNamesKey)) {
userDomainNames = JSON.parse(localStorage.getItem(this.userDomainNamesKey));
}
if (!userDomainNames.includes(domainName)) {
userDomainNames.push(domainName);
}
for (let udName of userDomainNames) {
if (!state.userAllDomainNames.includes(udName)) {
state.userAllDomainNames.push(udName);
}
}
localStorage.setItem(this.userDomainNamesKey, JSON.stringify(userDomainNames));
}
},
setUserData(state) {
state.userAddress = address.value;
state.userShortAddress = shortenAddress(address.value);
state.userBalanceWei = balance.value;
state.userBalance = displayEther(balance.value);
},
setDefaultName(state, defName) {
if (!state.userAllDomainNames.includes(defName)) {
state.userAllDomainNames.push(defName);
}
},
setSelectedName(state, selectedName) {
state.selectedName = selectedName;
localStorage.setItem(this.selectedNameKey, state.selectedName);
localStorage.setItem("connected", "metamask");
},
setSelectedNameData(state, nameData) {
state.selectedNameData = nameData;
},
setSelectedNameImageSvg(state, imageSvg) {
state.selectedNameImageSvg = imageSvg;
},
setUserAllDomainNames(state, domains) {
state.userAllDomainNames = domains;
}
},
actions: {
async fetchUserDomainNames({ dispatch, commit, state, rootState, rootGetters }, newAccount) {
let userDomainNames = [];
if (chainId.value) {
this.userDomainNamesKey = "userDomainNames" + String(chainId.value) + String(shortenAddress(address.value));
this.selectedNameKey = "selectedName" + String(chainId.value) + String(shortenAddress(address.value));
}
// reset user data in case there's a switch between accounts
if (newAccount) {
if (localStorage.getItem(this.selectedNameKey) && localStorage.getItem(this.selectedNameKey) !== String(null)) {
commit('setSelectedName', localStorage.getItem(this.selectedNameKey));
} else {
commit('setSelectedName', null);
commit("setSelectedNameData", null);
commit("setSelectedNameImageSvg", null);
}
commit("setUserAllDomainNames", []);
}
if (localStorage.getItem(this.userDomainNamesKey)) {
userDomainNames = JSON.parse(localStorage.getItem(this.userDomainNamesKey));
}
for (let udName of userDomainNames) {
commit('setDefaultName', udName);
}
// fetch user's default names
for (let tldName of rootState.degen.tlds) {
const intfc = new ethers.utils.Interface(rootGetters["degen/getTldAbi"]);
const contract = new ethers.Contract(rootState.degen.tldAddresses[tldName], intfc, signer.value);
const userDefaultName = await contract.defaultNames(address.value);
if (userDefaultName) {
commit('setDefaultName', userDefaultName + tldName);
if (!userDomainNames.includes(userDefaultName + tldName)) {
userDomainNames.push(userDefaultName + tldName);
}
if (!state.selectedName) {
commit('setSelectedName', userDefaultName + tldName);
}
}
}
if (localStorage.getItem(this.selectedNameKey) && localStorage.getItem(this.selectedNameKey) !== String(null)) {
commit('setSelectedName', localStorage.getItem(this.selectedNameKey));
} else {
localStorage.setItem(this.selectedNameKey, state.selectedName);
}
localStorage.setItem(this.userDomainNamesKey, JSON.stringify(userDomainNames));
dispatch("fetchSelectedNameData");
},
// fetch selectedName data (image etc.)
async fetchSelectedNameData({commit, state, rootState, rootGetters}) {
if (state.selectedName) {
const nameArr = state.selectedName.split(".");
const name = nameArr[0];
const domain = "." + nameArr[1];
if (name && rootState.degen.tldAddresses[domain]) {
const intfc = new ethers.utils.Interface(rootGetters["degen/getTldAbi"]);
const contract = new ethers.Contract(rootState.degen.tldAddresses[domain], intfc, signer.value);
const nameData = await contract.domains(name);
commit("setSelectedNameData", nameData);
// get contract image for that token ID
let metadata = await contract.tokenURI(nameData.tokenId);
let imgFound = false;
if (nameData.data) {
const customData = JSON.parse(nameData.data);
if (customData.imgAddress && !customData.imgAddress.startsWith("0x")) {
commit("setSelectedNameImageSvg", customData.imgAddress.replace("ipfs://", "https://ipfs.io/ipfs/"));
imgFound = true;
} else if (customData.imgAddress) {
// fetch image URL of that PFP
const pfpInterface = new ethers.utils.Interface([
"function tokenURI(uint256 tokenId) public view returns (string memory)"
]);
let pfpChainId = chainId.value;
if (customData.imgChainId) {
pfpChainId = customData.imgChainId;
}
try {
const fProvider = getFallbackProvider(Number(pfpChainId));
const pfpContract = new ethers.Contract(customData.imgAddress, pfpInterface, fProvider);
metadata = await pfpContract.tokenURI(customData.imgTokenId);
} catch {}
}
if (metadata.includes("ipfs://")) {
metadata = metadata.replace("ipfs://", "https://ipfs.io/ipfs/");
}
if (metadata.includes("http")) {
const response = await fetch(metadata);
const result = await response.json();
if (result && result.image) {
commit("setSelectedNameImageSvg", result.image.replace("ipfs://", "https://ipfs.io/ipfs/"));
imgFound = true;
} else {
commit("setSelectedNameImageSvg", null);
}
}
}
if (metadata && !imgFound) {
const json = atob(metadata.substring(29));
const result = JSON.parse(json);
if (result && result.image) {
commit("setSelectedNameImageSvg", result.image);
} else {
commit("setSelectedNameImageSvg", null);
}
}
}
}
},
async removeDomainFromUserDomains({commit, state}, domainName) {
if (chainId.value) {
this.userDomainNamesKey = "userDomainNames" + String(chainId.value) + String(shortenAddress(address.value));
this.selectedNameKey = "selectedName" + String(chainId.value) + String(shortenAddress(address.value));
if (localStorage.getItem(this.userDomainNamesKey)) {
const userDomainNames = JSON.parse(localStorage.getItem(this.userDomainNamesKey));
state.userAllDomainNames = [];
let newDomainNamesArray = [];
for (let udName of userDomainNames) {
if (udName != domainName) {
newDomainNamesArray.push(udName);
state.userAllDomainNames.push(udName);
}
}
localStorage.setItem(this.userDomainNamesKey, JSON.stringify(newDomainNamesArray));
// if the removed domain name is currently marked as selected name, replace it with another or null
if (localStorage.getItem(this.selectedNameKey) && localStorage.getItem(this.selectedNameKey)==domainName) {
if (newDomainNamesArray.length > 0) {
commit('setSelectedName', newDomainNamesArray[0]);
}
commit('setSelectedName', null);
}
}
}
}
}
};

@ -0,0 +1,87 @@
<template>
<div class="container">
<h1 class="text-center">What are Degen Domains?</h1>
<div class="row mt-3">
<div class="col-md-8 offset-md-2">
<p>
Degen Domains are NFT <strong>domain names</strong> and the base for permissionless Web3 identities.
</p>
<h3>What problem does Degen Domains Solve?</h3>
<p>
Crypto addresses are long and imposible to remember. Our solution allows both degens and crypto communities
to have short and easy to remember domain names owned by your wallet as an NFT.
</p>
<p>
Sending tokens is now as easy as just entering a domain name, like <code>degen.doge</code>, instead of the whole <code>0xc3674D</code> address.
</p>
<p>
For Crypto communities, DAOs and Influencers a short easy to remember <code>.project</code> domain is more brandable and a new revenue stream for projects.
For example, a DeFi protocol like Alpaca Finance could create a Degen Domain NFT named <code>.alpaca</code>, and the revenue from each purchase would go to
Alpaca Development Fund.
</p>
<p>
Web3 games, decentralized social networks and other dApps could display the wallet's domain name as the <strong>username</strong>.
Instead of your username being <code>0xc3674D</code>, it could be <code>truedegen.doge</code>.
</p>
<h3>What makes Degen Domains different from ENS and other projects like it?</h3>
<p>
Degen Domains has more top-level domains (TLDs), like <code>.doge</code>, <code>.drip</code>,
<code>.crew</code> and others. Degen Domains is can be made available on any EVM network supporting Solidity Smart Contracts.
Degen Domain Service provides additional ongoing income for projects and influencers. The Degen Domain protocol features a referral system writen into our smart contracts.
</p>
<h3>An NFT domain name with utility</h3>
<p>
Degen Domains is more than a vanity it provides the base for your <strong>full decentralization</strong> Web3 digital identity owned by You! Attach your metadata to level up your
pseudonymous <strong>identity</strong>. Degen Domains will be used in the protocol's upcoming <strong>decentralization instant messaging social platform</strong>
</p>
<em>
(See our Road Map, <router-link to="/roadmap">click here</router-link>.)
</em>
<hr>
<p>
Degen Domains has partnered with following DAOs and Communities:
<ul>
<li>Crypto Crew: <a href="#" target="_blank">.crew domain</a></li>
<li>Your Project: <a href="#" target="_blank">.project domain</a></li>
</ul>
</p>
</div>
</div>
</div>
</template>
<script lang="ts">
export default {
name: "About"
}
</script>
<style scoped>
p {
text-align: justify;
font-size: 1.1em;
}
h3 {
margin-top: 35px;
}
</style>

@ -0,0 +1,86 @@
<template>
<div class="row">
<div class="col-md-3" id="sidebar-container">
<Sidebar />
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12 mb-3">
<div class="container text-center">
<h3>Browser Extension/Plugin</h3>
<p class="text-wrap p-4">
Degen Domains browser extension allows you to enter a Degen domain name in the URL bar and the
extension will redirect you to the URL that is set for that domain. If no URL is set, the extension
will redirect you to the domain page on the Degen Domains website.
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<div class="container text-center">
<h3>Chrome/Brave/Edge/Opera</h3>
<p>
<small><em>
<a target="_blank" href="https://chrome.google.com/webstore/#">
Download
</a>
</em></small>
</p>
<a target="_blank" href="https://chrome.google.com/webstore/#">
<img class="img-fluid browser-img mb-3" src="../assets/chrome-logo.png" />
</a>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="container text-center">
<h3>Firefox</h3>
<p>
<small><em>
<a target="_blank" href="https://addons.mozilla.org/#">
Download
</a>
</em></small>
</p>
<a target="_blank" href="https://addons.mozilla.org/#">
<img class="img-fluid browser-img mb-3" src="../assets/firefox-logo.png" />
</a>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import Sidebar from '../components/Sidebar.vue';
export default {
name: "BrowserExtension",
components: {
Sidebar
}
}
</script>
<style scoped>
.browser-img {
max-height: 200px;
}
</style>

@ -0,0 +1,113 @@
<template>
<div class="container">
<h1 class="text-center">Degen Domains ($DNS) & Degen DAO</h1>
<div class="row mt-3">
<div class="col-md-8 offset-md-2">
<p class="text-center">
Tokenomics & Governace
</p>
<p class="text-center">
<img class="img-fluid" src="../assets/architecture.png" />
</p>
<h3>Degen Domains ($DNS)</h3>
<p>
The Degen Domain Service token <code>$DNS</code> is the Governace token for the Degen Dao where protocol revenue is managed by
the Degen community. The DNS token will have additional use cases as our ecosystem grows. $DNS contract is owned by the governor contract.
The Governor contract is owned by the DAOs Gnosis Safe
</p>
<p>
DNS Max Supply: 100,000,000
<ul>
<strong>8% Buy/Sell Tax:</strong>
<li>2% Burn (Tokens removed from circulation).</li>
<li>2% Dev/Marketing (To ensure project longevity).</li>
<li>2% Liquidity (Injected directly into LP to inflate K-Score / ensure higher floors & less dumps)</li>
<li>2% Reflection (Rewards loyal holders on every Buy / Sell).</li>
</ul>
</p>
<p>
DNS Token Distribution:
<ul>
<li>XX% Development Team (Locked in Vesting Contracts 24 Months).</li>
<li>XX% Pre-Sale (Discounted Tokens locked in Vesting Contracts 3 Months).</li>
<li>XX% Public Sale (Public Whitelist Sale)</li>
<li>XX% DAO (Tokens dedicated to Rewards Programs).</li>
<li>XX% Reserve (Reserve for additional Pools and Exchanges).</li>
</ul>
</p>
<p>
Community Ownership:
<ul>
<li>$DNS contract is owned by the governor contract.</li>
<li>The Governor contract is owned by the DAOs Gnosis Safe.</li>
<li>Gnosis Safe Multisig signers include community members and early participants.</li>
<li>At 1,000 $DNS holders the DAO upgrades to full on-chain governance.</li>
</ul>
</p>
<p>
Gnosis multi-sig makes sense for a newer DAO with a smaller treasury. As the DAO membership expands,
the DAO will upgrade the Gnosis Safe to an on-chain Governor without having to moving all assets and permissions between contracts.
</p>
<h3>Degen DAO Governace</h3>
<p>
Governace for the Degen DAO is made up of the DNS Token, Governor Contract, and Gnosis Safe. The Gnosis Safe holds
protocol revenue from minting domains and royalites and any other future income. The Governor Contract is responsible for managing DAO proposals.
It keeps track of the status of proposals, and it counts the votes to see if they pass.
</p>
<p>
To prevent spamming, only users whose voting power exceeds XXXX $DNS can create a proposal and anyone holding XXX $DNS can vote on proposals.
</p>
<h3>Governance Process</h3>
<p>
Voting takes place over a 3 day voting period. When the voting period ends, the system first checks if the number of yes votes exceed the protocol's quorum threshold.
If the proposer's voting power drops below the proposal submission threshold at any time from submission until the voting or time-lock period ends, the proposal can be cancelled.
Finally, once the entire process has finished, the proposal can be executed on the Gnosis Safe.
</p>
<h3>Resources</h3>
<p>
<ul>
<li><a target="_blank" href="http://docs.degendomains.io">Docs</a></li>
<li><a target="_blank" href="https://tally.xyz/">Tally</a></li>
<li><a target="_blank" href="https://docs.openzeppelin.com/contracts/4.x/governance">OpenZeppelin Governance</a></li>
</ul>
</p>
</div>
</div>
</div>
</template>
<script lang="ts">
export default {
name: "DegenDao"
}
</script>
<style scoped>
p {
text-align: justify;
font-size: 1.1em;
}
h3 {
margin-top: 35px;
}
</style>

@ -0,0 +1,258 @@
<template>
<div class="row">
<div class="col-md-3" id="sidebar-container">
<Sidebar />
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12">
<div class="container text-center">
<h3>{{domainName}}.{{tld}}</h3>
<img class="img-thumbnail domain-image" :src="pfpImage" />
<div class="mb-3 text-center mt-4" v-if="loadingData">
<span class="spinner-border spinner-border-lg" role="status" aria-hidden="true"></span>
</div>
<div class="mb-3 row domain-data mt-4" v-if="domainData">
<div class="col-sm-3 degen-title">
Holder address
</div>
<div class="col-sm-9 degen-text text-break">
{{holderData}}
</div>
</div>
<div class="mb-3 row domain-data mt-4">
<div class="col-sm-3 degen-title">
Network
</div>
<div class="col-sm-9 degen-text text-break">
{{getChainName(Number(domainChain))}} (this is where domain is registered)
</div>
</div>
<!--
<EditUrl
:domainData="domainData"
:tld="tld"
:domainName="domainName"
@fetchData="fetchData"
/>
<EditPfp
:domainData="domainData"
:tld="tld"
:domainName="domainName"
@fetchData="fetchData"
/>
-->
<EditOtherData
:domainData="domainData"
:tld="tld"
:domainName="domainName"
:isCorrectChainForDomain="isCorrectChainForDomain"
@fetchData="fetchData"
/>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { mapGetters } from 'vuex';
import { useEthers } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import tldsJson from '../abi/tlds.json';
import tldAbi from '../abi/DegenTLD.json';
import EditOtherData from "../components/domainEdit/EditOtherData.vue";
import EditPfp from "../components/domainEdit/EditPfp.vue";
import EditUrl from "../components/domainEdit/EditUrl.vue";
import Sidebar from '../components/Sidebar.vue';
import WaitingToast from "../components/toasts/WaitingToast.vue";
import useChainHelpers from "../hooks/useChainHelpers";
export default {
name: "DomainDetails",
props: ["domainChain", "tld", "domainName"],
components: {
EditOtherData,
EditPfp,
EditUrl,
Sidebar
},
data() {
return {
loadingData: false,
tldContract: null,
domainData: null,
pfpImage: "https://upload.wikimedia.org/wikipedia/commons/b/bc/Unknown_person.jpg",
}
},
created() {
// fetch existing data from blockchain
if (!this.tldContract && this.isCorrectChainForDomain) {
this.setContract();
}
this.fetchData();
},
computed: {
...mapGetters("degen", ["getTldAddresses", "getTldAbi"]),
...mapGetters("network", ["getBlockExplorerBaseUrl", "getChainId", "getFallbackProvider", "getSupportedNetworks", "isNetworkSupported"]),
holderData() {
if (this.domainData.holder !== ethers.constants.AddressZero) {
return this.domainData.holder;
}
return "This domain name is not owned by anyone yet."
},
isCorrectChainForDomain() {
if (Number(this.domainChain) === Number(this.getChainId)) {
return true;
}
return false;
}
},
methods: {
async fetchData() {
this.loadingData = true;
// get fallback provider based on network ID
const fProvider = this.getFallbackProvider(Number(this.domainChain));
// create TLD contract
const intfc = new ethers.utils.Interface(tldAbi);
const tldContractRead = new ethers.Contract(tldsJson[this.domainChain]["."+this.tld], intfc, fProvider);
if (tldContractRead) {
// get domain data
this.domainData = await tldContractRead.domains(this.domainName);
if (this.domainData && this.domainData.holder !== ethers.constants.AddressZero) {
let metadata = await tldContractRead.tokenURI(this.domainData.tokenId);
let noImg = true;
if (this.domainData.data) {
const customData = JSON.parse(this.domainData.data);
if (customData.imgAddress) {
if (!customData.imgAddress.startsWith("0x")) {
this.pfpImage = customData.imgAddress.replace("ipfs://", "https://ipfs.io/ipfs/");
noImg = false;
} else if (customData.imgAddress) {
// fetch image URL of that PFP
const pfpInterface = new ethers.utils.Interface([
"function tokenURI(uint256 tokenId) public view returns (string memory)"
]);
let pfpChainId = this.domainChain;
if (customData.imgChainId) {
pfpChainId = customData.imgChainId;
}
try {
const pfpProvider = this.getFallbackProvider(Number(pfpChainId));
const pfpContract = new ethers.Contract(customData.imgAddress, pfpInterface, pfpProvider);
metadata = await pfpContract.tokenURI(customData.imgTokenId);
} catch {}
} else {
// get contract image for that token ID
metadata = await tldContractRead.tokenURI(customData.imgTokenId);
}
}
if (metadata.includes("ipfs://")) {
metadata = metadata.replace("ipfs://", "https://ipfs.io/ipfs/");
}
if (metadata.includes("http")) {
const response = await fetch(metadata);
const result = await response.json();
if (result && result.image) {
this.pfpImage = result.image.replace("ipfs://", "https://ipfs.io/ipfs/");
noImg = false;
}
}
}
if (metadata && noImg) {
const json = atob(metadata.substring(29));
const result = JSON.parse(json);
if (result && result.image) {
this.pfpImage = result.image;
}
}
}
}
this.loadingData = false;
},
setContract() {
let tldAddresses = this.getTldAddresses;
if (tldAddresses && JSON.stringify(tldAddresses) != "{}") {
const tldAddr = tldAddresses["."+this.tld];
// construct contract
const intfc = new ethers.utils.Interface(this.getTldAbi);
this.tldContract = new ethers.Contract(tldAddr, intfc, this.signer);
}
}
},
setup() {
const { isActivated, signer } = useEthers();
const toast = useToast();
const { getChainName } = useChainHelpers();
return { getChainName, isActivated, signer, toast }
},
}
</script>
<style scoped>
.domain-image {
max-width: 200px;
}
.degen-text {
text-align: left;
}
@media only screen and (max-width: 767px) {
.degen-text {
text-align: center;
}
.degen-title {
font-size: 1.1em;
margin-bottom: 5px;
font-weight: bold;
}
}
</style>

@ -0,0 +1,35 @@
<template>
<div class="text-center">
<div class="text-primary-600 text-9xl font-bold my-5">404</div>
<div class="text-2xl text-gray-500 my-5">Oops. Page not found...</div>
<!--
<p class="punchline">
Domains for DAOs
</p>
-->
<p class="logo">
degendomains.io
</p>
<div class="flex flex-row justify-center space-x-4">
<button @click="this.$router.go(-1)" class="btn btn-primary my-5 mx-2">Back</button>
<button @click="this.$router.push({name: 'Home'})" class="btn btn-primary my-5">Home</button>
</div>
</div>
</template>
<style scoped>
.punchline {
font-size: 4em;
margin-top: 150px;
margin-bottom: 50px;
}
.logo {
font-family: 'Panda-font', cursive;
font-size: 2em;
/*margin-bottom: 150px;*/
}
</style>

@ -0,0 +1,301 @@
<template>
<div class="container text-center">
<h1 class="mt-5">Web3 Domains & Digital Identity</h1>
<div v-if="isActivated" class="dropdown mt-5">
Choose network:
<button class="mx-3 btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
{{getNetworkName}}
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li>
<span
class="dropdown-item"
v-for="network in getSupportedNetworkNames"
@click="changeNetwork(network)"
>{{network}}</span>
</li>
</ul>
</div>
<div v-if="!isActivated" class="mt-5">
<button class="btn btn-primary" @click="open">Connect wallet</button>
</div>
<div class="d-flex justify-content-center domain-input-container">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="chosenDomainName"
placeholder="enter domain name"
type="text"
class="form-control text-end"
aria-label="Text input with dropdown button"
>
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<span v-if="isActivated && !selectedTld" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
{{selectedTld}}
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><span class="dropdown-item" v-for="tld in enabledBuyingTlds" @click="changeTld(tld)">{{tld}}</span></li>
</ul>
</div>
</div>
<p class="error" v-if="buyNotValid(chosenDomainName).invalid">
<small>
<em>{{ buyNotValid(chosenDomainName).message }}</em>
</small>
</p>
<p class="mt-3">
Domain price: {{this.parseValue(this.selectedPrice)}} {{getNetworkCurrency}}
</p>
<button class="btn btn-primary btn-lg mt-1 buy-button" @click="buyDomain" :disabled="waiting || buyNotValid(chosenDomainName).invalid">
<span v-if="waiting" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Buy domain
</button>
</div>
</template>
<script lang="ts">
import { ethers } from 'ethers';
import { displayEther, useBoard, useEthers } from 'vue-dapp';
import { mapActions, mapGetters, mapMutations } from 'vuex';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../components/toasts/WaitingToast.vue";
import useDomainHelpers from "../hooks/useDomainHelpers";
import useChainHelpers from "../hooks/useChainHelpers";
export default {
name: "Home",
data() {
return {
chosenDomainName: null,
enabledBuyingTlds: [],
selectedTld: null,
selectedPrice: null,
waiting: false, // waiting for TX to complete
}
},
created() {
if (this.getDomainPrices) {
this.checkEnabledBuying();
}
},
computed: {
...mapGetters("network", ["getBlockExplorerBaseUrl", "getNetworkName", "getNetworkCurrency", "getSupportedNetworks", "getSupportedNetworkNames"]),
...mapGetters("degen", ["getTlds", "getTldAddresses", "getDomainPrices", "getTldAbi"]),
domainLowerCase() {
return this.chosenDomainName.toLowerCase();
}
},
methods: {
...mapActions("user", ["fetchUserDomainNames"]),
...mapMutations("user", ["addDomainManually"]),
async buyDomain() {
this.waiting = true;
const fullDomainName = this.domainLowerCase + this.selectedTld;
// create TLD contract object
const intfc = new ethers.utils.Interface(this.getTldAbi);
const contract = new ethers.Contract(this.getTldAddresses[this.selectedTld], intfc, this.signer);
// check if price is missing
if (!this.selectedPrice) {
this.selectedPrice = await contract.price();
}
// check if domain is already taken
const existingHolder = await contract.getDomainHolder(this.domainLowerCase);
if (existingHolder !== ethers.constants.AddressZero) {
this.toast("Sorry, but this domain name is already taken...", {type: TYPE.ERROR});
this.waiting = false;
return;
}
// buy/mint domain
try {
let referral = localStorage.getItem("referral");
if (!referral || !ethers.utils.isAddress(referral)) {
referral = ethers.constants.AddressZero;
}
const tx = await contract.mint(
this.domainLowerCase,
this.address,
referral,
{
value: String(this.selectedPrice)
}
);
if (tx) {
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully bought the domain!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.fetchUserDomainNames();
this.addDomainManually(fullDomainName);
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waiting = false;
},
changeNetwork(networkName) {
const networkData = this.switchNetwork(networkName);
window.ethereum.request({
method: networkData.method,
params: networkData.params
});
},
changeTld(tldName) {
this.selectedTld = tldName;
this.selectedPrice = this.getDomainPrices[tldName];
},
async checkEnabledBuying() {
const oldSelectedTld = this.selectedTld;
this.enabledBuyingTlds = [];
let counter = 0;
if (this.getTlds) {
for (let tld of this.getTlds) {
// construct contract
const intfc = new ethers.utils.Interface(this.getTldAbi);
const tldContract = new ethers.Contract(this.getTldAddresses[tld], intfc, this.signer);
const canBuy = await tldContract.buyingEnabled();
if (canBuy) {
this.enabledBuyingTlds.push(tld);
if (counter === 0) {
this.selectedTld = tld;
counter++;
} else if (tld === oldSelectedTld) {
this.selectedTld = oldSelectedTld;
}
}
}
}
if (this.enabledBuyingTlds && !this.selectedTld) {
this.selectedTld = this.enabledBuyingTlds[0];
}
this.selectedPrice = this.getDomainPrices[this.selectedTld];
},
parseValue(someVal) {
if (someVal) {
return ethers.utils.formatEther(someVal);
}
}
},
setup() {
const { open } = useBoard()
const { address, chainId, isActivated, signer } = useEthers()
const toast = useToast();
const { buyNotValid } = useDomainHelpers();
const { switchNetwork } = useChainHelpers();
return { address, buyNotValid, chainId, isActivated, displayEther, open, signer, switchNetwork, toast }
},
watch: {
chainId(newVal, oldVal) {
if (newVal != oldVal) {
this.selectedTld = null;
}
},
getTlds(newVal, oldVal) {
if (newVal && this.getDomainPrices) {
this.checkEnabledBuying();
}
},
getDomainPrices(newVal, oldVal) {
if (newVal) {
this.checkEnabledBuying();
}
}
}
}
</script>
<style scoped>
.buy-button {
margin-bottom: 50px;
}
.domain-input {
width: 50%;
}
.domain-input-container {
margin-top: 80px;
}
.dropdown-item {
cursor: pointer;
}
@media only screen and (max-width: 767px) {
.domain-input {
width: 100%;
}
}
</style>

@ -0,0 +1,101 @@
<template>
<div class="container">
<h1 class="text-center">Degen Domain Smart Contracts</h1>
<div class="row mt-3">
<div class="col-md-8 offset-md-2">
<p class="text-center">
An Overview of <strong>TLD Factories</strong>, <strong>TLD Contracts</strong> and <strong>Domains</strong>.
</p>
<p class="text-center">
<img class="img-fluid" src="../assets/architecture.png" />
</p>
<h3>TLD Factories</h3>
<p>
The Degen Domain protocol starts with TLD Factory contracts. Each TLD Factory contract defines the logic for creating
new TLD contracts. This logic includes the price and any royalty for each domain.
</p>
<p>
To prevent two factories from creating the same TLD, the <code>DegenForbiddenTlds</code> contract holds a list of already
used or restricted TLD names (<code>.eth</code> is an example of a forbidden TLD name, because it's used in ENS).
</p>
<h3>DegenTLD contracts</h3>
<p>
Degen TLD contracts are minted from the TLD Factory contract for price defined by the TLD Factory logic. The
price logic should be high enough to discourge domain spamming and squatting. But not so high the general public will reject it.
</p>
<p>New TLD mints can be temporarily restricted to the factory owner only. The TLD owner can set domain prices and can stop domain sales
anytime they wish.
</p>
<p>
The factory owner can set a royalty for each domain purchase, but the royalty can never exceed 50% of the
domain price (in reallity it around 1% to 10% and some cases 0%).
</p>
<h3>Domains</h3>
<p>
<ul>
<li>Example of a TLD: <code>.doge</code></li>
<li>Example of a domain: <code>ilove.doge</code></li>
</ul>
</p>
<p>A domain can only be held by one address, but one address can hold many domains.</p>
<p>
A domain can hold many pieces of data:
<ul>
<li>The holder's address (by default).</li>
<li>Profile picture (an NFT that the user owns).</li>
<li>
URL (like user's homepage or similar; this comes handy together with the Degen Domains browser
plugin).
</li>
<li>Custom data such as a Twitter handle, description, etc.</li>
</ul>
</p>
<p>
Each domain is an ERC-721 NFT and can be sold on NFT marketplaces.
</p>
<h3>Resources</h3>
<p>
<ul>
<li><a target="_blank" href="http://docs.degendomains.io">Docs</a></li>
<li><a target="_blank" href="https://github.com/degen-domains">GitHub</a></li>
<li><a target="_blank" href="https://discord.gg/#">Discord</a></li>
<li><a target="_blank" href="https://twitter.com/DegenTLD">Twitter</a></li>
</ul>
</p>
</div>
</div>
</div>
</template>
<script lang="ts">
export default {
name: "HowItWorks"
}
</script>
<style scoped>
p {
text-align: justify;
font-size: 1.1em;
}
h3 {
margin-top: 35px;
}
</style>

@ -0,0 +1,219 @@
<template>
<div class="row">
<div class="col-md-3" id="sidebar-container">
<Sidebar />
</div>
<div class="col-md-9">
<!-- Show this if user is not connected -->
<div class="row" v-if="!isActivated">
<div class="col-md-12 mb-3">
<div class="container text-center">
<h3><i class="bi bi-exclamation-triangle"></i> Not connected <i class="bi bi-exclamation-triangle"></i></h3>
<p class="text-break">
Please connect with your wallet to see your profile data.
</p>
</div>
</div>
</div>
<!-- Address and balance -->
<div class="row" v-if="isActivated">
<div class="col-md-6 mb-3">
<div class="container text-center">
<h3>Address</h3>
<p class="text-break">{{getUserAddress}}</p>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="container text-center">
<h3>Balance</h3>
<p class="text-break">{{ getUserBalance }} {{getNetworkCurrency}}</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="container">
<h3>Domains</h3>
<div class="table-responsive">
<table class="table table-hover mt-4 mb-4">
<tbody>
<tr v-for="domainName in getUserAllDomainNames">
<MyDomain :domain="domainName" />
</tr>
</tbody>
</table>
</div>
<p v-if="getUserSelectedNameData">
<small><em>
Don't see your domain here?
<span class="span-link" data-bs-toggle="modal" data-bs-target="#addDomainModal">
Add it manually</span>.
</em></small>
</p>
<p v-else>
No domain? No worries, <router-link to="/">buy yourself one here!</router-link>
</p>
</div>
</div>
</div>
<Referral />
</div>
</div>
<!-- Add Domain Modal -->
<div class="modal fade" id="addDomainModal" tabindex="-1" aria-labelledby="addDomainModalLabel" aria-hidden="true" modal-dialog-centered>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addDomainModalLabel">Add your existing domain</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="recipient-name" class="col-form-label">Enter your existing domain:</label>
<input type="text" class="form-control" id="recipient-name" v-model="existingDomain">
<small><em>No transaction will be made, this is a free query.</em></small>
</div>
</div>
<div class="modal-footer">
<button
type="button"
@click="addExistingDomain"
class="btn btn-secondary"
:disabled="domainNotValid">Add domain</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import { mapGetters, mapMutations } from 'vuex';
import { ethers } from 'ethers';
import { useEthers } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import MyDomain from '../components/MyDomain.vue';
import Sidebar from '../components/Sidebar.vue';
import Referral from '../components/Referral.vue';
export default {
name: "Profile",
data() {
return {
existingDomain: null
}
},
components: {
MyDomain,
Referral,
Sidebar
},
computed: {
...mapGetters("user", ["getUserAddress", "getUserBalance", "getUserAllDomainNames", "getUserSelectedNameData"]),
...mapGetters("network", ["getNetworkCurrency"]),
...mapGetters("degen", ["getTlds", "getTldAddresses", "getTldAbi"]),
customData() {
if (this.getUserSelectedNameData) {
try {
return JSON.parse(this.getUserSelectedNameData.data);
} catch {
return null
}
}
return null
},
domainNotValid() {
if (this.existingDomain === "") {
return true;
} else if (this.existingDomain === null) {
return true;
} else if (this.existingDomain.split(".").length != 2) { // only 1 zero allowed (meaning there are two words after split)
return true;
} else if (this.existingDomain.includes(" ")) {
return true;
} else if (this.existingDomain.includes("%")) {
return true;
} else if (this.existingDomain.includes("&")) {
return true;
} else if (this.existingDomain.includes("?")) {
return true;
} else if (this.existingDomain.includes("#")) {
return true;
}
}
},
methods: {
...mapMutations("user", ["addDomainManually"]),
async addExistingDomain() {
const existingDomainLower = this.existingDomain.toLowerCase();
const existingDomainParts = existingDomainLower.split(".");
// get TLD address and create contract
const tldAddress = await this.getTldAddresses["."+existingDomainParts[1]];
if (tldAddress !== ethers.constants.AddressZero) {
const intfc = new ethers.utils.Interface(this.getTldAbi);
const contract = new ethers.Contract(tldAddress, intfc, this.signer);
const checkDomainHolder = await contract.getDomainHolder(existingDomainParts[0]);
if (String(checkDomainHolder)===String(this.address)) {
this.addDomainManually(existingDomainLower);
this.toast("Domain successfully added.", {type: TYPE.SUCCESS});
} else {
this.toast("This domain is not owned by your currently connected address.", {type: TYPE.ERROR});
}
} else {
this.toast("This TLD does not exist.", {type: TYPE.ERROR});
}
}
},
setup() {
const { address, isActivated, signer } = useEthers();
const toast = useToast();
return { address, isActivated, signer, toast }
},
}
</script>
<style scoped>
.clipboard {
cursor: pointer
}
.table {
--bs-table-bg: transparent;
color: #DBDFEA;
}
.table:hover {
--bs-table-bg: transparent;
/*--bs-table-hover-bg: #1D1E2C;*/
--bs-table-hover-bg: transparent;
--bs-table-hover-color: none;
}
</style>

@ -0,0 +1,165 @@
<template>
<div class="row">
<div class="col-md-3" id="sidebar-container">
<Sidebar />
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12 mb-3">
<div class="container text-center">
<h3>Find an existing domain</h3>
<div class="row mt-5">
<div class="col-md-6 offset-md-3">
<input
v-model="query"
class="form-control text-center"
placeholder="Enter a domain name"
v-on:keyup.enter="findDomain"
>
</div>
</div>
<button
class="btn btn-primary mt-3 mb-5"
@click="findDomain"
:disabled="waiting || notValid"
>
<span v-if="waiting" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Search
</button>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="js">
import { ethers } from 'ethers';
import { mapGetters } from 'vuex';
import { useToast, TYPE } from "vue-toastification";
import resolverJson from '../abi/resolver.json';
import tldsJson from '../abi/tlds.json';
import Sidebar from '../components/Sidebar.vue';
export default {
name: "SearchDomains",
components: {
Sidebar
},
data() {
return {
query: null,
waiting: false
}
},
computed: {
...mapGetters("network", ["getFallbackProvider"]),
domainLowerCase() {
return this.query.toLowerCase();
},
notValid() {
if (!this.query) {
return true;
} else if (!this.query.includes(".")) {
return true;
} else if (this.query.includes(" ")) {
return true;
} else if (this.query.includes("%")) {
return true;
} else if (this.query.includes("&")) {
return true;
} else if (this.query.includes("?")) {
return true;
} else if (this.query.includes("#")) {
return true;
} else if (this.query.includes("/")) {
return true;
}
return false;
},
},
methods: {
async findDomain() {
this.waiting = true;
// check if domain name/address is valid
if (this.domainLowerCase && this.domainLowerCase.split(".").length === 2) { // likely a domain name
// split into two (domain name and TLD)
const domArr = this.domainLowerCase.split(".");
for (let netId in tldsJson) { // iterate through different chains
if (tldsJson[netId]["."+domArr[1]]) { // find the correct TLD
// get fallback provider based on network ID
const fProvider = this.getFallbackProvider(Number(netId));
// resolver contract
const resolverInterface = new ethers.utils.Interface([
"function getDomainHolder(string calldata _domainName, string calldata _tld) public view returns(address)"
]);
const resolverRead = new ethers.Contract(
resolverJson[netId],
resolverInterface,
fProvider
);
// fetch domain holder
const domainHolder = await resolverRead.getDomainHolder(domArr[0], "."+domArr[1]);
if (domainHolder !== ethers.constants.AddressZero) {
// if domain exists, redirect to the Domain Details page
this.$router.push({name: 'DomainDetails', params: {domainChain: netId, tld: domArr[1], domainName: domArr[0]}});
return;
} else {
// if not exists (holder is 0x0) or TLD deprecated, show a toast
let notExist = "This domain name has not been registered yet.";
if (domArr[1].toLowerCase() === "web3" || domArr[1].toLowerCase() === "polygon") {
notExist = "TLD ." + domArr[1].toLowerCase() + " has been deprecated.";
}
this.toast(notExist, {type: TYPE.INFO});
this.waiting = false;
return;
}
break;
}
}
this.toast("Top-level domain ." + domArr[1] + " does not exist (if this is a mistake, contact us on Discord).", {type: TYPE.ERROR});
this.waiting = false;
return;
} else {
this.toast("This is not a valid domain.", {type: TYPE.ERROR});
this.waiting = false;
return;
}
}
},
setup() {
const toast = useToast();
return { toast }
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,512 @@
<template>
<div class="row">
<div class="col-md-3" id="sidebar-container">
<Sidebar />
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12 mb-3">
<div class="container text-center">
<h3>Send tokens to a domain</h3>
<!-- Recipient -->
<div class="row mt-5">
<div class="col-md-6 offset-md-3">
<input
v-model="receiver"
class="form-control text-center"
placeholder="Enter the receiver's domain name"
>
</div>
</div>
<!-- Tokens -->
<div class="row mt-4">
<div class="col-md-4 offset-md-4">
<div class="input-group">
<input
type="text"
class="form-control text-end"
v-model="tokenAmount"
placeholder="0.0"
/>
<button
class="btn btn-primary dropdown-toggle"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
{{selectedToken}}
</button>
<div class="dropdown-menu p-2">
<div class="mb-3">
<input
class="form-control mb-2"
placeholder="Filter tokens"
v-model="filterTokens"
/>
<li>
<button
class="dropdown-item"
type="button"
v-for="token in getTokenNames"
@click="selectToken(token)"
>{{token}}</button>
</li>
</div>
</div>
</div>
<small>
Balance:
<span id="balance" @click="tokenAmount=tokenBalance">{{formatTokenBalance}} {{selectedToken}}</span>
</small>
</div>
</div>
<button
class="btn btn-primary mt-4 mb-5"
:disabled="notValid || waiting"
@click="validateDomainName"
data-bs-toggle="modal" data-bs-target="#sendTokensModal"
>
<span v-if="waiting" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Send tokens
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Send tokens modal -->
<div class="modal fade text-start" id="sendTokensModal" tabindex="-1" aria-labelledby="sendTokensModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="sendTokensModalLabel">Confirm sending {{selectedToken}}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
Please review the data before you send {{selectedToken}} to {{domainLowerCase}}.
</p>
<div class="row mb-3 mt-4">
<div class="col-sm-3">
<strong>Recipient</strong>
</div>
<div class="col-sm-9">
<span>{{domainLowerCase}}</span>
<span class="domain-error" v-if="domainError">Error: {{domainError}}</span>
</div>
</div>
<div class="row mb-3 mt-2" v-if="receiverAddress">
<div class="col-sm-3">
<strong>Recipient address</strong>
</div>
<div class="col-sm-9">
<span class="text-break">{{receiverAddress}}</span>
<span class="domain-error" v-if="receiverAddress == address">Error: You are sending tokens to yourself.</span>
</div>
</div>
<div class="row mb-3 mt-2">
<div class="col-sm-3">
<strong>Amount</strong>
</div>
<div class="col-sm-9">
<span class="text-break">{{tokenAmount}} {{selectedToken}}</span>
</div>
</div>
<div class="row mb-3 mt-2" v-if="getTokens[selectedToken] !== '0x0'">
<div class="col-sm-3">
<strong>Token address</strong>
</div>
<div class="col-sm-9">
<span class="text-break">{{getTokens[selectedToken]}}</span>
</div>
</div>
<div class="row mb-3 mt-2">
<div class="col-sm-3">
<strong>Network</strong>
</div>
<div class="col-sm-9">
<span class="text-break">{{getNetworkName}}</span>
</div>
</div>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
@click="send"
:disabled="waiting || domainError || validating"
>
<span v-if="validating">Validating...</span>
<span v-if="validating" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span v-if="!validating">Send {{selectedToken}}</span>
</button>
<button id="closeSendModal" type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import { ethers } from 'ethers';
import { mapGetters } from 'vuex';
import { useEthers } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import Sidebar from '../components/Sidebar.vue';
import Erc20Abi from "../abi/Erc20.json";
import tldsJson from '../abi/tlds.json';
import tldAbi from '../abi/DegenTLD.json';
import WaitingToast from "../components/toasts/WaitingToast.vue";
export default {
name: "SendTokens",
components: {
Sidebar
},
data() {
return {
domainError: null,
filterTokens: null,
receiver: null,
receiverAddress: null,
tokenBalance: 0, // max token balance of sender
selectedToken: null,
selectedTokenDecimals: null,
tokenAmount: null, // amount to be sent
waiting: false,
validating: false
}
},
created() {
if (this.getChainId >= 1) {
this.selectedToken = Object.keys(this.getTokens)[0];
this.tokenBalance = ethers.utils.formatEther(this.balance);
}
},
computed: {
...mapGetters("network", ["getBlockExplorerBaseUrl", "getChainId", "getFallbackProvider", "getNetworkName", "getTokens"]),
...mapGetters("user", ["getUserBalance"]),
...mapGetters("degen", ["getTldAddresses", "getTldAbi"]),
domainLowerCase() {
if (this.receiver) {
return this.receiver.toLowerCase();
}
return null;
},
formatTokenBalance() {
if (this.tokenBalance > 100) {
return Number(this.tokenBalance).toFixed(2);
} else {
return Number(this.tokenBalance).toFixed(4);
}
},
getTokenNames() {
if (this.getTokens && !this.filterTokens) {
return Object.keys(this.getTokens); // all tokens
} else if (this.getTokens && this.filterTokens) {
return Object.keys(this.getTokens).filter(item => item.includes(this.filterTokens.toUpperCase())); //filtered
}
},
notValid() {
if (!this.receiver) {
return true;
} else if (!this.receiver.includes(".")) {
return true;
} else if (this.receiver.includes(" ")) {
return true;
} else if (this.receiver.includes("%")) {
return true;
} else if (this.receiver.includes("&")) {
return true;
} else if (this.receiver.includes("?")) {
return true;
} else if (this.receiver.includes("#")) {
return true;
} else if (this.receiver.includes("/")) {
return true;
} else if (!this.tokenAmount) {
return true;
} else if (isNaN(this.tokenAmount)) {
return true;
} else if (Number(this.tokenAmount) <= 0) {
return true;
} else if (Number(this.tokenAmount) > Number(this.tokenBalance)) {
return true;
}
return false;
}
},
methods: {
async getTokenBalance(tokenName) {
const tokenAddr = this.getTokens[tokenName];
if (tokenAddr === "0x0") {
this.tokenBalance = ethers.utils.formatEther(this.balance);
} else {
const intfc = new ethers.utils.Interface(Erc20Abi);
const tokenContract = new ethers.Contract(tokenAddr, intfc, this.signer);
const balanceWei = await tokenContract.balanceOf(this.address);
if (Number(balanceWei) > 0) {
const decimals = await tokenContract.decimals();
this.selectedTokenDecimals = Number(decimals);
this.tokenBalance = ethers.utils.formatUnits(balanceWei, this.selectedTokenDecimals);
} else {
this.tokenBalance = 0;
}
}
},
selectToken(tokenName) {
this.selectedToken = tokenName;
this.getTokenBalance(tokenName);
},
send() {
if (this.getTokens[this.selectedToken] === "0x0") {
this.sendNativeTokens();
} else {
this.sendErc20Tokens();
}
},
async sendErc20Tokens() {
this.waiting = true;
try {
const sToken = this.selectedToken;
const tAmount = this.tokenAmount;
const recDomain = this.domainLowerCase;
const valueWei = ethers.utils.parseUnits(tAmount, this.selectedTokenDecimals);
const tokenAddr = this.getTokens[sToken];
const intfc = new ethers.utils.Interface(Erc20Abi);
const tokenContract = new ethers.Contract(tokenAddr, intfc, this.signer);
const tx = await tokenContract.transfer(this.receiverAddress, valueWei);
document.getElementById('closeSendModal').click();
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully sent " + tAmount + " " + sToken + " to " + recDomain + "!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.waiting = false;
this.getTokenBalance(sToken);
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
this.waiting = false;
console.log(e);
this.toast(e.message, {type: TYPE.ERROR});
}
},
async sendNativeTokens() {
this.waiting = true;
try {
const sToken = this.selectedToken;
const tAmount = this.tokenAmount;
const recDomain = this.domainLowerCase;
const valueWei = ethers.utils.parseEther(tAmount);
const tx = await this.signer.sendTransaction({
to: this.receiverAddress,
value: valueWei
});
document.getElementById('closeSendModal').click();
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully sent " + tAmount + " " + sToken + " to " + recDomain + "!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.waiting = false;
this.getTokenBalance(sToken);
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
this.waiting = false;
console.log(e);
this.toast(e.message, {type: TYPE.ERROR});
}
},
async validateDomainName() {
this.validating = true;
this.domainError = null;
this.receiverAddress = null;
const intfc = new ethers.utils.Interface(tldAbi);
try {
if (this.domainLowerCase && this.domainLowerCase.split(".").length === 2) { // likely a domain name
// split into two (domain name and TLD)
const domArr = this.domainLowerCase.split(".");
for (let netId in tldsJson) { // iterate through different chains
if (tldsJson[netId]["."+domArr[1]]) { // find the correct TLD
// get fallback provider based on network ID
const fProvider = this.getFallbackProvider(Number(netId));
// create TLD contract
const tldContractRead = new ethers.Contract(tldsJson[netId]["."+domArr[1]], intfc, fProvider);
// fetch domain holder
const recDomainHolder = await tldContractRead.getDomainHolder(domArr[0]);
if (recDomainHolder !== ethers.constants.AddressZero) {
// if domain exists, set as receiver address
this.receiverAddress = recDomainHolder;
this.validating = false;
return
} else {
this.domainError = "This domain name has not been registered yet.";
this.validating = false;
return
}
break;
}
}
if (!ethers.utils.isAddress(this.recipient)) {
this.domainError = "This TLD does not exist.";
this.validating = false;
return;
}
}
} catch {
this.domainError = "You have entered an incorrect domain.";
this.validating = false;
return;
}
}
},
setup() {
const { address, balance, signer } = useEthers()
const toast = useToast();
return { address, balance, signer, toast }
},
watch: {
getChainId() {
if (this.getChainId >= 1) {
this.selectedToken = Object.keys(this.getTokens)[0];
this.tokenBalance = this.getUserBalance;
}
},
address() {
this.getTokenBalance(this.selectedToken);
}
}
}
</script>
<style scoped>
#balance {
text-decoration: underline;
cursor: pointer;
}
#balance:hover {
text-decoration: none;
}
.domain-error {
color: red;
margin-left: 5px;
}
</style>

@ -0,0 +1,88 @@
<template>
<div class="container text-center">
<h1 class="text-center">Buy a top-level domain</h1>
<div class="row mt-3">
<div class="col-md-8 offset-md-2">
<p class="text-center">
Degen Domain Service allows anyone to create and own a top-level domain. As a TLD holder you have complete
control over it and you earn revenue from selling domains.
</p>
<div class="d-flex justify-content-center domain-input-container mt-5">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="chosenTldName"
placeholder="enter top-level domain to buy"
type="text"
class="form-control text-center"
>
</div>
</div>
<p class="mt-3 text-center">
Domain price: {{this.parseValue(this.selectedPrice)}} {{getNetworkCurrency}}
</p>
<button class="btn btn-primary btn-lg mt-1 buy-button" @click="buyDomain" :disabled="waiting || tldBuyNotValid(chosenTldName).invalid">
<span v-if="waiting" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
<span v-if="!chosenTldName">Buy TLD</span>
<span v-if="chosenTldName">Buy {{chosenTldName}}!</span>
</button>
<p class="error text-center mt-2" v-if="tldBuyNotValid(chosenTldName).invalid">
<small>
<em>{{ tldBuyNotValid(chosenTldName).message }}</em>
</small>
</p>
</div>
</div>
</div>
</template>
<script lang="ts">
import { ethers } from 'ethers';
import { displayEther, useEthers } from 'vue-dapp';
import { mapActions, mapGetters, mapMutations } from 'vuex';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../components/toasts/WaitingToast.vue";
import useDomainHelpers from "../hooks/useDomainHelpers";
export default {
name: "TldBuy",
data() {
return {
chosenTldName: null
}
},
methods: {
parseValue(someVal) {
if (someVal) {
return ethers.utils.formatEther(someVal);
}
}
},
setup() {
const { address, isActivated, signer } = useEthers()
const toast = useToast();
const { tldBuyNotValid } = useDomainHelpers();
return { address, isActivated, displayEther, signer, tldBuyNotValid, toast }
},
}
</script>
<style scoped>
p {
text-align: justify;
font-size: 1.1em;
}
h3 {
margin-top: 35px;
}
</style>

@ -0,0 +1,455 @@
<template>
<div class="container text-center">
<h1 class="mt-5">Get a .{{tld}} domain!</h1>
<div class="d-flex justify-content-center domain-input-container">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="chosenDomainName"
placeholder="enter domain name"
type="text"
class="form-control text-end"
aria-label="Text input with dropdown button"
>
<span class="input-group-text tld-addon">.{{tld}}</span>
</div>
</div>
<p class="error" v-if="buyNotValid(chosenDomainName).invalid">
<small>
<em>{{ buyNotValid(chosenDomainName).message }}</em>
</small>
</p>
<p class="mt-4">
Domain price: {{this.parseValue(this.selectedPrice)}} {{getNetworkCurrency}}
</p>
<button class="btn btn-primary btn-lg mt-3 buy-button" @click="buyDomain" :disabled="waiting || buyNotValid(chosenDomainName).invalid || !canBuy">
<span v-if="waiting" class="spinner-border spinner-border-sm mx-1" role="status" aria-hidden="true"></span>
<span v-if="canBuy">Buy domain</span>
<span v-if="!canBuy">Buying disabled</span>
</button>
</div>
<div class="container text-center mt-3" v-if="tldOwner == address">
<h2 class="mt-1">Start/stop domain sale (only owner)</h2>
<p class="mt-5">
TLD owner can start/stop public domain sale. If the sale is stopped, only owner can mint new domains
(for free, see section below).
</p>
<p class="mt-3" v-if="canBuy">Status: public sale is ENABLED.</p>
<p class="mt-3" v-if="!canBuy">Status: public sale is DISABLED.</p>
<button
class="btn btn-primary btn-lg mt-3 buy-button"
@click="togglePublicSale"
:disabled="waitingSale"
>
<span v-if="waitingSale" class="spinner-border spinner-border-sm mx-1" role="status" aria-hidden="true"></span>
<span v-if="canBuy">Stop the public sale</span>
<span v-if="!canBuy">Enable the public sale</span>
</button>
</div>
<div class="container text-center mt-3" v-if="tldOwner == address">
<h2 class="mt-1">Mint domain for a specific address</h2>
<p class="mt-5">Choose domain and the address that will own that domain:</p>
<div class="d-flex justify-content-center">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="chosenDomainNameFree"
placeholder="enter domain name"
type="text"
class="form-control text-end"
aria-label="Text input with dropdown button"
>
<span class="input-group-text tld-addon">.{{tld}}</span>
</div>
</div>
<div class="d-flex justify-content-center">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="freeDomainReceiver"
placeholder="enter recipient address"
type="text"
class="form-control text-center"
aria-label="Text input with dropdown button"
>
</div>
</div>
<p class="error" v-if="buyNotValid(chosenDomainName).invalid">
<small>
<em>{{ buyNotValid(chosenDomainName).message }}</em>
</small>
</p>
<button class="btn btn-primary btn-lg mt-3 buy-button" @click="ownerMintDomain" :disabled="waitingFree || buyNotValid(chosenDomainNameFree).invalid">
<span v-if="waitingFree" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Mint domain for address
</button>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { displayEther, useEthers } from 'vue-dapp';
import { mapActions, mapGetters, mapMutations } from 'vuex';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../components/toasts/WaitingToast.vue";
import useDomainHelpers from "../hooks/useDomainHelpers";
export default {
name: "TldDetails",
props: ["tldChain", "tld"],
data() {
return {
canBuy: false,
chosenDomainName: null,
chosenDomainNameFree: null,
freeDomainReceiver: null,
selectedPrice: null,
tldContract: null,
tldOwner: null,
waiting: false, // waiting for TX to complete
waitingFree: false, // waiting for owner's TX to complete
waitingSale: false // waiting for start/stop sale tx to complete
}
},
created() {
if (this.isActivated) {
this.fetchData();
}
},
computed: {
...mapGetters("network", ["getBlockExplorerBaseUrl", "getNetworkCurrency"]),
...mapGetters("degen", ["getTldAddresses", "getDomainPrices", "getTldAbi"]),
domainLowerCase() {
return this.chosenDomainName.toLowerCase();
},
domainLowerCaseFree() {
return this.chosenDomainNameFree.toLowerCase();
}
},
methods: {
...mapActions("degen", ["fetchTlds"]),
...mapMutations("user", ["addDomainManually"]),
async buyDomain() {
this.waiting = true;
const fullDomainName = this.domainLowerCase + "." + this.tld;
if (!this.tldContract) {
this.setContract();
}
if (this.tldContract) {
const existingHolder = await this.tldContract.getDomainHolder(this.domainLowerCase);
if (existingHolder !== ethers.constants.AddressZero) {
this.toast("Sorry, but this domain name is already taken...", {type: TYPE.ERROR});
this.waiting = false;
return;
}
}
try {
let referral = localStorage.getItem("referral");
if (!referral || !ethers.utils.isAddress(referral)) {
referral = ethers.constants.AddressZero;
}
const tx = await this.tldContract.mint(
this.domainLowerCase,
this.address,
referral,
{
value: String(this.selectedPrice)
}
);
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully bought the domain!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.fetchTlds();
this.addDomainManually(fullDomainName);
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waiting = false;
},
async fetchData() {
if (!this.tldContract) {
this.setContract();
}
if (this.tldContract) {
this.canBuy = await this.tldContract.buyingEnabled();
this.selectedPrice = this.getDomainPrices["."+this.tld];
this.tldOwner = await this.tldContract.owner();
}
},
async ownerMintDomain() {
this.waitingFree = true;
const fullDomainName = this.domainLowerCaseFree + "." + this.tld;
const recipient = this.freeDomainReceiver;
if (!this.tldContract) {
this.setContract();
}
if (this.tldContract) {
const existingHolder = await this.tldContract.getDomainHolder(this.domainLowerCaseFree);
if (existingHolder !== ethers.constants.AddressZero) {
this.toast("Sorry, but this domain name is already taken...", {type: TYPE.ERROR});
this.waitingFree = false;
return;
}
}
try {
let referral = localStorage.getItem("referral");
if (!referral || !ethers.utils.isAddress(referral)) {
referral = ethers.constants.AddressZero;
}
const tx = await this.tldContract.mint(
this.domainLowerCaseFree,
recipient,
referral,
{
value: String(this.selectedPrice)
}
);
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully bought the domain!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.fetchTlds();
if (String(recipient).toLowerCase() === String(this.address).toLowerCase()) {
// if recipient is current user, add domain to the list of their domains
this.addDomainManually(fullDomainName);
}
this.waitingFree = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waitingFree = false;
}
} catch (e) {
console.log(e)
this.waitingFree = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waitingFree = false;
},
parseValue(someVal) {
if (someVal) {
return ethers.utils.formatEther(someVal);
}
},
setContract() {
let tldAddresses = this.getTldAddresses;
if (tldAddresses && JSON.stringify(tldAddresses) != "{}") {
const tldAddr = tldAddresses["."+this.tld];
// construct contract
const intfc = new ethers.utils.Interface(this.getTldAbi);
this.tldContract = new ethers.Contract(tldAddr, intfc, this.signer);
}
},
async togglePublicSale() {
this.waitingSale = true;
if (!this.tldContract) {
this.setContract();
}
if (this.tldContract) {
try {
const tx = await this.tldContract.toggleBuyingDomains();
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully changed the buying domains status from " + this.canBuy + " to " + !this.canBuy + "!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.canBuy = !this.canBuy;
this.waitingSale = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waitingSale = false;
}
} catch (e) {
console.log(e)
this.waitingSale = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waitingSale = false;
}
},
},
setup() {
const { address, chainId, isActivated, signer } = useEthers()
const toast = useToast();
const { buyNotValid } = useDomainHelpers();
return { address, buyNotValid, chainId, isActivated, displayEther, signer, toast }
},
watch: {
isActivated() {
this.fetchData();
},
getDomainPrices(newVal, oldVal) {
if (newVal) {
this.fetchData();
}
},
tld() {
if (this.isActivated) {
this.setContract();
this.fetchData();
}
},
}
}
</script>
<style scoped>
.buy-button {
margin-bottom: 100px;
}
.domain-input {
width: 50%;
}
.domain-input-container {
margin-top: 80px;
}
.tld-addon {
background-color: white;
}
@media only screen and (max-width: 767px) {
.domain-input {
width: 100%;
}
}
</style>

@ -0,0 +1,34 @@
<template>
<div class="row">
<div class="col-md-3" id="sidebar-container">
<Sidebar />
</div>
<div class="col-md-9">
<MyTlds />
</div>
</div>
</template>
<script lang="ts">
import MyTlds from '../components/MyTlds.vue';
import Sidebar from '../components/Sidebar.vue';
export default {
name: "Tlds",
components: {
MyTlds,
Sidebar
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,198 @@
<template>
<div class="row">
<div class="col-md-3" id="sidebar-container">
<Sidebar />
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-12">
<div class="container text-center">
<h3>Transfer domain</h3>
<div class="row mt-5">
<div class="col-md-6 offset-md-3">
<input
:value="domainName+'.'+tld"
class="form-control text-center"
readonly
>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6 offset-md-3">
<input
v-model="recipient"
class="form-control text-center"
placeholder="Enter recipient address"
>
</div>
</div>
<button
class="btn btn-primary mt-3 mb-5"
@click="transfer"
:disabled="waiting"
>
<span v-if="waiting" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Transfer
</button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { mapActions, mapGetters } from 'vuex';
import { useEthers } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import tldsJson from '../abi/tlds.json';
import tldAbi from '../abi/DegenTLD.json';
import Sidebar from '../components/Sidebar.vue';
import WaitingToast from "../components/toasts/WaitingToast.vue";
export default {
name: "TransferDomain",
props: ["tld", "domainName"],
components: {
Sidebar
},
data() {
return {
recipient: null,
recipientDomain: null,
selectedDomain: this.domainName + "." + this.tld,
waiting: false
}
},
computed: {
...mapGetters("network", ["getBlockExplorerBaseUrl", "getFallbackProvider"]),
...mapGetters("user", ["getUserSelectedName"]),
},
methods: {
...mapActions("user", ["removeDomainFromUserDomains"]),
async transfer() {
this.waiting = true;
const intfc = new ethers.utils.Interface(tldAbi);
// check if domain name/address is valid
if (this.recipient && this.recipient.split(".").length === 2) { // likely a domain name
// split into two (domain name and TLD)
const domArr = this.recipient.split(".");
for (let netId in tldsJson) { // iterate through different chains
if (tldsJson[netId]["."+domArr[1]]) { // find the correct TLD
// get fallback provider based on network ID
const fProvider = this.getFallbackProvider(Number(netId));
// create TLD contract
const tldContractRead = new ethers.Contract(tldsJson[netId]["."+domArr[1]], intfc, fProvider);
// fetch domain holder
const recDomainHolder = await tldContractRead.getDomainHolder(domArr[0]);
if (recDomainHolder !== ethers.constants.AddressZero) {
this.recipientDomain = this.recipient;
this.recipient = recDomainHolder;
} else {
this.toast("The recipient's domain name " + this.recipient + " does not exist.", {type: TYPE.ERROR});
this.waiting = false;
}
break;
}
}
if (!ethers.utils.isAddress(this.recipient)) {
this.toast("Top-level domain ." + domArr[1] + " does not exist (if this is a mistake, contact us on Discord).", {type: TYPE.ERROR});
this.waiting = false;
}
} else if (this.recipient) { // valid address
if (!ethers.utils.isAddress(this.recipient)) { // valid address
this.toast("This is not a valid recipient address.", {type: TYPE.ERROR});
this.waiting = false;
}
} else {
this.toast("This is not a valid recipient address or domain name.", {type: TYPE.ERROR});
this.waiting = false;
}
if (this.recipient && ethers.utils.isAddress(this.recipient)) {
// create contract
const tldContractWrite = new ethers.Contract(tldsJson[this.chainId]["."+this.tld], intfc, this.signer);
// get domain token ID
const domainData = await tldContractWrite.domains(this.domainName);
try {
const tx = await tldContractWrite.transferFrom(
this.address,
this.recipient,
domainData.tokenId.toNumber()
);
if (tx) {
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully transferred the domain!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.removeDomainFromUserDomains(this.domainName+"."+this.tld);
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
}
}
},
setup() {
const { address, chainId, signer } = useEthers();
const toast = useToast();
return { address, chainId, signer, toast }
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,663 @@
<template>
<div class="container text-center">
<h1 class="mt-5">Mint a Degen Anon domain!</h1>
<h4 class="mt-3">(domain + unique PFP)</h4>
<div class="row mt-5">
<div class="col-md-8 offset-md-2">
<p>
<img class="img-fluid anon-img rounded-3" src="../../assets/anons/nft.jpg" />
</p>
</div>
</div>
<div class="row mt-5">
<div class="col-md-8 offset-md-2">
<p>
Degen Anon is our first domain which gives you both a unique domain name, and also a generative art
profile picture (all in one NFT).
</p>
</div>
</div>
<div class="d-flex justify-content-center domain-input-container">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="chosenDomainName"
placeholder="enter domain name"
type="text"
class="form-control text-end"
aria-label="Text input with dropdown button"
>
<span class="input-group-text tld-addon">
<span v-if="loading" class="spinner-border spinner-border-sm mx-1" role="status" aria-hidden="true"></span>
<span v-if="!loading">{{tld}}</span>
</span>
</div>
</div>
<p class="error" v-if="buyNotValidFlexi(chosenDomainName).invalid">
<small>
<em>{{ buyNotValidFlexi(chosenDomainName).message }}</em>
</small>
</p>
<p class="mt-4">
Domain price: {{getDomainPrice}} {{payTokenName}}
</p>
<!-- Paused -->
<button
v-if="isActivated && isNetworkSupported && paused"
class="btn btn-primary btn-lg mt-3 buy-button"
disabled="true"
>
<span>Buying disabled</span>
</button>
<!-- Balance too low -->
<button
v-if="isActivated && isNetworkSupported && !paused && !hasUserEnoughTokens"
class="btn btn-primary btn-lg mt-3 buy-button"
disabled="true"
>
<span>Your {{payTokenName}} balance is too low</span>
</button>
<!-- Approve payment token -->
<button
data-bs-toggle="modal" data-bs-target="#approveTokenModal"
v-if="isActivated && isNetworkSupported && !paused && !hasEnoughAllowance && hasUserEnoughTokens"
class="btn btn-primary btn-lg mt-3 buy-button"
@click="chosenAllowance=getDomainPrice"
:disabled="waiting || buyNotValidFlexi(chosenDomainName).invalid"
>
<span>Approve {{payTokenName}}</span>
</button>
<p v-if="isActivated && isNetworkSupported && !paused && !hasEnoughAllowance" class="mt-1">
<small><strong>Important:</strong> You will need to complete 2 transactions: Approve {{payTokenName}} + Buy Domain.</small>
</p>
<!-- Buy domain -->
<button
v-if="isActivated && !paused && isNetworkSupported && hasUserEnoughTokens && hasEnoughAllowance"
class="btn btn-primary btn-lg mt-3 buy-button"
@click="buyDomain"
:disabled="waiting || buyNotValidFlexi(chosenDomainName).invalid || paused || !canMint"
>
<span v-if="waiting" class="spinner-border spinner-border-sm mx-1" role="status" aria-hidden="true"></span>
<span v-if="!paused && canMint">Buy domain</span>
<span v-if="!paused && !canMint">Not eligible</span>
</button>
<div v-if="!isActivated" class="mt-4 buy-button">
<button class="btn btn-primary btn-lg" @click="open">Connect wallet</button>
</div>
<div v-if="isActivated && !isNetworkSupported" class="mt-4 buy-button">
<button class="btn btn-primary btn-lg" @click="changeNetwork(networkName)">Switch to {{networkName}}</button>
</div>
<div class="row mt-5">
<div class="col-md-6 offset-md-3">
<table class="table table-bordered" style="color:#DBDFEA;border-style:none;">
<thead>
<tr>
<th scope="col">Domain length</th>
<th scope="col">Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>1 character</td>
<td>$10 000</td>
</tr>
<tr>
<td>2 characters</td>
<td>$3 000</td>
</tr>
<tr>
<td>3 characters</td>
<td>$999</td>
</tr>
<tr>
<td>4 characters</td>
<td>$199</td>
</tr>
<tr>
<td>5+ characters</td>
<td>$69</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row mt-5">
<div class="col-md-8 offset-md-2">
<h2>FAQ</h2>
<h4 class="mt-4">What is the max/total supply?</h4>
<p class="mt-3">
Max/total supply is between 44 and 6377 domains. It depends on the prices that domains are bought at.
If all domains are bought at $69, the max supply is 6377 domains. If some domains are bought at a
higher price, the total supply will be lower. If all domains are bought at $10k, the total supply
is capped at 44 domains.
</p>
<h4 class="mt-5">Can I buy/sell these PFP domains on NFT marketplaces?</h4>
<p class="mt-3">
Yes, Degen Anon is available on NFT marketplaces. You can also filter domains by attributes such as
domain length, colors in the domain image, expressions (serious, smiling, surprised) and
accessories (VR glasses, gas mask).
</p>
<h4 class="mt-5">Where are the images stored?</h4>
<p class="mt-3">
Degen Anon images are stored completely on-chain in a form of SVG code. We don't rely on any centralized servers
or third-party storage solutions such as IPFS. All data is stored within Degen Anon smart contracts on the
blockchain. This means that the images will exist forever (or at least as long as Ethereum exists).
</p>
</div>
</div>
</div>
<Referral v-if="isActivated" :urlpath="'nft/anon'" />
<!-- Approve payment token modal -->
<div class="modal fade" id="approveTokenModal" tabindex="-1" aria-labelledby="approveTokenModalLabel" aria-hidden="true" modal-dialog-centered>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="approveTokenModalLabel">Approve {{payTokenName}}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<p>
If you plan to mint multiple domains, consider giving the minting contract a higher {{payTokenName}} approval.
</p>
<p>
With each domain buy, the total approval amount is reduced by {{getDomainPrice}} {{payTokenName}}.
</p>
Approval for <input type="text" id="recipient-name" v-model="chosenAllowance"> {{payTokenName}}.
</div>
</div>
<div class="modal-footer">
<button
type="button"
@click="approveTokens"
class="btn btn-secondary"
:disabled="selectedAllowanceTooLow"
>
<span v-if="!selectedAllowanceTooLow">Approve {{payTokenName}}</span>
<span v-if="selectedAllowanceTooLow">Approval lower than domain price</span>
</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { useBoard, useEthers } from 'vue-dapp';
import { mapGetters, mapMutations } from 'vuex';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../../components/toasts/WaitingToast.vue";
import Referral from '../../components/Referral.vue';
import useDomainHelpers from "../../hooks/useDomainHelpers";
import useChainHelpers from "../../hooks/useChainHelpers";
import MinterAbi from "../../abi/anon/DegenAnonMinter.json";
import TraitsJson from "../../abi/anon/DegenAnonTraits.json";
import tldAbi from '../../abi/FlexiDegenTLD.json';
import Erc20Abi from '../../abi/Erc20.json';
export default {
name: "DegenAnonMint",
data() {
return {
canMint: true,
chosenAllowance: 69,
chosenDomainName: null,
domainPrice: null,
idMainnet: 42161,
idTestnet: 80001,
loading: false, // loading data
mintAddressTestnet: "0xf5e50e9e5A20104A927a9D7c49bD6008DB7CA01C",
mintAddressMainnet: "0xe0fBa63B2C3CCF48C2A14d0D3a29a15e4c17A1fF",
mintContract: null,
networkName: "Arbitrum",
paused: true,
payTokenAddressTestnet: "0x8B7387a92c5F645c51Aa8975E76a9c2bfDdBc0F1",
payTokenAddressMainnet: "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
payTokenAllowance: 0,
payTokenBalance: 0,
payTokenContract: null,
payTokenDecimals: 6,
payTokenName: "USDC",
randomFeatureIds: [],
randomFeaturesAmount: 3,
tld: ".degen",
tldAddressTestnet: "0xBF113092d7ceabB5b891C4B232C910CDF2153AC5",
tldAddressMainnet: "0xcC66213645474a7B61BAf95330D01e50789eaF4b",
tldContract: null,
tldMainnet: ".degen",
tldTestnet: ".testanon",
waiting: false, // waiting for TX to complete
}
},
components: {
Referral
},
created() {
this.setContracts();
this.fetchRandomFeaturesIds();
},
computed: {
...mapGetters("network", ["getBlockExplorerBaseUrl", "getFallbackProvider"]),
getDomainPrice() {
if (this.chosenDomainName) {
if (this.chosenDomainName.length === 1) {
return 10000;
} else if (this.chosenDomainName.length === 2) {
return 3000;
} else if (this.chosenDomainName.length === 3) {
return 999;
} else if (this.chosenDomainName.length === 4) {
return 199;
}
}
return 69;
},
domainLowerCase() {
return this.chosenDomainName.toLowerCase();
},
hasEnoughAllowance() {
if (this.address && Number(this.payTokenBalance) > 0) {
if (Number(this.payTokenAllowance) >= Number(this.getDomainPrice)) {
return true;
}
}
return false;
},
hasUserEnoughTokens() {
if (this.address && Number(this.payTokenBalance) > 0) {
if (Number(this.payTokenBalance) >= Number(this.getDomainPrice)) {
return true;
}
}
return false;
},
isNetworkSupported() {
if (this.isActivated) {
if (this.networkName.includes("Testnet") && this.chainId === this.idTestnet) {
return true;
} else if (!this.networkName.includes("Testnet") && this.chainId === this.idMainnet) {
return true;
}
}
return false;
},
selectedAllowanceTooLow() {
if (Number(this.chosenAllowance) >= Number(this.getDomainPrice)) {
return false;
}
return true;
}
},
methods: {
...mapMutations("user", ["addDomainManually"]),
async approveTokens() {
this.waiting = true;
let mintAddr;
// match data to the chain ID
if (this.chainId === this.idMainnet) {
mintAddr = this.mintAddressMainnet;
} else if (this.chainId === this.idTestnet) {
mintAddr = this.mintAddressTestnet;
}
try {
const tx = await this.payTokenContract.approve(
mintAddr, // spender (minting contract)
ethers.utils.parseUnits(String(this.chosenAllowance), this.payTokenDecimals) // amount
);
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "STEP 1) Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
document.getElementById('approveTokenModal').click(); // close the modal
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("STEP 1) You have successfully set the allowance! Now PROCEED with STEP 2: buying the domain.", {
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.payTokenAllowance = Number(this.chosenAllowance);
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waiting = false;
},
async buyDomain() {
this.waiting = true;
const fullDomainName = this.domainLowerCase + this.tld.toLowerCase();
// check if domain is available
const existingHolder = await this.tldContract.getDomainHolder(this.domainLowerCase);
if (existingHolder !== ethers.constants.AddressZero) {
this.toast("Sorry, but this domain name is already taken...", {type: TYPE.ERROR});
this.waiting = false;
return;
}
// set up minting contract
let mintAddress = this.mintAddressMainnet;
if (this.chainId === this.idTestnet) {
mintAddress = this.mintAddressTestnet;
}
const mintIntfc = new ethers.utils.Interface(MinterAbi);
this.mintContract = new ethers.Contract(mintAddress, mintIntfc, this.signer);
try {
let referral = localStorage.getItem("referral");
if (!referral || !ethers.utils.isAddress(referral)) {
referral = ethers.constants.AddressZero;
}
const tx = await this.mintContract.mint(
this.domainLowerCase,
this.address,
referral,
this.randomFeatureIds
);
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "STEP 2) Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("STEP 2) You have successfully bought a " + this.tld + " domain!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.setContracts();
this.addDomainManually(fullDomainName);
this.fetchRandomFeaturesIds();
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waiting = false;
},
changeNetwork(nName) {
const networkData = this.switchNetwork(nName);
window.ethereum.request({
method: networkData.method,
params: networkData.params
});
},
async fetchPaymentTokenData() {
this.loading = true;
if (this.address) {
let payTokenAddr;
let mintAddr;
// match data to the chain ID
if (this.chainId === this.idMainnet) {
payTokenAddr = this.payTokenAddressMainnet;
mintAddr = this.mintAddressMainnet;
} else if (this.chainId === this.idTestnet) {
payTokenAddr = this.payTokenAddressTestnet;
mintAddr = this.mintAddressTestnet;
}
if (payTokenAddr) {
// pay token contract
const tokenIntfc = new ethers.utils.Interface(Erc20Abi);
this.payTokenContract = new ethers.Contract(payTokenAddr, tokenIntfc, this.signer);
const allowanceWei = await this.payTokenContract.allowance(this.address, mintAddr);
this.payTokenAllowance = ethers.utils.formatUnits(allowanceWei, this.payTokenDecimals);
console.log("payTokenAllowance: " + this.payTokenAllowance);
const balanceWei = await this.payTokenContract.balanceOf(this.address);
this.payTokenBalance = ethers.utils.formatUnits(balanceWei, this.payTokenDecimals);
console.log("payTokenBalance: " + this.payTokenBalance);
}
}
this.loading = false;
},
fetchRandomFeaturesIds() {
while (this.randomFeatureIds.length < this.randomFeaturesAmount) {
const randomTrait = TraitsJson[Math.floor(Math.random() * TraitsJson.length)];
if (this.randomFeatureIds.indexOf(randomTrait) === -1) {
this.randomFeatureIds.push(randomTrait);
}
}
},
async setContracts() {
this.loading = true;
let fProvider;
let tldAddr;
let mintAddr;
let nftAddr;
let payTokenAddr;
// testnet data
if (this.networkName.includes("Testnet")) {
fProvider = this.getFallbackProvider(this.idTestnet);
tldAddr = this.tldAddressTestnet;
mintAddr = this.mintAddressTestnet;
nftAddr = this.nftAddressTestnet;
payTokenAddr = this.payTokenAddressTestnet;
this.tld = this.tldTestnet;
} else {
fProvider = this.getFallbackProvider(this.idMainnet);
tldAddr = this.tldAddressMainnet;
mintAddr = this.mintAddressMainnet;
nftAddr = this.nftAddressMainnet;
payTokenAddr = this.payTokenAddressMainnet;
this.tld = this.tldMainnet;
}
// match data to the chain ID
if (this.chainId === this.idMainnet) {
fProvider = this.getFallbackProvider(this.idMainnet);
tldAddr = this.tldAddressMainnet;
mintAddr = this.mintAddressMainnet;
nftAddr = this.nftAddressMainnet;
payTokenAddr = this.payTokenAddressMainnet;
this.tld = this.tldMainnet;
} else if (this.chainId === this.idTestnet) {
fProvider = this.getFallbackProvider(this.idTestnet);
tldAddr = this.tldAddressTestnet;
mintAddr = this.mintAddressTestnet;
nftAddr = this.nftAddressTestnet;
payTokenAddr = this.payTokenAddressTestnet;
this.tld = this.tldTestnet;
}
// tld contract
const tldIntfc = new ethers.utils.Interface(tldAbi);
this.tldContract = new ethers.Contract(tldAddr, tldIntfc, fProvider);
// minting contract
const mintIntfc = new ethers.utils.Interface(MinterAbi);
this.mintContract = new ethers.Contract(mintAddr, mintIntfc, fProvider);
//const priceWei = await this.mintContract.price();
//this.domainPrice = ethers.utils.formatUnits(priceWei, this.payTokenDecimals);
this.paused = await this.mintContract.paused();
this.loading = false;
if (this.address) {
this.fetchPaymentTokenData();
}
},
},
setup() {
const { open } = useBoard();
const { address, chainId, isActivated, signer } = useEthers();
const toast = useToast();
const { buyNotValidFlexi } = useDomainHelpers();
const { switchNetwork } = useChainHelpers();
return { address, buyNotValidFlexi, chainId, isActivated, open, signer, switchNetwork, toast }
},
watch: {
address() {
this.fetchPaymentTokenData();
},
chainId() {
this.setContracts();
},
/*
chosenDomainName() {
if (this.chosenDomainName) {
if (this.chosenDomainName.length === 1) {
this.domainPrice = 10000;
} else if (this.chosenDomainName.length === 2) {
this.domainPrice = 3000;
} else if (this.chosenDomainName.length === 3) {
this.domainPrice = 999;
} else if (this.chosenDomainName.length === 4) {
this.domainPrice = 199;
} else {
this.domainPrice = 69;
}
} else {
this.domainPrice = 69;
}
}*/
}
}
</script>
<style scoped>
.anon-img {
width: 15em;
}
.buy-button {
margin-bottom: 50px;
}
.domain-input {
width: 50%;
}
.domain-input-container {
margin-top: 30px;
}
.error {
color: #DBDFEA;
}
.l2dao {
width: 50px;
}
.tld-addon {
background-color: white;
}
@media only screen and (max-width: 767px) {
.domain-input {
width: 100%;
}
}
</style>

@ -0,0 +1,283 @@
<template>
<div class="container text-center">
<h1 class="mt-5">Get whitelisted for the Degen Anon NFT mint!</h1>
<div class="row mt-5">
<div class="col-md-8 offset-md-2">
<p>
<img class="img-fluid anon-img" src="../../assets/anons/nft.jpg" />
</p>
</div>
</div>
<div class="row mt-2">
<div class="col-md-8 offset-md-2">
<h3 class="mt-5">Wen NFT mint?</h3>
<p>Soon. But before that, you can whitelist your address to be able to mint before everyone else.</p>
<h3 class="mt-5">NFT price?</h3>
<p>$69 per NFT (max supply: 8888 NFTs).</p>
<h3 class="mt-5">What will the funds be used for?</h3>
<p>
To grow the Degen Domains team, expand our marketing operations, get more DAO partnerships, and build cool new
features which will make Degen Domains a major web3 domains protocol.
See <a target="_blank" href="https://docs.degendomains.io/roadmap/">our roadmap here</a>!
</p>
<a
target="_blank"
href="https://forms.gle/#"
class="btn btn-primary btn-lg mt-4 mb-5">
Join Waitlist
</a>
</div>
</div>
<!--
<div class="row mt-5">
<div class="col-md-8 offset-md-2">
<h3>Sign up for the waitlist</h3>
<p class="mt-2">
Enter the number of NFTs that you plan to mint. Your address will be stored in the waitlist on the blockchain
(<strong>no payment</strong> is made at this point).
</p>
<div class="d-flex justify-content-center domain-input-container mt-4">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="amount"
type="number"
min="1"
max="100"
class="form-control text-end"
>
<span class="input-group-text nft-addon">
<span>NFT(s)</span>
</span>
</div>
</div>
<button
v-if="isActivated"
class="btn btn-primary btn-lg mt-2 mb-5"
@click="joinWaitlist"
:disabled="waiting || notValid || paused"
>
<span v-if="waiting || loading" class="spinner-border spinner-border-sm mx-2" role="status" aria-hidden="true"></span>
<span v-if="!paused">Join Whitelist</span>
<span v-if="paused">Paused</span>
</button>
<p class="error">{{errorMsg}}</p>
<button v-if="!isActivated" class="btn btn-primary btn-lg mt-2 mb-5" @click="open">Connect wallet</button>
</div>
</div>
<div class="row mt-2">
<div class="col-md-8 offset-md-2">
<h3 class="mt-1">Get notified!</h3>
<p>
<a target="_blank" href="https://#">
Click here to get notified about the launch!
</a>
</p>
</div>
</div>
-->
</div>
</template>
<script>
import { ethers } from 'ethers';
import { useBoard, useEthers } from 'vue-dapp';
import { useToast, TYPE } from "vue-toastification";
import { mapGetters } from 'vuex';
import AnonWhitelistAbi from "../../abi/anon/AnonWhitelist.json";
import WaitingToast from "../../components/toasts/WaitingToast.vue";
export default {
name: "DegenAnonNft",
data() {
return {
amount: 1,
errorMsg: null,
loading: false, // loading data
paused: true,
waiting: false, // waiting for TX to complete
}
},
created() {
this.checkPaused()
},
computed: {
...mapGetters("network", ["getBlockExplorerBaseUrl"]),
// NFT Whitelist Contracts
getContractAddress() {
if (this.chainId === 10) {
// Optimism
return "0xa562fD780b05B4c6d895ba78D5519Ddf0a5d25D6";
} else if (this.chainId === 56) {
// BNB Mainnet TODO
return "0xC08214D6F73D8F5D06e515862D4A528090f142F5";
} else if (this.chainId === 97) {
// BNB testnet TODO
return "0xC08214D6F73D8F5D06e515862D4A528090f142F5";
} else if (this.chainId === 100) {
// Gnosis Chain
return "0xC08214D6F73D8F5D06e515862D4A528090f142F5";
} else if (this.chainId === 137) {
// Polygon
return "0x35dFE8d11466649204aa4A3aa0463541b28ee6Bb";
} else if (this.chainId === 42161) {
// Arbitrum
return "0x03bdc5B2EA8176693c25BE1d999900a4FD1CaC59";
} else if (this.chainId === 80001) {
// Mumbai
return "0x7d7143649d8ca8f4BB10A4C43Cd03255E2eB060c";
} else if (this.chainId === 2000) {
// Dogechain TODO
return "0x7d7143649d8ca8f4BB10A4C43Cd03255E2eB060c";
}
return null;
},
notValid() {
if (this.amount < 1 || this.amount > 100) {
this.errorMsg = "Amount should be between 1 and 100";
return true;
} else if (isNaN(this.amount)) {
this.errorMsg = "Amount must be a number";
return true;
}
this.errorMsg = "";
return false;
}
},
methods: {
async joinWaitlist() {
this.waiting = true;
const amountUsd = Number(this.amount) * 500;
const intfc = new ethers.utils.Interface(AnonWhitelistAbi);
const contract = new ethers.Contract(this.getContractAddress, intfc, this.signer);
try {
const tx = await contract.joinWhitelist(amountUsd);
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully joined the whitelist!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waiting = false;
},
async checkPaused() {
if (this.isActivated) {
this.loading = true;
const intfc = new ethers.utils.Interface(AnonWhitelistAbi);
const contract = new ethers.Contract(this.getContractAddress, intfc, this.signer);
this.paused = await contract.paused();
this.loading = false;
}
}
},
setup() {
const { open } = useBoard();
const { address, chainId, isActivated, signer } = useEthers();
const toast = useToast();
return { address, chainId, isActivated, open, signer, toast }
},
watch: {
chainId() {
this.checkPaused();
},
}
}
</script>
<style scoped>
.anon-img {
width: 15em;
}
.domain-input {
width: 200px;
}
.domain-input-container {
margin-top: 10px;
}
.nft-addon {
background-color: white;
}
.error {
color: #DBDFEA;
}
@media only screen and (max-width: 767px) {
.domain-input {
width: 50%;
}
}
</style>

@ -0,0 +1,540 @@
<template>
<div class="container text-center">
<h1 class="mt-5">Get yourself a {{tld}} domain!</h1>
<div class="row mt-5">
<div class="col-md-8 offset-md-2">
<p>
{{tld}} domain is the official domain of
<a href="https://cryptocrewnft.com" target="_blank">the Crypto Crew community</a>,
and is powered by the Degen Domains protocol.
</p>
</div>
</div>
<div class="d-flex justify-content-center domain-input-container">
<div class="input-group mb-3 domain-input input-group-lg">
<input
v-model="chosenDomainName"
placeholder="enter domain name"
type="text"
class="form-control text-end"
aria-label="Text input with dropdown button"
>
<span class="input-group-text tld-addon">
<span v-if="loading" class="spinner-border spinner-border-sm mx-1" role="status" aria-hidden="true"></span>
<span v-if="!loading">{{tld}}</span>
</span>
</div>
</div>
<p class="error" v-if="buyNotValidFlexi(chosenDomainName).invalid">
<small>
<em>{{ buyNotValidFlexi(chosenDomainName).message }}</em>
</small>
</p>
<p class="mt-4">
Domain price: {{domainPrice}} {{payTokenName}}
</p>
<!-- Paused -->
<button
v-if="isActivated && isNetworkSupported && paused"
class="btn btn-primary btn-lg mt-3 buy-button"
disabled="true"
>
<span>Buying disabled</span>
</button>
<!-- Balance too low -->
<button
v-if="isActivated && isNetworkSupported && !paused && !hasUserEnoughTokens"
class="btn btn-primary btn-lg mt-3 buy-button"
disabled="true"
>
<span>Your {{payTokenName}} balance is too low</span>
</button>
<!-- Approve payment token -->
<button
data-bs-toggle="modal" data-bs-target="#approveTokenModal"
v-if="isActivated && isNetworkSupported && !paused && !hasEnoughAllowance && hasUserEnoughTokens"
class="btn btn-primary btn-lg mt-3 buy-button"
:disabled="waiting || buyNotValidFlexi(chosenDomainName).invalid"
>
<span>Approve {{payTokenName}}</span>
</button>
<p v-if="isActivated && isNetworkSupported && !paused && !hasEnoughAllowance" class="mt-1">
<small><strong>Important:</strong> You will need to complete 2 transactions: Approve {{payTokenName}} + Buy Domain.</small>
</p>
<!-- Buy domain -->
<button
v-if="isActivated && !paused && isNetworkSupported && hasUserEnoughTokens && hasEnoughAllowance"
class="btn btn-primary btn-lg mt-3 buy-button"
@click="buyDomain"
:disabled="waiting || buyNotValidFlexi(chosenDomainName).invalid || paused || !canMint"
>
<span v-if="waiting" class="spinner-border spinner-border-sm mx-1" role="status" aria-hidden="true"></span>
<span v-if="!paused && canMint">Buy domain</span>
<span v-if="!paused && !canMint">Not eligible</span>
</button>
<div v-if="!isActivated" class="mt-4 buy-button">
<button class="btn btn-primary btn-lg" @click="open">Connect wallet</button>
</div>
<div v-if="isActivated && !isNetworkSupported" class="mt-4 buy-button">
<button class="btn btn-primary btn-lg" @click="changeNetwork(networkName)">Switch to {{networkName}}</button>
</div>
</div>
<Referral v-if="isActivated" :urlpath="'partners/crew'" />
<!-- Approve payment token modal -->
<div class="modal fade" id="approveTokenModal" tabindex="-1" aria-labelledby="approveTokenModalLabel" aria-hidden="true" modal-dialog-centered>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="approveTokenModalLabel">Approve {{payTokenName}}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<p>
If you plan to mint multiple domains, consider giving the minting contract a higher {{payTokenName}} approval.
</p>
<p>
With each domain buy, the total approval amount is reduced by {{domainPrice}} {{payTokenName}}.
</p>
Approval for <input type="text" id="recipient-name" v-model="chosenAllowance"> {{payTokenName}}.
</div>
</div>
<div class="modal-footer">
<button
type="button"
@click="approveTokens"
class="btn btn-secondary"
:disabled="selectedAllowanceTooLow"
>
<span v-if="!selectedAllowanceTooLow">Approve {{payTokenName}}</span>
<span v-if="selectedAllowanceTooLow">Approval lower than domain price</span>
</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</template>
<script>
import { ethers } from 'ethers';
import { useBoard, useEthers } from 'vue-dapp';
import { mapGetters, mapMutations } from 'vuex';
import { useToast, TYPE } from "vue-toastification";
import WaitingToast from "../../components/toasts/WaitingToast.vue";
import Referral from '../../components/Referral.vue';
import useDomainHelpers from "../../hooks/useDomainHelpers";
import useChainHelpers from "../../hooks/useChainHelpers";
import MinterAbi from "../../abi/partners/crew/CrewMinter.json";
import tldAbi from '../../abi/FlexiDegenTLD.json';
import Erc20Abi from '../../abi/Erc20.json';
export default {
name: "Crew",
data() {
return {
canMint: true,
chosenAllowance: 20,
chosenDomainName: null,
domainPrice: null,
idMainnet: 137,
idTestnet: 80001,
loading: false, // loading data
mintAddressTestnet: "0xe3116Fe0b4526290c4231A59D2094605E581d8B6",
mintAddressMainnet: "0xA8221890768603210c1a32d88374111084E46E6d",
mintContract: null,
networkName: "Polygon",
paused: true,
payTokenAddressTestnet: "0xD1d656845AD2a15934C314e46977554FFe85383E",
payTokenAddressMainnet: "0x03a2A7E95eCe3112b8d33F9bCC21F0c9BA843e35",
payTokenAllowance: 0,
payTokenBalance: 0,
payTokenContract: null,
payTokenDecimals: 4,
payTokenName: "CREW",
tld: ".crew",
tldAddressTestnet: "0x49651e70df13b8fd5684B0b82b1b3D7Cdc8cF80f",
tldAddressMainnet: "0xeFBE0b46649B7A0F1e1D49CCa98aD9CF6bcFB096",
tldContract: null,
tldMainnet: ".crew",
tldTestnet: ".testcrew",
waiting: false, // waiting for TX to complete
}
},
components: {
Referral
},
created() {
this.setContracts();
},
computed: {
...mapGetters("network", ["getBlockExplorerBaseUrl", "getFallbackProvider"]),
domainLowerCase() {
return this.chosenDomainName.toLowerCase();
},
hasEnoughAllowance() {
if (this.address && Number(this.payTokenBalance) > 0) {
if (Number(this.payTokenAllowance) >= Number(this.domainPrice)) {
return true;
}
}
return false;
},
hasUserEnoughTokens() {
if (this.address && Number(this.payTokenBalance) > 0) {
if (Number(this.payTokenBalance) >= Number(this.domainPrice)) {
return true;
}
}
return false;
},
isNetworkSupported() {
if (this.isActivated) {
if (this.networkName.includes("Testnet") && this.chainId === this.idTestnet) {
return true;
} else if (!this.networkName.includes("Testnet") && this.chainId === this.idMainnet) {
return true;
}
}
return false;
},
selectedAllowanceTooLow() {
if (Number(this.chosenAllowance) >= Number(this.domainPrice)) {
return false;
}
return true;
},
},
methods: {
...mapMutations("user", ["addDomainManually"]),
async approveTokens() {
this.waiting = true;
let mintAddr;
// match data to the chain ID
if (this.chainId === this.idMainnet) {
mintAddr = this.mintAddressMainnet;
} else if (this.chainId === this.idTestnet) {
mintAddr = this.mintAddressTestnet;
}
try {
const tx = await this.payTokenContract.approve(
mintAddr, // spender (minting contract)
ethers.utils.parseUnits(String(this.chosenAllowance), this.payTokenDecimals) // amount
);
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
document.getElementById('approveTokenModal').click(); // close the modal
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully set the allowance! Now proceed with buying the domain.", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.payTokenAllowance = Number(this.chosenAllowance);
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waiting = false;
},
async buyDomain() {
this.waiting = true;
const fullDomainName = this.domainLowerCase + this.tld.toLowerCase();
// check if domain is available
const existingHolder = await this.tldContract.getDomainHolder(this.domainLowerCase);
if (existingHolder !== ethers.constants.AddressZero) {
this.toast("Sorry, but this domain name is already taken...", {type: TYPE.ERROR});
this.waiting = false;
return;
}
// set up minting contract
let mintAddress = this.mintAddressMainnet;
if (this.chainId === this.idTestnet) {
mintAddress = this.mintAddressTestnet;
}
const mintIntfc = new ethers.utils.Interface(MinterAbi);
this.mintContract = new ethers.Contract(mintAddress, mintIntfc, this.signer);
try {
let referral = localStorage.getItem("referral");
if (!referral || !ethers.utils.isAddress(referral)) {
referral = ethers.constants.AddressZero;
}
const tx = await this.mintContract.mint(
this.domainLowerCase,
this.address,
referral
);
const toastWait = this.toast(
{
component: WaitingToast,
props: {
text: "Please wait for your transaction to confirm. Click on this notification to see transaction in the block explorer."
}
},
{
type: TYPE.INFO,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
}
);
const receipt = await tx.wait();
if (receipt.status === 1) {
this.toast.dismiss(toastWait);
this.toast("You have successfully bought a " + this.tld + " domain!", {
type: TYPE.SUCCESS,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
this.setContracts();
this.addDomainManually(fullDomainName);
this.waiting = false;
} else {
this.toast.dismiss(toastWait);
this.toast("Transaction has failed.", {
type: TYPE.ERROR,
onClick: () => window.open(this.getBlockExplorerBaseUrl+"/tx/"+tx.hash, '_blank').focus()
});
console.log(receipt);
this.waiting = false;
}
} catch (e) {
console.log(e)
this.waiting = false;
this.toast(e.message, {type: TYPE.ERROR});
}
this.waiting = false;
},
changeNetwork(nName) {
const networkData = this.switchNetwork(nName);
window.ethereum.request({
method: networkData.method,
params: networkData.params
});
},
async fetchPaymentTokenData() {
this.loading = true;
if (this.address) {
let payTokenAddr;
let mintAddr;
// match data to the chain ID
if (this.chainId === this.idMainnet) {
payTokenAddr = this.payTokenAddressMainnet;
mintAddr = this.mintAddressMainnet;
} else if (this.chainId === this.idTestnet) {
payTokenAddr = this.payTokenAddressTestnet;
mintAddr = this.mintAddressTestnet;
}
if (payTokenAddr) {
// pay token contract
const tokenIntfc = new ethers.utils.Interface(Erc20Abi);
this.payTokenContract = new ethers.Contract(payTokenAddr, tokenIntfc, this.signer);
const allowanceWei = await this.payTokenContract.allowance(this.address, mintAddr);
this.payTokenAllowance = ethers.utils.formatUnits(allowanceWei, this.payTokenDecimals);
console.log("payTokenAllowance: " + this.payTokenAllowance);
const balanceWei = await this.payTokenContract.balanceOf(this.address);
this.payTokenBalance = ethers.utils.formatUnits(balanceWei, this.payTokenDecimals);
console.log("payTokenBalance: " + this.payTokenBalance);
}
}
this.loading = false;
},
async setContracts() {
this.loading = true;
let fProvider;
let tldAddr;
let mintAddr;
let nftAddr;
let payTokenAddr;
// testnet data
if (this.networkName.includes("Testnet")) {
fProvider = this.getFallbackProvider(this.idTestnet);
tldAddr = this.tldAddressTestnet;
mintAddr = this.mintAddressTestnet;
nftAddr = this.nftAddressTestnet;
payTokenAddr = this.payTokenAddressTestnet;
this.tld = this.tldTestnet;
} else {
fProvider = this.getFallbackProvider(this.idMainnet);
tldAddr = this.tldAddressMainnet;
mintAddr = this.mintAddressMainnet;
nftAddr = this.nftAddressMainnet;
payTokenAddr = this.payTokenAddressMainnet;
this.tld = this.tldMainnet;
}
// match data to the chain ID
if (this.chainId === this.idMainnet) {
fProvider = this.getFallbackProvider(this.idMainnet);
tldAddr = this.tldAddressMainnet;
mintAddr = this.mintAddressMainnet;
nftAddr = this.nftAddressMainnet;
payTokenAddr = this.payTokenAddressMainnet;
this.tld = this.tldMainnet;
} else if (this.chainId === this.idTestnet) {
fProvider = this.getFallbackProvider(this.idTestnet);
tldAddr = this.tldAddressTestnet;
mintAddr = this.mintAddressTestnet;
nftAddr = this.nftAddressTestnet;
payTokenAddr = this.payTokenAddressTestnet;
this.tld = this.tldTestnet;
}
// tld contract
const tldIntfc = new ethers.utils.Interface(tldAbi);
this.tldContract = new ethers.Contract(tldAddr, tldIntfc, fProvider);
// minting contract
const mintIntfc = new ethers.utils.Interface(MinterAbi);
this.mintContract = new ethers.Contract(mintAddr, mintIntfc, fProvider);
const priceWei = await this.mintContract.price();
this.domainPrice = ethers.utils.formatUnits(priceWei, this.payTokenDecimals);
this.paused = await this.mintContract.paused();
this.loading = false;
if (this.address) {
this.fetchPaymentTokenData();
}
},
},
setup() {
const { open } = useBoard();
const { address, chainId, isActivated, signer } = useEthers();
const toast = useToast();
const { buyNotValidFlexi } = useDomainHelpers();
const { switchNetwork } = useChainHelpers();
return { address, buyNotValidFlexi, chainId, isActivated, open, signer, switchNetwork, toast }
},
watch: {
address() {
this.fetchPaymentTokenData();
},
chainId() {
this.setContracts();
},
}
}
</script>
<style scoped>
.and {
font-size: 1.7em;
vertical-align: bottom;
padding-left: 0.2em;
padding-right: 0.2em;
}
.buy-button {
margin-bottom: 50px;
}
.domain-input {
width: 50%;
}
.domain-input-container {
margin-top: 30px;
}
.error {
color: #DBDFEA;
}
.l2dao {
width: 50px;
}
.tld-addon {
background-color: white;
}
@media only screen and (max-width: 767px) {
.domain-input {
width: 100%;
}
}
</style>

@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": false,
"allowJs": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}

@ -0,0 +1,30 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
import inject from "@rollup/plugin-inject";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
svelte(),
inject({
util: "util/",
}),
],
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
// Enable esbuild polyfill plugins
plugins: [
NodeGlobalsPolyfillPlugin({
buffer: true,
}),
],
},
},
});
Loading…
Cancel
Save