Skip to content

Commit

Permalink
fix transactions we need to run to fix this
Browse files Browse the repository at this point in the history
  • Loading branch information
bjartek committed Aug 6, 2024
1 parent f2963dd commit 25d8bef
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 43 deletions.
2 changes: 2 additions & 0 deletions contracts/FIND.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ pub contract FIND {
let lastResult = PublicPriceOracle.getLatestPrice(oracleAddr: self.getFlowUSDOracleAddress())
let lastBlockNum = PublicPriceOracle.getLatestBlockHeight(oracleAddr: self.getFlowUSDOracleAddress())

/*
// Make sure the price is not expired
if getCurrentBlock().height - lastBlockNum > 2000 {
panic("Price is expired")
}
*/

return lastResult
}
Expand Down
54 changes: 11 additions & 43 deletions tasks/testnetMarket/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,25 @@ import (
)

func main() {

adminSigner := WithSigner("find")

o := Overflow(
WithNetwork("mainnet"),
WithNetwork("testnet"),
WithGlobalPrintOptions(),
)

id, err := o.QualifiedIdentifier("FIND", "Lease")
if err != nil {
panic(err)
}

upsertItem := o.TxFN(
adminSigner,
WithArg("cut", 0.0),
)

flowNfts := map[string]string{
"GeneratedExperiences": "A.123cb666996b8432.GeneratedExperiences.NFT",
/*
"bl0x": `["A.7620acf6d7f2468a.Bl0x.NFT"]`,
"pharaohs": `["A.9d21537544d9123d.Momentables.NFT"]`,
"versus": `["A.d796ff17107bbff6.Art.NFT"]`,
"flovatar": `["A.921ea449dffec68a.Flovatar.NFT" , "A.921ea449dffec68a.FlovatarComponent.NFT"]`,
"neoCharity": `["A.097bafa4e0b48eef.CharityNFT.NFT"]`,
"starly": `["A.5b82f21c0edf76e3.StarlyCard.NFT"]`,
"float": `["A.2d4c3caffbeab845.FLOAT.NFT"]`,
"dayNFT": `["A.1600b04bf033fb99.DayNFT.NFT"]`,
"BYC": `["A.195caada038c5806.BarterYardClubWerewolf.NFT"]`,
*/
}

for name, contracts := range flowNfts {
/*
upsertItem(
"tenantsetMarketOptionDapper",
WithArg("nftName", name), //primary key
WithArg("nftTypes", []string{contracts}),
)
*/

upsertItem(
"tenantsetMarketOption",
WithArg("nftName", name), //primary key
WithArg("nftTypes", []string{contracts}),
)
}
// o.Tx("adminAddNFTCatalog",
// WithSigner("find-admin"),
// WithArg("collectionIdentifier", "A.195caada038c5806.BarterYardClubWerewolf.NFT"),
// WithArg("contractName", "BarterYardClubWerewolf"),
// WithArg("contractAddress", "0x195caada038c5806"),
// WithArg("addressWithNFT", "0x2a2d480b4037029d"),
// WithArg("nftID", 2),
// WithArg("publicPathIdentifier", "BarterYardClubWerewolfCollection"),
// )

upsertItem(
"tenantsetLeaseOptionMarket",
WithArg("nftName", "Lease"), // primary key
WithArg("nftType", id),
)
}
12 changes: 12 additions & 0 deletions transactions/setFlowWallet.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Admin from "../contracts/Admin.cdc"
import FungibleToken from "../contracts/standard/FungibleToken.cdc"

transaction() {

prepare(account: AuthAccount) {
let wallet=account.getCapability<&{FungibleToken.Receiver}>(/public/flowTokenReceiver)
let adminClient=account.borrow<&Admin.AdminProxy>(from: Admin.AdminProxyStoragePath)!
adminClient.setWallet(wallet)
}
}

0 comments on commit 25d8bef

Please sign in to comment.