refactor: change svg generation to match design and update how it is write/read in contract (#95)

* refactor: update contract with logo and color, add new svg styling

* refactor: fix color storaging

* test: fix tests for new app metadata

* test: fix solidity tests

* chore: update latest deployment files

* feat: update mint script and add assets files

* refactor: move assets files

* refactor: update svg generation styling

* feat: add library deployment storage

* test: fix contract tests

* feat: add setTokenLogo and setTokenColor contract functions

* test: add hardhat tests for new set functions

* test: add foundry tests for new set functions, split out constant strings to constants library

* chore: remove leftover comment

* feat: add setTokenLogoAndColor function

* test: add test for setTokenLogoAndColor function

* test: add test for setTokenLogoAndColor function on foundry
This commit is contained in:
Felipe Mendes 2023-01-31 14:12:48 -03:00 committed by GitHub
parent ce1a3fc141
commit 94e8ba3856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 8472 additions and 960 deletions

File diff suppressed because it is too large Load Diff

28
assets/aave.svg Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 400 571" style="enable-background:new 0 0 400 571;" xml:space="preserve">
<style type="text/css">
.st0{fill:url(#Path_7142_1_);}
.st1{fill:none;}
</style>
<linearGradient id="Path_7142_1_" gradientUnits="userSpaceOnUse" x1="-1780.1899" y1="261.5162" x2="-1772.7881" y2="266.5826" gradientTransform="matrix(54.82 0 0 -80.09 97585.5 21483)">
<stop offset="0" style="stop-color:#30BAC6"/>
<stop offset="1" style="stop-color:#B6509E"/>
</linearGradient>
<path id="Path_7142" class="st0" d="M389.4,193.5c-2-105-88.7-188.4-193.7-186.4C93.5,9,11.2,91.4,9.3,193.5c0,0.5-0.1,1-0.1,1.4
v2.9l0,0v343.7c0,11.7,9.5,21.1,21.1,21.1s21.1-9.5,21.1-21.1v-61.4c0-11.7,9.5-21.1,21.1-21.1s21.1,9.5,21.1,21.1l0,0v29.1
c0.3,11.7,9.9,20.9,21.6,20.7c11.3-0.2,20.4-9.4,20.7-20.7l0,0v-29.1c0-11.7,9.5-21.1,21.1-21.1l0,0c11.7,0,21.1,9.5,21.1,21.1v8
c0,11.7,9.5,21.1,21.1,21.1c11.7,0,21.1-9.5,21.1-21.1v-8c0.3-11.7,9.9-20.9,21.6-20.7c11.3,0.2,20.4,9.4,20.7,20.7v29.1
c0,11.7,9.5,21.1,21.1,21.1s21.3-9.3,21.3-21l0,0l0,0v-29.1c0-11.7,9.5-21.1,21.1-21.1l0,0c11.7,0,21.1,9.5,21.1,21.1v61.4
c0,11.7,9.5,21.1,21.1,21.1s21.1-9.5,21.1-21.1l0,0V195C389.5,194.5,389.5,194,389.4,193.5z M129.2,224c-18.7,0-33.8-17.3-33.8-38.8
s15.2-38.8,33.8-38.8s33.8,17.3,33.8,38.8S147.9,224,129.2,224L129.2,224z M200.8,278.8c-17,0-30.7-10.1-30.7-22.6
s13.8-4.9,30.7-4.9s30.7-7.5,30.7,4.9C231.5,268.6,217.8,278.7,200.8,278.8L200.8,278.8z M269.5,224c-18.7,0-33.8-17.3-33.8-38.8
s15.1-38.8,33.8-38.8s33.8,17.3,33.8,38.8S288.1,224,269.5,224L269.5,224z"/>
<g id="Group_13464">
<ellipse id="Ellipse_598" class="st1" cx="129.2" cy="185.2" rx="33.8" ry="38.8"/>
<path id="Path_7143" class="st1" d="M200.9,251.2c-17,0-30.7-7.5-30.7,4.9c0,12.4,13.8,22.6,30.7,22.6s30.7-10.1,30.7-22.6
S217.8,251.2,200.9,251.2z"/>
<ellipse id="Ellipse_599" class="st1" cx="269.5" cy="185.2" rx="33.8" ry="38.8"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

23
assets/dydx.svg Normal file
View File

@ -0,0 +1,23 @@
<svg width="363" height="113" viewBox="0 0 363 113" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M336.17 0L258 111.991H282L360.576 0H336.17Z" fill="white"/>
<path d="M284.5 0L307.5 33L295.5 51L260 0H284.5Z" fill="url(#paint0_linear)"/>
<path d="M338.5 112L313 75.5L325 58L362.5 112H338.5Z" fill="url(#paint1_linear)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M230 0H251V111.991H230V107.808C223.935 111.118 216.972 113 209.567 113C186.058 113 167 94.0281 167 70.625C167 47.2219 186.058 28.25 209.567 28.25C216.972 28.25 223.935 30.1321 230 33.4419V0ZM209.343 94.4018C222.658 94.4018 233.452 83.6566 233.452 70.4018C233.452 57.147 222.658 46.4018 209.343 46.4018C196.028 46.4018 185.234 57.147 185.234 70.4018C185.234 83.6566 196.028 94.4018 209.343 94.4018Z" fill="white"/>
<path d="M169.089 0L91 111.991H115.481L193.495 0H169.089Z" fill="white"/>
<path d="M115.5 0L140 34L126.5 53L90 0H115.5Z" fill="url(#paint2_linear)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M63 0H84V111.991H63V107.808C56.9349 111.118 49.9719 113 42.5673 113C19.058 113 0 94.0281 0 70.625C0 47.2219 19.058 28.25 42.5673 28.25C49.9719 28.25 56.9349 30.1321 63 33.4419V0ZM42.3431 94.4018C55.6581 94.4018 66.452 83.6566 66.452 70.4018C66.452 57.147 55.6581 46.4018 42.3431 46.4018C29.0281 46.4018 18.2342 57.147 18.2342 70.4018C18.2342 83.6566 29.0281 94.4018 42.3431 94.4018Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear" x1="279" y1="7" x2="311.925" y2="46.7483" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="white" stop-opacity="0.55"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="344" y1="103.5" x2="303.547" y2="48.965" gradientUnits="userSpaceOnUse">
<stop stop-color="#6966FF"/>
<stop offset="1" stop-color="#6966FF" stop-opacity="0.36"/>
</linearGradient>
<linearGradient id="paint2_linear" x1="110" y1="7.27451" x2="144.132" y2="49.0118" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="white" stop-opacity="0.55"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

64
assets/fleek.svg Normal file
View File

@ -0,0 +1,64 @@
<svg width="190" height="307" viewBox="0 0 190 307" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_405_242" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="190" height="307">
<path fill-rule="evenodd" clip-rule="evenodd" d="M185.723 0.562608C187.422 -1.06048 190.006 1.1527 188.677 3.09299L129.242 89.8622C128.306 91.2276 129.377 93.0695 131.021 92.9251L165.96 89.857C167.7 89.7042 168.749 91.7454 167.616 93.08L107.653 163.772C106.521 165.107 107.57 167.147 109.309 166.995L146.932 163.691C148.773 163.53 149.787 165.786 148.448 167.063L3.32123 305.671C1.62178 307.295 -0.96231 305.081 0.366724 303.141L60.5835 215.23C61.5188 213.865 60.4489 212.022 58.8045 212.167L23.118 215.301C21.3843 215.453 20.3335 213.425 21.4535 212.088L79.6533 142.605C80.7733 141.268 79.7225 139.238 77.9888 139.391L42.112 142.542C40.272 142.703 39.258 140.447 40.5961 139.17L185.723 0.562608Z" fill="black"/>
</mask>
<g mask="url(#mask0_405_242)">
<g filter="url(#filter0_bdiiiii_405_242)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M185.723 0.562608C187.422 -1.06048 190.006 1.1527 188.677 3.09299L129.242 89.8622C128.306 91.2276 129.377 93.0695 131.021 92.9251L165.96 89.857C167.7 89.7042 168.749 91.7454 167.616 93.08L107.653 163.772C106.521 165.107 107.57 167.147 109.309 166.995L146.932 163.691C148.773 163.53 149.787 165.786 148.448 167.063L3.32123 305.671C1.62178 307.295 -0.96231 305.081 0.366724 303.141L60.5835 215.23C61.5188 213.865 60.4489 212.022 58.8045 212.167L23.118 215.301C21.3843 215.453 20.3335 213.425 21.4535 212.088L79.6533 142.605C80.7733 141.268 79.7225 139.238 77.9888 139.391L42.112 142.542C40.272 142.703 39.258 140.447 40.5961 139.17L185.723 0.562608Z" fill="black"/>
</g>
<g style="mix-blend-mode:overlay">
<rect x="-5.9873" y="-6.84302" width="205.297" height="317.354" fill="url(#paint0_linear_405_242)"/>
</g>
</g>
<defs>
<filter id="filter0_bdiiiii_405_242" x="-84.6094" y="-84.6094" width="358.263" height="475.453" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feGaussianBlur in="BackgroundImageFix" stdDeviation="42.3047"/>
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_405_242"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="8.46094"/>
<feGaussianBlur stdDeviation="21.1523"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
<feBlend mode="normal" in2="effect1_backgroundBlur_405_242" result="effect2_dropShadow_405_242"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_405_242" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="8.46094"/>
<feGaussianBlur stdDeviation="12.6914"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.4 0"/>
<feBlend mode="normal" in2="shape" result="effect3_innerShadow_405_242"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="-84.6094"/>
<feGaussianBlur stdDeviation="42.3047"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
<feBlend mode="normal" in2="effect3_innerShadow_405_242" result="effect4_innerShadow_405_242"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="-8.46094"/>
<feGaussianBlur stdDeviation="4.23047"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="effect4_innerShadow_405_242" result="effect5_innerShadow_405_242"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="42.3047"/>
<feGaussianBlur stdDeviation="42.3047"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="effect5_innerShadow_405_242" result="effect6_innerShadow_405_242"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="2.11523"/>
<feGaussianBlur stdDeviation="2.11523"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.8 0"/>
<feBlend mode="normal" in2="effect6_innerShadow_405_242" result="effect7_innerShadow_405_242"/>
</filter>
<linearGradient id="paint0_linear_405_242" x1="115.907" y1="25.2346" x2="53.0354" y2="288.271" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFE702"/>
<stop offset="0.333333" stop-color="#FF3DCF"/>
<stop offset="0.661458" stop-color="#36DCFF"/>
<stop offset="0.854167" stop-color="#49F0A1"/>
<stop offset="1" stop-color="#58FF5A"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

1
assets/html.svg Normal file
View File

@ -0,0 +1 @@
<svg fill="none" height="2500" width="2183" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 124 141.53199999999998"><path d="M10.383 126.894L0 0l124 .255-10.979 126.639-50.553 14.638z" fill="#e34f26"/><path d="M62.468 129.277V12.085l51.064.17-9.106 104.851z" fill="#ef652a"/><path d="M99.49 41.362l1.446-15.49H22.383l4.34 47.49h54.213L78.81 93.617l-17.362 4.68-17.617-5.106-.936-12.085H27.319l2.128 24.681 32 8.936 32.255-8.936 4.34-48.17H41.107L39.49 41.362z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 480 B

107
assets/model.svg Normal file
View File

@ -0,0 +1,107 @@
<svg width="1065" height="1065" viewBox="0 0 1065 1065" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="1065" height="1065" fill="url(#background)" />
<rect opacity="0.2" width="1065" height="1065" fill="url(#background-radial)" />
<!-- Shadow -->
<g filter="url(#diskette-shadow)">
<path
d="M857.231 279.712L902.24 286.675C910.547 287.96 917.915 292.721 922.5 299.768L938.894 324.964C942.249 330.12 943.311 336.437 941.827 342.406L937.798 358.615L924.049 356.65L919.416 374.084L934.068 376.24L791.947 922.152C788.109 936.896 773.694 946.308 758.651 943.893L179.636 850.928C162.318 848.147 151.215 830.987 155.776 814.051L160.478 796.59L704.315 879.574L857.231 279.712Z"
fill="#050505" />
</g>
<path
d="M840.231 240.712L885.24 247.675C893.547 248.961 900.915 253.722 905.5 260.768L921.894 285.965C925.249 291.12 926.311 297.437 924.827 303.406L920.798 319.616L907.049 317.65L902.416 335.084L917.068 337.241L774.947 883.152C771.109 897.896 756.694 907.308 741.651 904.893L162.636 811.928C145.318 809.147 134.215 791.987 138.776 775.051L143.478 757.59L687.315 840.574L840.231 240.712Z"
fill="url(#main)" />
<!-- /Shadow -->
<!-- Diskette Fill -->
<path fill-rule="evenodd" clip-rule="evenodd"
d="M319.847 161.502C310.356 160.007 300.674 166.326 298.221 175.616L138.724 779.758C136.271 789.048 141.977 797.79 151.468 799.285L740.061 891.973C749.553 893.467 759.235 887.148 761.687 877.858L902.405 344.854L889.158 342.768L898.872 305.972L912.119 308.059L913.733 301.946C914.837 297.762 914.309 293.476 912.251 289.927L893.484 257.569C891.153 253.549 887.063 250.823 882.221 250.061L828.205 241.554C822.224 240.613 815.869 242.783 811.427 247.284L805.686 253.103C804.205 254.603 802.087 255.326 800.093 255.013L783.611 252.417L734.3 439.196C731.439 450.035 720.143 457.407 709.07 455.663L328.847 395.788C317.774 394.045 311.117 383.845 313.978 373.007L366.528 173.962L366.533 173.941C367.234 171.24 365.572 168.702 362.81 168.267L319.847 161.502ZM369.392 174.414L368.652 177.217L316.843 373.458C314.39 382.748 320.096 391.49 329.587 392.985L709.81 452.86C719.301 454.354 728.983 448.035 731.436 438.745L780.747 251.966L783.245 242.504L783.985 239.701L369.392 174.414Z"
fill="#131316" />
<path fill-rule="evenodd" clip-rule="evenodd" stroke="url(#main)" stroke-width="4"
stroke-linecap="round" stroke-linejoin="round"
d="M319.847 161.502C310.356 160.007 300.674 166.326 298.221 175.616L138.724 779.758C136.271 789.048 141.977 797.79 151.468 799.285L740.061 891.973C749.553 893.467 759.235 887.148 761.687 877.858L902.405 344.854L889.158 342.768L898.872 305.972L912.119 308.059L913.733 301.946C914.837 297.762 914.309 293.476 912.251 289.927L893.484 257.569C891.153 253.549 887.063 250.823 882.221 250.061L828.205 241.554C822.224 240.613 815.869 242.783 811.427 247.284L805.686 253.103C804.205 254.603 802.087 255.326 800.093 255.013L783.611 252.417L734.3 439.196C731.439 450.035 720.143 457.407 709.07 455.663L328.847 395.788C317.774 394.045 311.117 383.845 313.978 373.007L366.528 173.962L366.533 173.941C367.234 171.24 365.572 168.702 362.81 168.267L319.847 161.502ZM369.392 174.414L368.652 177.217L316.843 373.458C314.39 382.748 320.096 391.49 329.587 392.985L709.81 452.86C719.301 454.354 728.983 448.035 731.436 438.745L780.747 251.966L783.245 242.504L783.985 239.701L369.392 174.414Z"
fill="url(#diskette-gradient)" fill-opacity="0.2" />
<!-- /Diskette Fill -->
<!-- Arrows -->
<path
d="M335.38 208.113C335.922 208.198 336.417 207.686 336.283 207.179L330.39 184.795C330.249 184.261 329.529 184.148 329.129 184.597L312.358 203.411C311.978 203.838 312.174 204.458 312.716 204.544L317.962 205.37C318.357 205.432 318.595 205.796 318.493 206.183L314.7 220.551C314.597 220.938 314.835 221.302 315.231 221.364L324.539 222.83C324.935 222.893 325.338 222.629 325.44 222.242L329.233 207.875C329.336 207.488 329.739 207.224 330.135 207.286L335.38 208.113Z"
fill="url(#main)" />
<path
d="M319.282 269.087C319.824 269.173 320.319 268.661 320.186 268.154L314.292 245.77C314.151 245.236 313.431 245.123 313.031 245.572L296.261 264.386C295.88 264.812 296.076 265.433 296.618 265.518L301.864 266.344C302.259 266.407 302.497 266.771 302.395 267.158L298.602 281.526C298.5 281.913 298.737 282.277 299.133 282.339L308.441 283.805C308.837 283.867 309.24 283.604 309.343 283.217L313.136 268.849C313.238 268.462 313.641 268.199 314.037 268.261L319.282 269.087Z"
fill="black" fill-opacity="0.5" />
<path
d="M303.184 330.062C303.726 330.148 304.221 329.636 304.088 329.128L298.194 306.745C298.053 306.211 297.333 306.098 296.933 306.547L280.163 325.361C279.782 325.787 279.979 326.408 280.52 326.493L285.766 327.319C286.161 327.382 286.399 327.746 286.297 328.133L282.504 342.501C282.402 342.888 282.639 343.252 283.035 343.314L292.344 344.78C292.739 344.842 293.142 344.579 293.245 344.192L297.038 329.824C297.14 329.437 297.543 329.174 297.939 329.236L303.184 330.062Z"
fill="black" fill-opacity="0.5" />
<!-- /Arrows -->
<!-- Diskette Body -->
<path stroke="url(#main)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"
d="M290.109 463.418C292.358 454.902 301.233 449.11 309.933 450.48L771.07 523.096C779.77 524.467 785 532.48 782.752 540.996L692.086 884.418L199.443 806.84L290.109 463.418Z"
fill="black" fill-opacity="0.14" />
<!-- /Diskette Body -->
<!-- Diskette Slider -->
<path fill-rule="evenodd" clip-rule="evenodd" stroke="url(#main)" stroke-width="6"
stroke-linecap="round" stroke-linejoin="round"
d="M787.589 237.349L460.354 185.818L406.325 390.469C403.872 399.759 409.578 408.501 419.069 409.996L711.934 456.114C721.425 457.609 731.107 451.29 733.56 442L787.589 237.349ZM660.269 245.01C655.523 244.263 650.682 247.423 649.456 252.068L607.386 411.418C606.16 416.063 609.013 420.434 613.759 421.181L682.499 432.006C687.245 432.753 692.086 429.594 693.312 424.949L735.382 265.599C736.608 260.954 733.755 256.583 729.01 255.835L660.269 245.01Z"
fill="url(#main)" />
<!-- /Diskette Slider -->
<!-- Fleek Logo -->
<path fill-rule="evenodd" clip-rule="evenodd"
d="M864.643 283.937C865.186 283.605 865.708 284.257 865.239 284.683L844.268 303.719C843.938 304.018 844.093 304.517 844.526 304.548L853.726 305.207C854.184 305.24 854.321 305.787 853.942 306.071L833.884 321.112C833.506 321.396 833.643 321.943 834.101 321.976L844.007 322.685C844.491 322.72 844.605 323.319 844.177 323.58L797.752 351.954C797.209 352.286 796.687 351.634 797.156 351.209L818.403 331.922C818.733 331.622 818.577 331.123 818.145 331.092L808.748 330.42C808.292 330.387 808.154 329.843 808.529 329.558L828.054 314.744C828.43 314.459 828.291 313.915 827.835 313.882L818.389 313.206C817.904 313.171 817.79 312.572 818.218 312.311L864.643 283.937Z"
fill="white" />
<!-- /Fleek Logo -->
<!-- Text -->
<g transform="matrix(0.987827 0.155557 -0.255261 0.966872 250 735)">
<text font-family="Inter, sans-serif" font-weight="bold" font-size="42" fill="#E5E7F8">HTML5 App</text>
<text font-family="Inter, sans-serif" font-weight="normal" y="40" font-size="22" fill="#7F8192">
html.eth</text>
</g>
<!-- /Text -->
<!-- Image -->
<image width="167" height="167"
transform="matrix(0.987827 0.155557 -0.255261 0.966872 444.117 524.17)"
href="data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI1MDAiIHdpZHRoPSIyMTgzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjQgMTQxLjUzMTk5OTk5OTk5OTk4Ij48cGF0aCBkPSJNMTAuMzgzIDEyNi44OTRMMCAwbDEyNCAuMjU1LTEwLjk3OSAxMjYuNjM5LTUwLjU1MyAxNC42Mzh6IiBmaWxsPSIjZTM0ZjI2Ii8+PHBhdGggZD0iTTYyLjQ2OCAxMjkuMjc3VjEyLjA4NWw1MS4wNjQuMTctOS4xMDYgMTA0Ljg1MXoiIGZpbGw9IiNlZjY1MmEiLz48cGF0aCBkPSJNOTkuNDkgNDEuMzYybDEuNDQ2LTE1LjQ5SDIyLjM4M2w0LjM0IDQ3LjQ5aDU0LjIxM0w3OC44MSA5My42MTdsLTE3LjM2MiA0LjY4LTE3LjYxNy01LjEwNi0uOTM2LTEyLjA4NUgyNy4zMTlsMi4xMjggMjQuNjgxIDMyIDguOTM2IDMyLjI1NS04LjkzNiA0LjM0LTQ4LjE3SDQxLjEwN0wzOS40OSA0MS4zNjJ6IiBmaWxsPSIjZmZmIi8+PC9zdmc+" />
<!-- /Image -->
<defs>
<filter id="diskette-shadow" x="70.7489" y="195.712" width="955.733" height="832.558"
filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" />
<feBlend in="SourceGraphic" />
<feGaussianBlur stdDeviation="42" />
</filter>
<linearGradient id="background" x1="532.5" y1="0" x2="532.5" y2="1065"
gradientUnits="userSpaceOnUse">
<stop />
<stop offset="1" stop-color="#131313" />
</linearGradient>
<radialGradient id="background-radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse"
gradientTransform="translate(532.5 532.5) rotate(89.961) scale(735)">
<stop stop-color="#e65226" />
<stop offset="1" stop-color="#e65226" stop-opacity="0" />
</radialGradient>
<linearGradient id="diskette-gradient" x1="925.626" y1="256.896" x2="136.779" y2="800.203"
gradientUnits="userSpaceOnUse">
<stop stop-color="#e65226" />
<stop offset="1" stop-color="#2C313F" />
</linearGradient>
<linearGradient id="main">
<stop stop-color="#e65226" />
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 9.1 KiB

14
assets/pancakeswap.svg Normal file
View File

@ -0,0 +1,14 @@
<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="48" cy="48" r="48" fill="url(#paint0_linear_10493:36952)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M47.8581 79.8749C38.5164 79.8678 30.9915 77.6262 25.7338 73.5999C20.413 69.5252 17.5903 63.7429 17.5903 57.2001C17.5903 50.8957 20.4068 46.3497 23.5936 43.2769C26.0911 40.8688 28.8471 39.3265 30.7661 38.4394C30.3322 37.1076 29.7907 35.364 29.3063 33.5632C28.6582 31.1534 28.0223 28.3261 28.0223 26.2543C28.0223 23.802 28.557 21.3392 29.9986 19.4255C31.5217 17.4037 33.8146 16.3206 36.5731 16.3206C38.7289 16.3206 40.5593 17.1202 41.9922 18.4998C43.3619 19.8184 44.2735 21.5697 44.9029 23.3952C46.0089 26.6029 46.4396 30.633 46.5604 34.6548H49.2026C49.3234 30.633 49.754 26.6029 50.8601 23.3952C51.4895 21.5697 52.4011 19.8184 53.7708 18.4998C55.2037 17.1202 57.034 16.3206 59.1899 16.3206C61.9484 16.3206 64.2413 17.4037 65.7644 19.4255C67.206 21.3392 67.7407 23.802 67.7407 26.2543C67.7407 28.3261 67.1048 31.1534 66.4566 33.5632C65.9722 35.364 65.4308 37.1076 64.9968 38.4394C66.9159 39.3265 69.6719 40.8688 72.1693 43.2769C75.3562 46.3497 78.1726 50.8957 78.1726 57.2001C78.1726 63.7429 75.35 69.5252 70.0292 73.5999C64.7715 77.6262 57.2466 79.8678 47.9049 79.8749H47.8581Z" fill="#633001"/>
<path d="M36.573 18.6528C32.5327 18.6528 30.6729 21.6977 30.6729 25.9088C30.6729 29.2559 32.8339 35.9594 33.7205 38.569C33.9199 39.1559 33.6065 39.799 33.0351 40.0266C29.797 41.3164 20.241 46.039 20.241 56.8546C20.241 68.2477 29.952 76.838 47.86 76.8516C47.8671 76.8516 47.8742 76.8516 47.8814 76.8516C47.8885 76.8516 47.8956 76.8516 47.9028 76.8516C65.8107 76.838 75.5218 68.2477 75.5218 56.8546C75.5218 46.039 65.9658 41.3164 62.7277 40.0266C62.1562 39.799 61.8429 39.1559 62.0423 38.569C62.9289 35.9594 65.0898 29.2559 65.0898 25.9088C65.0898 21.6977 63.23 18.6528 59.1898 18.6528C53.374 18.6528 51.9243 26.9751 51.8209 35.907C51.814 36.5033 51.3368 36.9871 50.7465 36.9871H45.0163C44.4259 36.9871 43.9488 36.5033 43.9419 35.907C43.8385 26.9751 42.3887 18.6528 36.573 18.6528Z" fill="#D1884F"/>
<path d="M47.9028 73.202C34.7449 73.202 20.2637 66.0868 20.241 56.8762C20.241 56.8906 20.241 56.905 20.241 56.9193C20.241 68.3216 29.9675 76.9164 47.9028 76.9164C65.838 76.9164 75.5645 68.3216 75.5645 56.9193C75.5645 56.905 75.5645 56.8906 75.5645 56.8762C75.5418 66.0868 61.0607 73.202 47.9028 73.202Z" fill="#FEDC90"/>
<path d="M40.5919 54.0472C40.5919 57.1569 39.1371 58.7765 37.3426 58.7765C35.548 58.7765 34.0933 57.1569 34.0933 54.0472C34.0933 50.9375 35.548 49.3179 37.3426 49.3179C39.1371 49.3179 40.5919 50.9375 40.5919 54.0472Z" fill="#633001"/>
<path d="M61.7122 54.0472C61.7122 57.1569 60.2575 58.7765 58.4629 58.7765C56.6684 58.7765 55.2136 57.1569 55.2136 54.0472C55.2136 50.9375 56.6684 49.3179 58.4629 49.3179C60.2575 49.3179 61.7122 50.9375 61.7122 54.0472Z" fill="#633001"/>
<defs>
<linearGradient id="paint0_linear_10493:36952" x1="48" y1="0" x2="48" y2="96" gradientUnits="userSpaceOnUse">
<stop stop-color="#53DEE9"/>
<stop offset="1" stop-color="#1FC7D4"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

619
assets/psych.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 362 KiB

48
assets/uniswap.svg Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 168.3 193.8" style="enable-background:new 0 0 168.3 193.8;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FF007A;}
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FF007A;}
</style>
<path class="st0" d="M66,44.1c-2.1-0.3-2.2-0.4-1.2-0.5c1.9-0.3,6.3,0.1,9.4,0.8c7.2,1.7,13.7,6.1,20.6,13.8l1.8,2.1l2.6-0.4
c11.1-1.8,22.5-0.4,32,4c2.6,1.2,6.7,3.6,7.2,4.2c0.2,0.2,0.5,1.5,0.7,2.8c0.7,4.7,0.4,8.2-1.1,10.9c-0.8,1.5-0.8,1.9-0.3,3.2
c0.4,1,1.6,1.7,2.7,1.7c2.4,0,4.9-3.8,6.1-9.1l0.5-2.1l0.9,1c5.1,5.7,9.1,13.6,9.7,19.2l0.2,1.5l-0.9-1.3c-1.5-2.3-2.9-3.8-4.8-5.1
c-3.4-2.3-7-3-16.5-3.5c-8.6-0.5-13.5-1.2-18.3-2.8c-8.2-2.7-12.4-6.2-22.1-19.1c-4.3-5.7-7-8.8-9.7-11.4
C79.6,48.3,73.7,45.3,66,44.1z"/>
<path class="st0" d="M140.5,56.8c0.2-3.8,0.7-6.3,1.8-8.6c0.4-0.9,0.8-1.7,0.9-1.7c0.1,0-0.1,0.7-0.4,1.5c-0.8,2.2-0.9,5.3-0.4,8.8
c0.7,4.5,1,5.1,5.8,10c2.2,2.3,4.8,5.2,5.8,6.4l1.7,2.2l-1.7-1.6c-2.1-2-6.9-5.8-8-6.3c-0.7-0.4-0.8-0.4-1.3,0.1
c-0.4,0.4-0.5,1-0.5,3.9c-0.1,4.5-0.7,7.3-2.2,10.2c-0.8,1.5-0.9,1.2-0.2-0.5c0.5-1.3,0.6-1.9,0.6-6.2c0-8.7-1-10.8-7.1-14.3
c-1.5-0.9-4.1-2.2-5.6-2.9c-1.6-0.7-2.8-1.3-2.7-1.3c0.2-0.2,6.1,1.5,8.4,2.5c3.5,1.4,4.1,1.5,4.5,1.4
C140.2,60.1,140.4,59.3,140.5,56.8z"/>
<path class="st0" d="M70.1,71.7c-4.2-5.8-6.9-14.8-6.3-21.5l0.2-2.1l1,0.2c1.8,0.3,4.9,1.5,6.4,2.4c4,2.4,5.8,5.7,7.5,13.9
c0.5,2.4,1.2,5.2,1.5,6.1c0.5,1.5,2.4,5,4,7.2c1.1,1.6,0.4,2.4-2.1,2.2C78.5,79.7,73.4,76.2,70.1,71.7z"/>
<path class="st0" d="M135.4,115.2c-19.8-8-26.8-14.9-26.8-26.6c0-1.7,0.1-3.1,0.1-3.1c0.1,0,0.8,0.6,1.7,1.3c4,3.2,8.5,4.6,21,6.4
c7.3,1.1,11.5,1.9,15.3,3.2c12.1,4,19.6,12.2,21.4,23.3c0.5,3.2,0.2,9.3-0.6,12.5c-0.7,2.5-2.7,7.1-3.2,7.2c-0.1,0-0.3-0.5-0.3-1.3
c-0.2-4.2-2.3-8.2-5.8-11.3C154,123.2,148.6,120.5,135.4,115.2z"/>
<path class="st0" d="M121.4,118.5c-0.2-1.5-0.7-3.4-1-4.2l-0.5-1.5l0.9,1.1c1.3,1.5,2.3,3.3,3.2,5.8c0.7,1.9,0.7,2.5,0.7,5.6
c0,3-0.1,3.7-0.7,5.4c-1,2.7-2.2,4.6-4.2,6.7c-3.6,3.7-8.3,5.7-15,6.6c-1.2,0.1-4.6,0.4-7.6,0.6c-7.5,0.4-12.5,1.2-17,2.8
c-0.6,0.2-1.2,0.4-1.3,0.3c-0.2-0.2,2.9-2,5.4-3.2c3.5-1.7,7.1-2.6,15-4c3.9-0.6,7.9-1.4,8.9-1.8C118.1,135.6,123,127.9,121.4,118.5
z"/>
<path class="st0" d="M130.5,134.6c-2.6-5.7-3.2-11.1-1.8-16.2c0.2-0.5,0.4-1,0.6-1c0.2,0,0.8,0.3,1.4,0.7c1.2,0.8,3.7,2.2,10.1,5.7
c8.1,4.4,12.7,7.8,15.9,11.7c2.8,3.4,4.5,7.3,5.3,12.1c0.5,2.7,0.2,9.2-0.5,11.9c-2.2,8.5-7.2,15.3-14.5,19.2c-1.1,0.6-2,1-2.1,1
c-0.1,0,0.3-1,0.9-2.2c2.4-5.1,2.7-10,0.9-15.5c-1.1-3.4-3.4-7.5-8-14.4C133.2,139.6,131.9,137.5,130.5,134.6z"/>
<path class="st0" d="M56,165.2c7.4-6.2,16.5-10.6,24.9-12c3.6-0.6,9.6-0.4,12.9,0.5c5.3,1.4,10.1,4.4,12.6,8.1
c2.4,3.6,3.5,6.7,4.6,13.6c0.4,2.7,0.9,5.5,1,6.1c0.8,3.6,2.4,6.4,4.4,7.9c3.1,2.3,8.5,2.4,13.8,0.4c0.9-0.3,1.7-0.6,1.7-0.5
c0.2,0.2-2.5,2-4.3,2.9c-2.5,1.3-4.5,1.7-7.2,1.7c-4.8,0-8.9-2.5-12.2-7.5c-0.7-1-2.1-3.9-3.3-6.6c-3.5-8.1-5.3-10.5-9.4-13.2
c-3.6-2.3-8.2-2.8-11.7-1.1c-4.6,2.2-5.8,8.1-2.6,11.7c1.3,1.5,3.7,2.7,5.7,3c3.7,0.5,6.9-2.4,6.9-6.1c0-2.4-0.9-3.8-3.3-4.9
c-3.2-1.4-6.7,0.2-6.6,3.3c0,1.3,0.6,2.1,1.9,2.7c0.8,0.4,0.8,0.4,0.2,0.3c-2.9-0.6-3.6-4.2-1.3-6.5c2.8-2.8,8.7-1.6,10.7,2.3
c0.8,1.6,0.9,4.8,0.2,6.8c-1.7,4.4-6.5,6.7-11.4,5.4c-3.3-0.9-4.7-1.8-8.7-5.9c-7-7.2-9.7-8.6-19.7-10.1l-1.9-0.3L56,165.2z"/>
<path class="st1" d="M3.4,4.3c23.3,28.3,59.2,72.3,61,74.7c1.5,2,0.9,3.9-1.6,5.3c-1.4,0.8-4.3,1.6-5.7,1.6c-1.6,0-3.5-0.8-4.8-2.1
c-0.9-0.9-4.8-6.6-13.6-20.3c-6.7-10.5-12.4-19.2-12.5-19.3C25.8,44,25.8,44,38,65.8C45.7,79.5,48.2,84.4,48.2,85c0,1.3-0.4,2-2,3.8
c-2.7,3-3.9,6.4-4.8,13.5c-1,7.9-3.7,13.5-11.4,23c-4.5,5.6-5.2,6.6-6.3,8.9c-1.4,2.8-1.8,4.4-2,8c-0.2,3.8,0.2,6.2,1.3,9.8
c1,3.2,2.1,5.3,4.8,9.4c2.3,3.6,3.7,6.3,3.7,7.3c0,0.8,0.2,0.8,3.8,0c8.6-2,15.7-5.4,19.6-9.6c2.4-2.6,3-4,3-7.6
c0-2.3-0.1-2.8-0.7-4.2c-1-2.2-2.9-4-7-6.8c-5.4-3.7-7.7-6.7-8.3-10.7c-0.5-3.4,0.1-5.7,3.1-12c3.1-6.5,3.9-9.2,4.4-15.8
c0.3-4.2,0.8-5.9,2-7.2c1.3-1.4,2.4-1.9,5.5-2.3c5.1-0.7,8.4-2,11-4.5c2.3-2.1,3.3-4.2,3.4-7.3l0.1-2.3L70.1,77C65.4,71.6,0.3,0,0,0
C-0.1,0,1.5,1.9,3.4,4.3z M34.1,146.5c1.1-1.9,0.5-4.3-1.3-5.5c-1.7-1.1-4.3-0.6-4.3,0.9c0,0.4,0.2,0.8,0.8,1c0.9,0.5,1,1,0.3,2.1
c-0.7,1.1-0.7,2.1,0.2,2.8C31.2,148.9,33.1,148.3,34.1,146.5z"/>
<path class="st1" d="M74.6,93.9c-2.4,0.7-4.7,3.3-5.4,5.9c-0.4,1.6-0.2,4.5,0.5,5.4c1.1,1.4,2.1,1.8,4.9,1.8
c5.5,0,10.2-2.4,10.7-5.3c0.5-2.4-1.6-5.7-4.5-7.2C79.3,93.7,76.2,93.4,74.6,93.9z M81,98.9c0.8-1.2,0.5-2.5-1-3.4
c-2.7-1.7-6.8-0.3-6.8,2.3c0,1.3,2.1,2.7,4.1,2.7C78.6,100.5,80.4,99.7,81,98.9z"/>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

23
assets/yearn.svg Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_1_);}
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
</style>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="0" y1="99.8898" x2="100" y2="-0.1102" gradientTransform="matrix(1 0 0 -1 0 99.8898)">
<stop offset="0" style="stop-color:#0077FC"/>
<stop offset="1" style="stop-color:#095EB5"/>
</linearGradient>
<path class="st0" d="M100,50c0-6.5-1.3-13.1-3.8-19.1S90,19.3,85.4,14.6C80.7,10,75.2,6.3,69.1,3.8S56.5,0,50,0S36.9,1.3,30.9,3.8
S19.3,10,14.6,14.6C10,19.3,6.3,24.8,3.8,30.9S0,43.5,0,50s1.3,13.1,3.8,19.1S10,80.7,14.6,85.4c4.6,4.6,10.2,8.3,16.2,10.8
S43.5,100,50,100s13.1-1.3,19.1-3.8S80.7,90,85.4,85.4c4.6-4.6,8.3-10.2,10.8-16.2S100,56.5,100,50z"/>
<path class="st1" d="M47.4,27.4h5.2v45.2h-5.2V27.4z"/>
<path class="st1" d="M44.5,48.7v-5.4c-4.1-2-7-6.3-7-11.2c0-6.9,5.6-12.5,12.5-12.5c7.8,0,13.4,5.6,13.4,12.5c0,1.7-0.4,3.4-1.2,5.4
l-2.2-7.2l-4.4,1.4l3.9,14.9l15.2-5.6l-1.9-4.4l-5.7,1.9c1-2.2,1.2-3.9,1.2-6.5c0-9.7-7.8-17.5-18.4-17.5c-9.7,0-17.5,7.8-17.5,17.5
C32.5,39.8,37.5,46.4,44.5,48.7z"/>
<path class="st1" d="M55.5,51.3v5.4c4.1,2,7,6.3,7,11.2c0,6.9-5.6,12.5-12.5,12.5c-7.8,0-13.4-5.6-13.4-12.5c0-1.7,0.4-3.4,1.2-5.4
l2.2,7.2l4.4-1.4l-3.9-14.9l-15.2,5.6l1.9,4.4l5.7-1.9c-1,2.2-1.2,3.9-1.2,6.5c0,9.7,7.8,17.5,18.4,17.5c9.7,0,17.5-7.8,17.5-17.5
C67.5,60.2,62.5,53.6,55.5,51.3z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -19,9 +19,10 @@ contract FleekERC721 is Initializable, ERC721Upgradeable, FleekAccessControl {
event NewBuild(uint256 indexed token, string indexed commitHash, address indexed triggeredBy);
event NewTokenName(uint256 indexed token, string indexed name, address indexed triggeredBy);
event NewTokenDescription(uint256 indexed token, string indexed description, address indexed triggeredBy);
event NewTokenImage(uint256 indexed token, string indexed image, address indexed triggeredBy);
event NewTokenLogo(uint256 indexed token, string indexed image, address indexed triggeredBy);
event NewTokenExternalURL(uint256 indexed token, string indexed externalURL, address indexed triggeredBy);
event NewTokenENS(uint256 indexed token, string indexed ENS, address indexed triggeredBy);
event NewTokenColor(uint256 indexed token, uint24 indexed color, address indexed triggeredBy);
event NewAccessPoint(string indexed apName, uint256 indexed tokenId, address indexed owner);
event RemoveAccessPoint(string indexed apName, uint256 indexed tokenId, address indexed owner);
@ -57,6 +58,8 @@ contract FleekERC721 is Initializable, ERC721Upgradeable, FleekAccessControl {
uint256 currentBuild; // The current build number (Increments by one with each change, starts at zero)
mapping(uint256 => Build) builds; // Mapping to build details for each build number
string[] accessPoints; // List of app AccessPoint
string logo;
uint24 color; // Color of the nft
}
/**
@ -116,7 +119,9 @@ contract FleekERC721 is Initializable, ERC721Upgradeable, FleekAccessControl {
string memory externalURL,
string memory ENS,
string memory commitHash,
string memory gitRepository
string memory gitRepository,
string memory logo,
uint24 color
) public payable requireCollectionRole(Roles.Owner) returns (uint256) {
uint256 tokenId = _appIds.current();
_mint(to, tokenId);
@ -127,6 +132,8 @@ contract FleekERC721 is Initializable, ERC721Upgradeable, FleekAccessControl {
app.description = description;
app.externalURL = externalURL;
app.ENS = ENS;
app.logo = logo;
app.color = color;
// The mint interaction is considered to be the first build of the site. Updates from now on all increment the currentBuild by one and update the mapping.
app.currentBuild = 0;
@ -271,6 +278,62 @@ contract FleekERC721 is Initializable, ERC721Upgradeable, FleekAccessControl {
emit NewTokenDescription(tokenId, _tokenDescription, msg.sender);
}
/**
* @dev Updates the `logo` metadata field of a minted `tokenId`.
*
* May emit a {NewTokenLogo} event.
*
* Requirements:
*
* - the tokenId must be minted and valid.
* - the sender must have the `tokenController` role.
*
*/
function setTokenLogo(
uint256 tokenId,
string memory _tokenLogo
) public virtual requireTokenRole(tokenId, Roles.Controller) {
_requireMinted(tokenId);
_apps[tokenId].logo = _tokenLogo;
emit NewTokenLogo(tokenId, _tokenLogo, msg.sender);
}
/**
* @dev Updates the `color` metadata field of a minted `tokenId`.
*
* May emit a {NewTokenColor} event.
*
* Requirements:
*
* - the tokenId must be minted and valid.
* - the sender must have the `tokenController` role.
*
*/
function setTokenColor(
uint256 tokenId,
uint24 _tokenColor
) public virtual requireTokenRole(tokenId, Roles.Controller) {
_requireMinted(tokenId);
_apps[tokenId].color = _tokenColor;
emit NewTokenColor(tokenId, _tokenColor, msg.sender);
}
/**
* @dev Updates the `logo` and `color` metadata fields of a minted `tokenId`.
*
* May emit a {NewTokenLogo} and a {NewTokenColor} event.
*
* Requirements:
*
* - the tokenId must be minted and valid.
* - the sender must have the `tokenController` role.
*
*/
function setTokenLogoAndColor(uint256 tokenId, string memory _tokenLogo, uint24 _tokenColor) public virtual {
setTokenLogo(tokenId, _tokenLogo);
setTokenColor(tokenId, _tokenColor);
}
/**
* @dev Add a new AccessPoint register for an app token.
* The AP name should be a DNS or ENS url and it should be unique.

View File

@ -10,29 +10,69 @@ library FleekSVG {
/**
* @dev Generates a SVG image.
*/
function generateBase64(string memory name, string memory ENS) internal pure returns (string memory) {
function generateBase64(
string memory name,
string memory ENS,
string memory logo,
string memory color
) public pure returns (string memory) {
return (
string(
abi.encodePacked(
"data:application/json;base64,",
"data:image/svg+xml;base64,",
Base64.encode(
abi.encodePacked(
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="640" height="480" viewBox="0 0 640 480" xml:space="preserve">',
"<defs>",
"</defs>",
'<g transform="matrix(3.42 0 0 3.42 300.98 252.98)" >',
'<polygon style="stroke: rgb(0,0,0); stroke-width: 8; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(152,152,183); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" points="-50,-50 -50,50 50,50 50,-50 " />',
"</g>",
'<g transform="matrix(1 0 0 1 303.5 115.67)" style="" >',
'<text xml:space="preserve" font-family="Open Sans" font-size="24" font-style="normal" font-weight="normal" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" ><tspan x="-45.7" y="5.65" style="stroke-width: 1; font-family: "Open Sans", sans-serif; font-size: 18px; font-style: normal; font-weight: normal; fill: rgb(0,0,0); ">Fleek NFAs</tspan></text>',
"</g>",
'<g transform="matrix(1 0 0 1 302 261.47)" style="" >',
'<text xml:space="preserve" font-family="Open Sans" font-size="28" font-style="normal" font-weight="normal" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;" ><tspan x="-44.26" y="-6.14" style="stroke-width: 1; font-family: "Open Sans", sans-serif; font-size: 18px; font-style: normal; font-weight: normal; fill: rgb(0,0,0); ">',
'<svg width="1065" height="1065" viewBox="0 0 1065 1065" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">',
// background
'<style type="text/css">@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;600");</style>',
'<rect width="1065" height="1065" fill="url(#background)" /><rect opacity="0.2" width="1065" height="1065" fill="url(#background-radial)" />',
// shadows
'<g filter="url(#diskette-shadow)"><path d="M857.231 279.712L902.24 286.675C910.547 287.96 917.915 292.721 922.5 299.768L938.894 324.964C942.249 330.12 943.311 336.437 941.827 342.406L937.798 358.615L924.049 356.65L919.416 374.084L934.068 376.24L791.947 922.152C788.109 936.896 773.694 946.308 758.651 943.893L179.636 850.928C162.318 848.147 151.215 830.987 155.776 814.051L160.478 796.59L704.315 879.574L857.231 279.712Z" fill="#050505" /></g>',
'<path d="M840.231 240.712L885.24 247.675C893.547 248.961 900.915 253.722 905.5 260.768L921.894 285.965C925.249 291.12 926.311 297.437 924.827 303.406L920.798 319.616L907.049 317.65L902.416 335.084L917.068 337.241L774.947 883.152C771.109 897.896 756.694 907.308 741.651 904.893L162.636 811.928C145.318 809.147 134.215 791.987 138.776 775.051L143.478 757.59L687.315 840.574L840.231 240.712Z" fill="url(#main)" />',
// diskette fill
'<path fill-rule="evenodd" clip-rule="evenodd" d="M319.847 161.502C310.356 160.007 300.674 166.326 298.221 175.616L138.724 779.758C136.271 789.048 141.977 797.79 151.468 799.285L740.061 891.973C749.553 893.467 759.235 887.148 761.687 877.858L902.405 344.854L889.158 342.768L898.872 305.972L912.119 308.059L913.733 301.946C914.837 297.762 914.309 293.476 912.251 289.927L893.484 257.569C891.153 253.549 887.063 250.823 882.221 250.061L828.205 241.554C822.224 240.613 815.869 242.783 811.427 247.284L805.686 253.103C804.205 254.603 802.087 255.326 800.093 255.013L783.611 252.417L734.3 439.196C731.439 450.035 720.143 457.407 709.07 455.663L328.847 395.788C317.774 394.045 311.117 383.845 313.978 373.007L366.528 173.962L366.533 173.941C367.234 171.24 365.572 168.702 362.81 168.267L319.847 161.502ZM369.392 174.414L368.652 177.217L316.843 373.458C314.39 382.748 320.096 391.49 329.587 392.985L709.81 452.86C719.301 454.354 728.983 448.035 731.436 438.745L780.747 251.966L783.245 242.504L783.985 239.701L369.392 174.414Z" fill="#131316" />',
'<path fill-rule="evenodd" clip-rule="evenodd" stroke="url(#main)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="M319.847 161.502C310.356 160.007 300.674 166.326 298.221 175.616L138.724 779.758C136.271 789.048 141.977 797.79 151.468 799.285L740.061 891.973C749.553 893.467 759.235 887.148 761.687 877.858L902.405 344.854L889.158 342.768L898.872 305.972L912.119 308.059L913.733 301.946C914.837 297.762 914.309 293.476 912.251 289.927L893.484 257.569C891.153 253.549 887.063 250.823 882.221 250.061L828.205 241.554C822.224 240.613 815.869 242.783 811.427 247.284L805.686 253.103C804.205 254.603 802.087 255.326 800.093 255.013L783.611 252.417L734.3 439.196C731.439 450.035 720.143 457.407 709.07 455.663L328.847 395.788C317.774 394.045 311.117 383.845 313.978 373.007L366.528 173.962L366.533 173.941C367.234 171.24 365.572 168.702 362.81 168.267L319.847 161.502ZM369.392 174.414L368.652 177.217L316.843 373.458C314.39 382.748 320.096 391.49 329.587 392.985L709.81 452.86C719.301 454.354 728.983 448.035 731.436 438.745L780.747 251.966L783.245 242.504L783.985 239.701L369.392 174.414Z" fill="url(#diskette-gradient)" fill-opacity="0.2" />',
// arrows
'<path d="M335.38 208.113C335.922 208.198 336.417 207.686 336.283 207.179L330.39 184.795C330.249 184.261 329.529 184.148 329.129 184.597L312.358 203.411C311.978 203.838 312.174 204.458 312.716 204.544L317.962 205.37C318.357 205.432 318.595 205.796 318.493 206.183L314.7 220.551C314.597 220.938 314.835 221.302 315.231 221.364L324.539 222.83C324.935 222.893 325.338 222.629 325.44 222.242L329.233 207.875C329.336 207.488 329.739 207.224 330.135 207.286L335.38 208.113Z" fill="url(#main)" />',
'<path d="M319.282 269.087C319.824 269.173 320.319 268.661 320.186 268.154L314.292 245.77C314.151 245.236 313.431 245.123 313.031 245.572L296.261 264.386C295.88 264.812 296.076 265.433 296.618 265.518L301.864 266.344C302.259 266.407 302.497 266.771 302.395 267.158L298.602 281.526C298.5 281.913 298.737 282.277 299.133 282.339L308.441 283.805C308.837 283.867 309.24 283.604 309.343 283.217L313.136 268.849C313.238 268.462 313.641 268.199 314.037 268.261L319.282 269.087Z" fill="black" fill-opacity="0.5" />',
'<path d="M303.184 330.062C303.726 330.148 304.221 329.636 304.088 329.128L298.194 306.745C298.053 306.211 297.333 306.098 296.933 306.547L280.163 325.361C279.782 325.787 279.979 326.408 280.52 326.493L285.766 327.319C286.161 327.382 286.399 327.746 286.297 328.133L282.504 342.501C282.402 342.888 282.639 343.252 283.035 343.314L292.344 344.78C292.739 344.842 293.142 344.579 293.245 344.192L297.038 329.824C297.14 329.437 297.543 329.174 297.939 329.236L303.184 330.062Z" fill="black" fill-opacity="0.5" />',
// body
'<path stroke="url(#main)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" d="M290.109 463.418C292.358 454.902 301.233 449.11 309.933 450.48L771.07 523.096C779.77 524.467 785 532.48 782.752 540.996L692.086 884.418L199.443 806.84L290.109 463.418Z" fill="black" fill-opacity="0.14" />',
// slider
'<path fill-rule="evenodd" clip-rule="evenodd" stroke="url(#main)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" d="M787.589 237.349L460.354 185.818L406.325 390.469C403.872 399.759 409.578 408.501 419.069 409.996L711.934 456.114C721.425 457.609 731.107 451.29 733.56 442L787.589 237.349ZM660.269 245.01C655.523 244.263 650.682 247.423 649.456 252.068L607.386 411.418C606.16 416.063 609.013 420.434 613.759 421.181L682.499 432.006C687.245 432.753 692.086 429.594 693.312 424.949L735.382 265.599C736.608 260.954 733.755 256.583 729.01 255.835L660.269 245.01Z" fill="url(#main)" />',
// fleek logo
'<path fill-rule="evenodd" clip-rule="evenodd" d="M864.643 283.937C865.186 283.605 865.708 284.257 865.239 284.683L844.268 303.719C843.938 304.018 844.093 304.517 844.526 304.548L853.726 305.207C854.184 305.24 854.321 305.787 853.942 306.071L833.884 321.112C833.506 321.396 833.643 321.943 834.101 321.976L844.007 322.685C844.491 322.72 844.605 323.319 844.177 323.58L797.752 351.954C797.209 352.286 796.687 351.634 797.156 351.209L818.403 331.922C818.733 331.622 818.577 331.123 818.145 331.092L808.748 330.42C808.292 330.387 808.154 329.843 808.529 329.558L828.054 314.744C828.43 314.459 828.291 313.915 827.835 313.882L818.389 313.206C817.904 313.171 817.79 312.572 818.218 312.311L864.643 283.937Z" fill="white" />',
// text
'<g transform="matrix(0.987827 0.155557 -0.255261 0.966872 250 735)"><text font-family="Inter, sans-serif" font-weight="bold" font-size="42" fill="#E5E7F8">',
name,
'</tspan><tspan x="-37.14" y="17.45" style="stroke-width: 1; font-family: "Open Sans", sans-serif; font-size: 18px; font-style: normal; font-weight: normal; fill: rgb(0,0,0); ">',
'</text><text font-family="Inter, sans-serif" font-weight="normal" y="40" font-size="22" fill="#7F8192">',
ENS,
"</tspan></text>",
"</g>",
"</text></g>",
// logo
'<image width="167" height="167" transform="matrix(0.987827 0.155557 -0.255261 0.966872 444.117 524.17)" href="',
logo,
'" />',
// defs
"<defs>",
// shadow
'<filter id="diskette-shadow" x="70.7489" y="195.712" width="955.733" height="832.558" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" /><feBlend in="SourceGraphic" /><feGaussianBlur stdDeviation="42" /></filter>',
// bg
'<linearGradient id="background" x1="532.5" y1="0" x2="532.5" y2="1065" gradientUnits="userSpaceOnUse"><stop /><stop offset="1" stop-color="#131313" /></linearGradient>',
'<radialGradient id="background-radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(532.5 532.5) rotate(89.961) scale(735)"><stop stop-color="',
color,
'" /><stop offset="1" stop-color="',
color,
'" stop-opacity="0" /></radialGradient>',
// fill gradient
'<linearGradient id="diskette-gradient" x1="925.626" y1="256.896" x2="136.779" y2="800.203" gradientUnits="userSpaceOnUse"><stop stop-color="',
color,
'" /><stop offset="1" stop-color="#2C313F" /></linearGradient>',
// color
'<linearGradient id="main"><stop stop-color="',
color,
'" /></linearGradient>',
// end defs
"</defs>",
"</svg>"
)
)

View File

@ -11,6 +11,8 @@ library FleekStrings {
using Strings for uint256;
using Strings for uint160;
using FleekStrings for bool;
using FleekStrings for uint24;
using Strings for uint24;
/**
* @dev Converts a boolean value to a string.
@ -38,12 +40,13 @@ library FleekStrings {
'"description":"', app.description, '",',
'"owner":"', uint160(owner).toHexString(20), '",',
'"external_url":"', app.externalURL, '",',
'"image":"', FleekSVG.generateBase64(app.name, app.ENS), '",',
'"image":"', FleekSVG.generateBase64(app.name, app.ENS, app.logo, app.color.toColorString()), '",',
'"attributes": [',
'{"trait_type": "ENS", "value":"', app.ENS,'"},',
'{"trait_type": "Commit Hash", "value":"', app.builds[app.currentBuild].commitHash,'"},',
'{"trait_type": "Repository", "value":"', app.builds[app.currentBuild].gitRepository,'"},',
'{"trait_type": "Version", "value":"', app.currentBuild.toString(),'"}',
'{"trait_type": "Version", "value":"', app.currentBuild.toString(),'"},',
'{"trait_type": "Color", "value":"', app.color.toColorString(),'"}',
']',
'}'
));
@ -64,4 +67,17 @@ library FleekStrings {
"}"
));
}
/**
* @dev Converts bytes3 to a hex color string.
*/
function toColorString(uint24 color) internal pure returns (string memory) {
bytes memory hexBytes = bytes(color.toHexString(3));
bytes memory hexColor = new bytes(7);
hexColor[0] = "#";
for (uint256 i = 1; i < 7; i++) {
hexColor[i] = hexBytes[i + 1];
}
return string(hexColor);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,13 @@
{
"FleekERC721": [
{
"address": "0x8679f8A4Fb3AaA1E851100D2C0444a729a3D946C",
"timestamp": "1/19/2023, 8:33:42 PM"
},
{
"address": "0x72b255A13ac5758971Ba365913e432eEd341656D",
"timestamp": "1/18/2023, 4:15:56 PM"
},
{
"address": "0x21d7fBe220958A0F0f7cAE58780fe812EbcB3cd8",
"timestamp": "1/16/2023, 8:51:51 AM"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -40,6 +40,7 @@
"@openzeppelin/hardhat-upgrades": "^1.22.0",
"@types/mocha": "^10.0.1",
"chai": "^4.3.6",
"colorthief": "^2.3.2",
"dotenv": "^16.0.2",
"ethers": "^5.7.2",
"hardhat": "^2.11.2",
@ -50,6 +51,7 @@
"pinst": "^3.0.0",
"prettier": "^2.7.1",
"prettier-plugin-solidity": "^1.0.0",
"sharp": "^0.31.3",
"solidity-coverage": "^0.8.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.3",

View File

@ -1,15 +1,55 @@
const { deployStore } = require('./utils/deploy-store');
const {
deployStore,
getCurrentAddressIfSameBytecode,
} = require('./utils/deploy-store');
const { getProxyAddress, proxyStore } = require('./utils/proxy-store');
const CONTRACT_NAME = 'FleekERC721';
const NETWORK = hre.network.name;
// --- Inputs ---
const ARGUMENTS = [
'FleekNFAs', // Collection name
'FLKNFA', // Collection symbol
];
const deploy = async () => {
const Contract = await ethers.getContractFactory(CONTRACT_NAME);
// --- Script Settings ---
const CONTRACT_NAME = 'FleekERC721';
const NETWORK = hre.network.name;
const DEFAULT_PROXY_SETTINGS = {
unsafeAllow: ['external-library-linking'],
};
const LIBRARIES_TO_DEPLOY = ['FleekSVG'];
const libraryDeployment = async () => {
console.log('Deploying Libraries...');
const libraries = {};
for (const lib of LIBRARIES_TO_DEPLOY) {
const libAddress = await getCurrentAddressIfSameBytecode(lib);
if (libAddress) {
console.log(`Library "${lib}" already deployed at ${libAddress}`);
libraries[lib] = libAddress;
continue;
}
const libContract = await hre.ethers.getContractFactory(lib);
const libInstance = await libContract.deploy();
await libInstance.deployed();
deployStore(NETWORK, lib, libInstance);
console.log(`Library "${lib}" deployed at ${libInstance.address}`);
libraries[lib] = libInstance.address;
}
return libraries;
};
const main = async () => {
console.log(':: Starting Deployment ::');
console.log('Network:', NETWORK);
console.log('Contract:', CONTRACT_NAME);
const libraries = await libraryDeployment();
const Contract = await ethers.getContractFactory(CONTRACT_NAME, {
libraries,
});
const proxyAddress = await getProxyAddress(CONTRACT_NAME, NETWORK);
let deployResult;
@ -17,7 +57,11 @@ const deploy = async () => {
try {
if (!proxyAddress) throw new Error('No proxy address found');
console.log(`Trying to upgrade proxy contract at: "${proxyAddress}"`);
deployResult = await upgrades.upgradeProxy(proxyAddress, Contract);
deployResult = await upgrades.upgradeProxy(
proxyAddress,
Contract,
DEFAULT_PROXY_SETTINGS
);
console.log(
`Contract ${CONTRACT_NAME} upgraded at "${deployResult.address}" by account "${deployResult.signer.address}"`
);
@ -29,7 +73,11 @@ const deploy = async () => {
) {
console.log(`Failed to upgrade proxy contract: "${e.message?.trim()}"`);
console.log('Creating new proxy contract...');
deployResult = await upgrades.deployProxy(Contract, ARGUMENTS);
deployResult = await upgrades.deployProxy(
Contract,
ARGUMENTS,
DEFAULT_PROXY_SETTINGS
);
await deployResult.deployed();
await proxyStore(CONTRACT_NAME, deployResult.address, hre.network.name);
console.log(
@ -45,9 +93,8 @@ const deploy = async () => {
console.error('Could not write deploy files', e);
}
}
return deployResult;
};
console.log(':: Starting Deployment ::');
console.log('Network:', NETWORK);
console.log('Contract:', CONTRACT_NAME);
deploy();
main();

View File

@ -1,20 +1,96 @@
// npx hardhat run scripts/mint.js --network mumbai
const { getContract } = require('./util');
const { getSVGBase64, getSVGColor } = require('./utils/read-svg');
const path = require('path');
// TODO: make this arguments
const params = [
'0x7ED735b7095C05d78dF169F991f2b7f1A1F1A049', // to
'Fleek App', // name
'Description', // description
'https://fleek.co/', // external url
'fleek.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
];
const DEFAULT_MINTS = {
html5: [
'HTML5 App', // name
'Description for HTML5 app', // description
'https://html.com/', // external url
'html.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/html.svg'), // svg
],
psych: [
'Psychedelic App', // name
'A decentralized product studio building web3 products for an omni-chain world', // description
'https://psychedelic.com/', // external url
'psychedelic.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/psych.svg'), // svg
],
fleek: [
'Fleek App', // name
'The easiest way to build and deploy scalable web3 apps. Fleek is an open source, blockchain agnostic, extensible web3 development platform', // description
'https://fleek.xyz/', // external url
'fleek.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/fleek.svg'), // svg
],
dydx: [
'dydx', // name
'Trade Perpetual Contracts with no fees*, deep liquidity, and up to 20× more Buying Power. Deposit just $10 to', // description
'https://dydx.exchange/', // external url
'dydx.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/dydx.svg'), // svg
],
aave: [
'aave', // name
'Earn interest, borrow assets, and build applications', // description
'https://aave.com/', // external url
'aave.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/aave.svg'), // svg
],
uniswap: [
'Uniswap', // name
'Swap, earn, and build on the leading decentralized crypto trading protocol', // description
'https://uniswap.org/', // external url
'uniswap.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/uniswap.svg'), // svg
],
yearn: [
'Yearn', // name
'Yearn is a decentralized suite of products helping individuals, DAOs, and other protocols earn yield on their digital assets.', // description
'https://yearn.finance/', // external url
'yearn.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/yearn.svg'), // svg
],
pancake: [
'PancakeSwap', // name
'Trade, earn, and win crypto on the most popular decentralized platform in the galaxy.', // description
'https://pancakeswap.finance/', // external url
'pancake.eth', // ens
'6ea6ad16c46ae85faced7e50555ff7368422f57', // commit hash
'https://github.com/org/repo', // repo
path.resolve(__dirname, '../assets/pancakeswap.svg'), // svg
],
};
const params = DEFAULT_MINTS.fleek;
const mintTo = '0x7ED735b7095C05d78dF169F991f2b7f1A1F1A049';
(async () => {
const contract = await getContract('FleekERC721');
params.unshift(mintTo);
const svgPath = params.pop();
console.log('SVG Path: ', svgPath);
params.push(await getSVGBase64(svgPath));
console.log('SVG length: ', params[params.length - 1].length);
params.push(await getSVGColor(svgPath));
const transaction = await contract.mint(...params);
console.log('Response: ', transaction);

View File

@ -1,4 +1,5 @@
const { writeFile } = require('./file');
const { existsSync } = require('fs');
const path = require('path');
const getDeployFilePath = (network, contractName) => {
@ -8,9 +9,7 @@ const getDeployFilePath = (network, contractName) => {
);
};
module.exports.deployStore = async (network, contractName, contract) => {
const filePath = getDeployFilePath(network, contractName);
const getBuildData = async (contractName) => {
const buildArtifact = await hre.artifacts.readArtifact(contractName);
const {
id: buildId,
@ -23,16 +22,32 @@ module.exports.deployStore = async (network, contractName, contract) => {
const contractOutput =
solcOutput.contracts[buildArtifact.sourceName][contractName];
return {
buildId,
abi: contractOutput.abi,
bytecode: buildArtifact.bytecode,
metadata: contractOutput.metadata,
storageLayout: contractOutput.storageLayout,
solcInput,
};
};
const deployStore = async (network, contractName, contract) => {
const filePath = getDeployFilePath(network, contractName);
const { buildId, solcInput, abi, bytecode, metadata, storageLayout } =
await getBuildData(contractName);
const data = {
timestamp: new Date().toLocaleString('en-US'),
address: contract.address,
transactionHash: contract.deployTransaction.hash,
args: contract.deployTransaction.args,
gasPrice: contract.deployTransaction.gasPrice.toNumber(),
abi: contractOutput.abi,
bytecode: buildArtifact.bytecode,
metadata: contractOutput.metadata,
storageLayout: contractOutput.storageLayout,
abi,
bytecode,
metadata,
storageLayout,
};
try {
@ -47,3 +62,23 @@ module.exports.deployStore = async (network, contractName, contract) => {
throw `Could not write file: ${err}`;
}
};
const getCurrentAddressIfSameBytecode = async (contractName) => {
const { bytecode } = await getBuildData(contractName);
if (existsSync(getDeployFilePath(hre.network.name, contractName))) {
const deployData = require(getDeployFilePath(
hre.network.name,
contractName
));
return deployData.bytecode === bytecode ? deployData.address : null;
}
return null;
};
module.exports = {
getBuildData,
deployStore,
getCurrentAddressIfSameBytecode,
};

16
scripts/utils/read-svg.js Normal file
View File

@ -0,0 +1,16 @@
const { getColor } = require('colorthief');
const sharp = require('sharp');
const fs = require('fs').promises;
module.exports.getSVGColor = async (path) => {
const png = (await sharp(path).png().toBuffer()).toString('base64');
const colorValues = await getColor(`data:image/png;base64,${png}`);
return colorValues;
};
module.exports.getSVGBase64 = async (path) => {
const svg = Buffer.from(
await fs.readFile(path, { encoding: 'utf-8' })
).toString('base64');
return `data:image/svg+xml;base64,${svg}`;
};

File diff suppressed because one or more lines are too long

View File

@ -1,20 +0,0 @@
import { expect } from 'chai';
import { ethers, upgrades } from 'hardhat';
describe('Proxy', function () {
it('FleekERC721', async () => {
const Contract = await ethers.getContractFactory('FleekERC721');
const ContractV2 = await ethers.getContractFactory('FleekERC721');
const instance = await upgrades.deployProxy(Contract, [
'Collection Name',
'SYMBOL',
]);
const upgraded = await upgrades.upgradeProxy(instance.address, ContractV2);
const name = await upgraded.name();
const symbol = await upgraded.symbol();
expect(name).to.equal('Collection Name');
expect(symbol).to.equal('SYMBOL');
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1460
yarn.lock

File diff suppressed because it is too large Load Diff