mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-06 23:50:35 +00:00
b2bd8e4a0a
Close #3451 Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
51 lines
1.5 KiB
Go
51 lines
1.5 KiB
Go
package standard
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neo-go/pkg/smartcontract"
|
|
"github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest"
|
|
)
|
|
|
|
// MethodRoyaltyInfo is the name of the method that returns royalty information.
|
|
const MethodRoyaltyInfo = "royaltyInfo"
|
|
|
|
// Nep24 is a NEP-24 Standard for NFT royalties.
|
|
var Nep24 = &Standard{
|
|
Manifest: manifest.Manifest{
|
|
ABI: manifest.ABI{
|
|
Methods: []manifest.Method{
|
|
{
|
|
Name: MethodRoyaltyInfo,
|
|
Parameters: []manifest.Parameter{
|
|
{Name: "tokenId", Type: smartcontract.ByteArrayType},
|
|
{Name: "royaltyToken", Type: smartcontract.Hash160Type},
|
|
{Name: "salePrice", Type: smartcontract.IntegerType},
|
|
},
|
|
ReturnType: smartcontract.ArrayType,
|
|
Safe: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
Required: []string{manifest.NEP11StandardName},
|
|
}
|
|
|
|
// Nep24Payable contains an event that MUST be triggered after marketplaces
|
|
// transferring royalties to the royalty recipient if royaltyInfo method is implemented.
|
|
var Nep24Payable = &Standard{
|
|
Manifest: manifest.Manifest{
|
|
ABI: manifest.ABI{
|
|
Events: []manifest.Event{
|
|
{
|
|
Name: "RoyaltiesTransferred",
|
|
Parameters: []manifest.Parameter{
|
|
{Name: "royaltyToken", Type: smartcontract.Hash160Type},
|
|
{Name: "royaltyRecipient", Type: smartcontract.Hash160Type},
|
|
{Name: "buyer", Type: smartcontract.Hash160Type},
|
|
{Name: "tokenId", Type: smartcontract.ByteArrayType},
|
|
{Name: "amount", Type: smartcontract.IntegerType},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|