Skip to content

Commit

Permalink
Merge feature/gs2 into master (#1119)
Browse files Browse the repository at this point in the history
* Progress Modal UI (#1058)

* Open progress modal

* Move to progress modal

* Add checklist

* Add challenge items

* Clean up design

---------

Co-authored-by: Chase Fleming <[email protected]>

* Add blank profile modal (#1066)

* Add blank profile modal

* Rename

* Rename

* Rename

---------

Co-authored-by: Chase Fleming <[email protected]>

* Add field and input components (#1068)

* Setup input component

* Change style

* Add field component

* Add field and input components

---------

Co-authored-by: Chase Fleming <[email protected]>

* [GS] Add Cadence Scripts & TS Bindings

* Add radio group for how did you find (#1069)

* Add radio group for how did you find

* Add more options

---------

Co-authored-by: Chase Fleming <[email protected]>

* Add tags section (#1070)

Co-authored-by: Chase Fleming <[email protected]>

* Add functionality to edit or create profile (#1071)

* Add challenge section (#1072)

Co-authored-by: Chase Fleming <[email protected]>

* Hook up progress percentage (#1073)

* Add scoll to modal (#1076)

Co-authored-by: Chase Fleming <[email protected]>

* add class for mobile fix

* Hook up first challenge progress (#1075)

* More changes from main (#1079)

* Bring more changes from main

* Remove

---------

Co-authored-by: Chase Fleming <[email protected]>

* Challenge modal ui (#1080)

* Add challenge modal

* Add icon and text

* Add complete button

---------

Co-authored-by: Chase Fleming <[email protected]>

* Hook up NoopChallenge button (#1081)

* Hook up challenge badges with on-chain data (#1083)

* Add transaction status tracking (#1086)

* Add Form Validation & Fix GitHub Input (#1089)

* Fix contract identifier field (#1098)

* Add GitHub picture to profile (#1100)

* Cache GitHub Profile (#1103)

* Misc UI improvements (#1104)

* Improve text

* Improve look on checklist

* Improve unselected radio group state

* Fixes

* Fix dark mode

* Change button color

---------

Co-authored-by: Chase Fleming <[email protected]>

* Add ability to include EVM contracts in Gold Star profile (#1099)

* Input improvements (#1106)

* Input improvements

* Fix

* Remove

* Remove

---------

Co-authored-by: Chase Fleming <[email protected]>

* Fix referral validation (#1105)

* Add close button to modal (#1107)

* Disallow challenges with no profile (#1109)

* Fix deployed contracts progress (#1110)

* Change to select (#1111)

Co-authored-by: Chase Fleming <[email protected]>

* Fix dark mode ghost button shadow (#1113)

* Fix challenge disabled (#1112)

* Misc UI improvements (#1115)

* Use avatar and progress (#1114)

Co-authored-by: Chase Fleming <[email protected]>

* Add user addr to profile and fix select color (#1116)

* Add user addr to profile

* Fix styling

---------

Co-authored-by: Chase Fleming <[email protected]>

* Update to latest Gold Star contracts & deploy mainnet (#1118)

* Use GitHub Avatar for Dropdown (#1117)

---------

Co-authored-by: Chase Fleming <[email protected]>
Co-authored-by: Chase Fleming <[email protected]>
  • Loading branch information
3 people authored Jan 24, 2025
2 parents 78c779b + 9143a3c commit 37c3ad9
Show file tree
Hide file tree
Showing 52 changed files with 3,301 additions and 1,003 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ docs/.obsidian

# flow
imports

goldstar-testnet.pkey
goldstar-mainnet.pkey
27 changes: 22 additions & 5 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ const config = {
},
...(process.env.GTAG
? {
gtag: {
trackingID: process.env.GTAG,
anonymizeIP: true,
},
}
gtag: {
trackingID: process.env.GTAG,
anonymizeIP: true,
},
}
: {}),
}),
],
Expand Down Expand Up @@ -627,6 +627,23 @@ const config = {
},
},
],
function cadenceLoader() {
return {
name: 'cadence-loader',
configureWebpack() {
return {
module: {
rules: [
{
test: /\.cdc$/,
use: 'raw-loader',
},
],
},
};
},
};
},
],
stylesheets: [
{
Expand Down
145 changes: 129 additions & 16 deletions flow.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,130 @@
{
"networks": {
"emulator": "127.0.0.1:3569",
"mainnet": "access.mainnet.nodes.onflow.org:9000",
"testing": "127.0.0.1:3569",
"testnet": "access.devnet.nodes.onflow.org:9000"
},
"accounts": {
"emulator-account": {
"address": "f8d6e0586b0a20c7",
"key": {
"type": "file",
"location": "emulator-account.pkey"
}
}
}
}
"contracts": {
"DeployedContractChallenge": {
"source": "./src/cadence/contracts/DeployedContractChallenge.cdc",
"aliases": {
"testing": "0000000000000007"
}
},
"GoldStar": {
"source": "./src/cadence/contracts/GoldStar.cdc",
"aliases": {
"testing": "0000000000000007"
}
},
"LearnFlowChallenge": {
"source": "./src/cadence/contracts/LearnFlowChallenge.cdc",
"aliases": {
"testing": "0000000000000007"
}
},
"ManualChallenge": {
"source": "./src/cadence/contracts/ManualChallenge.cdc",
"aliases": {
"testing": "0000000000000007"
}
}
},
"dependencies": {
"Burner": {
"source": "mainnet://f233dcee88fe0abe.Burner",
"hash": "71af18e227984cd434a3ad00bb2f3618b76482842bae920ee55662c37c8bf331",
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "f233dcee88fe0abe",
"testnet": "9a0766d93b6608b7"
}
},
"FlowToken": {
"source": "mainnet://1654653399040a61.FlowToken",
"hash": "cefb25fd19d9fc80ce02896267eb6157a6b0df7b1935caa8641421fe34c0e67a",
"aliases": {
"emulator": "0ae53cb6e3f42a79",
"mainnet": "1654653399040a61",
"testnet": "7e60df042a9c0868"
}
},
"FungibleToken": {
"source": "mainnet://f233dcee88fe0abe.FungibleToken",
"hash": "050328d01c6cde307fbe14960632666848d9b7ea4fef03ca8c0bbfb0f2884068",
"aliases": {
"emulator": "ee82856bf20e2aa6",
"mainnet": "f233dcee88fe0abe",
"testnet": "9a0766d93b6608b7"
}
},
"FungibleTokenMetadataViews": {
"source": "mainnet://f233dcee88fe0abe.FungibleTokenMetadataViews",
"hash": "dff704a6e3da83997ed48bcd244aaa3eac0733156759a37c76a58ab08863016a",
"aliases": {
"emulator": "ee82856bf20e2aa6",
"mainnet": "f233dcee88fe0abe",
"testnet": "9a0766d93b6608b7"
}
},
"MetadataViews": {
"source": "mainnet://1d7e57aa55817448.MetadataViews",
"hash": "10a239cc26e825077de6c8b424409ae173e78e8391df62750b6ba19ffd048f51",
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "1d7e57aa55817448",
"testnet": "631e88ae7f1d7c20"
}
},
"NonFungibleToken": {
"source": "mainnet://1d7e57aa55817448.NonFungibleToken",
"hash": "b63f10e00d1a814492822652dac7c0574428a200e4c26cb3c832c4829e2778f0",
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "1d7e57aa55817448",
"testnet": "631e88ae7f1d7c20"
}
},
"ViewResolver": {
"source": "mainnet://1d7e57aa55817448.ViewResolver",
"hash": "374a1994046bac9f6228b4843cb32393ef40554df9bd9907a702d098a2987bde",
"aliases": {
"emulator": "f8d6e0586b0a20c7",
"mainnet": "1d7e57aa55817448",
"testnet": "631e88ae7f1d7c20"
}
}
},
"networks": {
"emulator": "127.0.0.1:3569",
"mainnet": "access.mainnet.nodes.onflow.org:9000",
"testing": "127.0.0.1:3569",
"testnet": "access.devnet.nodes.onflow.org:9000"
},
"accounts": {
"emulator-account": {
"address": "f8d6e0586b0a20c7",
"key": {
"type": "file",
"location": "emulator-account.pkey"
}
},
"goldstar-mainnet": {
"address": "e99f9883203ff565",
"key": {
"type": "file",
"location": "goldstar-mainnet.pkey"
}
},
"goldstar-testnet": {
"address": "032b0464e2e8fccc",
"key": {
"type": "file",
"location": "goldstar-testnet.pkey"
}
}
},
"deployments": {
"mainnet": {
"goldstar-mainnet": ["GoldStar", "LearnFlowChallenge"]
},
"testnet": {
"goldstar-testnet": ["GoldStar", "LearnFlowChallenge"]
}
}
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,32 @@
"dotenv": "16.0.3",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"lru-cache": "^11.0.2",
"node-fetch": "^3.3.2",
"postcss": "^8.4.31",
"prettier": "^2.8.7",
"prism-react-renderer": "^1.3.5",
"raw-loader": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redocusaurus": "^2.1.2",
"rehype-katex": "4",
"remark-math": "3",
"shiki": "1.14.1",
"swr": "^2.3.0",
"tailwind-scrollbar-hide": "1.1.7",
"tailwindcss": "^3.3.5",
"unist-util-visit": "^5.0.0",
"webpack-merge": "5.8.0"
"webpack-merge": "5.8.0",
"zod": "^3.24.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.6.3",
"@jest/globals": "^29.7.0",
"@onflow/typedefs": "^1.4.0",
"@tsconfig/docusaurus": "^2.0.3",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.14",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"concurrently": "^8.2.1",
"eslint": "^8.0.1",
Expand Down
73 changes: 73 additions & 0 deletions src/cadence/contracts/DeployedContractChallenge.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import "GoldStar"

access(all)
contract DeployedContractChallenge {

access(all)
resource Challenge: GoldStar.Challenge {

access(all)
let name: String

access(all)
let description: String

init() {
self.name = "Deployed a contract"
self.description = "Deploy a contract to Flow"
}

access(all)
fun evaluate(submission: &{GoldStar.Submission}) {
let submission = submission as? &Submission
?? panic("invalid submission type")

let owner = submission.owner
?? panic("submission must be stored in an account")

let name = submission.contractName
if owner.contracts.borrow<&AnyStruct>(name: name) == nil {
panic("contract not found")
}

submission.accept()
}
}

access(all)
resource Submission: GoldStar.Submission {

access(all)
let contractName: String

access(self)
var accepted: Bool

init(contractName: String) {
self.contractName = contractName
self.accepted = false
}

access(all)
fun isAccepted(): Bool {
return self.accepted
}

access(contract)
fun accept() {
self.accepted = true
}
}

access(all)
fun createChallenge(): @Challenge {
return <- create Challenge()
}

access(all)
fun createSubmission(contractName: String): @Submission {
return <- create Submission(
contractName: contractName
)
}
}
Loading

0 comments on commit 37c3ad9

Please sign in to comment.