Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into nialexsan/update-pack…
Browse files Browse the repository at this point in the history
…ages
  • Loading branch information
nialexsan committed Aug 15, 2024
2 parents a03ca39 + 2f265f2 commit a051278
Show file tree
Hide file tree
Showing 61 changed files with 5,544 additions and 11,320 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
NEXT_PUBLIC_SIGNER_ADDRESS: "0xf8d6e0586b0a20c7"
SIGNER_PRIVATE_KEY: "91a22fbd87392b019fbe332c32695c14cf2ba5b6521476a8540228bdf1987068"
NEXT_PUBLIC_TEST_NET_URL: "http://localhost:3000"
NEXT_PUBLIC_SANDBOX_NET_URL: "http://localhost:3000"
NEXT_PUBLIC_PREVIEWNET_URL: "http://localhost:3000"
NEXT_PUBLIC_TOKEN_AMOUNT_FLOW: "1000.0"
NEXT_PUBLIC_TOKEN_AMOUNT_FUSD: "10.0"
NEXT_PUBLIC_CONTRACT_FUNGIBLE_TOKEN: "0xee82856bf20e2aa6"
NEXT_PUBLIC_CONTRACT_FLOW_TOKEN: "0x0ae53cb6e3f42a79"
NEXT_PUBLIC_CONTRACT_FUSD: "0xf8d6e0586b0a20c7"
NEXT_PUBLIC_CONTRACT_EVM: "0xf8d6e0586b0a20c7"
NEXT_PUBLIC_NETWORK: "testnet"

strategy:
matrix:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Sumbit an issue to be added as a codeowner
* @10thfloor @MrDSGC @alse @srinjoyc
* @jribbink @ianthpun @bthaile
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ npm run db-seed
npm run dev-deploy-contracts
```

### Run initial transactions to initialize the FUSD minter

```sh
npm run initial-transactions
```

### Run the Next.js app

```sh
Expand Down
44 changes: 44 additions & 0 deletions cadence/contracts/Burner.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/// Burner is a contract that can facilitate the destruction of any resource on flow.
///
/// Contributors
/// - Austin Kline - https://twitter.com/austin_flowty
/// - Deniz Edincik - https://twitter.com/bluesign
/// - Bastian Müller - https://twitter.com/turbolent
access(all) contract Burner {
/// When Crescendo (Cadence 1.0) is released, custom destructors will be removed from cadece.
/// Burnable is an interface meant to replace this lost feature, allowing anyone to add a callback
/// method to ensure they do not destroy something which is not meant to be,
/// or to add logic based on destruction such as tracking the supply of a FT Collection
///
/// NOTE: The only way to see benefit from this interface
/// is to always use the burn method in this contract. Anyone who owns a resource can always elect **not**
/// to destroy a resource this way
access(all) resource interface Burnable {
access(contract) fun burnCallback()
}

/// burn is a global method which will destroy any resource it is given.
/// If the provided resource implements the Burnable interface,
/// it will call the burnCallback method and then destroy afterwards.
access(all) fun burn(_ r: @AnyResource) {
if let s <- r as? @{Burnable} {
s.burnCallback()
destroy s
} else if let arr <- r as? @[AnyResource] {
while arr.length > 0 {
let item <- arr.removeFirst()
self.burn(<-item)
}
destroy arr
} else if let dict <- r as? @{HashableStruct: AnyResource} {
let keys = dict.keys
while keys.length > 0 {
let item <- dict.remove(key: keys.removeFirst())!
self.burn(<-item)
}
destroy dict
} else {
destroy r
}
}
}
Loading

0 comments on commit a051278

Please sign in to comment.