You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Contracts Structure
|- var totalFLOATEvents:UInt64
|- ThemeStruct {id, host, name, string, url}
|- resource Theme //赛事主题
- theme: ThemeStruct
|- fun createTheme(id:Int, name:String,metadata:URL): @theme
|- resource Event //单个赛事
- let eventId,name,description,host
- var claimable: bool
- var totalSupply:UInt64
- var claimed: {Address: UInt32}
- eventsCap: Capability<&Events> //链接到Event
- var themes: [ThemeStruct] //赛事相关所有主题
- addTheme(theme:ThemeStruct):Int //项目管理者添加赛事主题
- init(_eventDescription, , _eventName,_eventHost)
- fun purchase(recipient: &Collection, params: {String: AnyStruct}, payment: @FungibleToken.Vault) //购买mint,调用管理员后门mint
- fun mint(recipient: &Collection{NonFungibleToken.CollectionPublic}): UInt64 //管理员后门mint
- fun mintTheme(recipient: &Collection{NonFungibleToken.CollectionPublic}, themId:UInt32): @Theme//mint主题NFT
|- resource interface CollectionPublic //用户存储这些Events的NFT
- var ownedNFTs: @{UInt64: NonFungibleToken.NFT} //存储所有的NFT
- pub fun borrowEvent(id: UInt64): &NFT?
- pub fun deposit(token: @NonFungibleToken.NFT)
- pub fun withdraw(withdrawID: UInt64): @NonFungibleToken.NFT
- pub fun borrowFLOAT(id: UInt64): &NFT?
- pub fun getIDs(): [UInt64] //返回所有的NFT
|- resource Events //赛事的集合
- var events: @{UInt64: Event}
- fun createEvent(name,description,host): UInt64 //创建赛事
- fun borrowEventRef(eventId: UInt64): &Event? //便于读取赛事信息
- fun getIDs(): [UInt64]
|- fun createEmptyCollection(): @Collection
|- fun createEmptyEventsCollection(): @Events
Beta Was this translation helpful? Give feedback.
All reactions