Technical documentation coverting the GET Protocols contracts. Issuing getNFT (digital twins of event tickets).
Note: The contracts in this repo represent the OLD NFT minting contracts. Our new code base is currently undergoing its final checks. The code in this repo is NOT representitive of GET Protocols smart contract stack (regarding both ticketing as event financing).
In the tables the address of protocols contracts are detailed.
Take note these are proxy addresses, they only contain storage and no implememntation logic. See Open Zeppelin transparent proxy pattern.
Name | Contract type | Address |
---|---|---|
Proxy AccessControlGET | Proxy | Polygonscan Mainnet |
Proxy EventMetadataStorage | Proxy | Polygonscan Mainnet |
Proxy EconomicsGET | Proxy | Polygonscan Mainnet |
Proxy BaseGET | Proxy | Polygonscan Mainnet |
Proxy ERC721UpgradeableGET | Proxy | Polygonscan Mainnet |
Proxy GetEventFinancing | Proxy | Polygonscan Mainnet |
Proxy GETProtocolConfiguration | Proxy | Polygonscan Mainnet |
Polygon GET (bridged from ETH GET) | ERC20 | Polygonscan Mainnet |
This is a testnet enviroment used by integrators and the development team.
Proxy contract addresses (remain unchanged regardless)
Name | Contract type | Address |
---|---|---|
Proxy AccessControlGET | Proxy | Polygonscan Mumbai |
Proxy EventMetadataStorage | Proxy | Polygonscan Mumbai |
Proxy EconomicsGET | Proxy | Polygonscan Mumbai |
Proxy BaseGET | Proxy | Polygonscan Mumbai |
Proxy ERC721UpgradeableGET | Proxy | Polygonscan Mumbai |
Proxy ConfigurationGET | Proxy | Polygonscan Mumbai |
Proxy GetEventFinancing | Proxy | Polygonscan Mumbai |
MockGET | ERC20 | Polygonscan Mumbai |
This is a testnet enviroment used by integrators and the development team. Proxy contract addresses (remain unchanged regardless)
Name | Contract type | Address |
---|---|---|
Proxy AccessControlGET | Proxy | Polygonscan Mumbai |
Proxy EventMetadataStorage | Proxy | Polygonscan Mumbai |
Proxy EconomicsGET | Proxy | Polygonscan Mumbai |
Proxy BaseGET | Proxy | Polygonscan Mumbai |
Proxy ERC721UpgradeableGET | Proxy | Polygonscan Mumbai |
Proxy ConfigurationGET | Proxy | Polygonscan Mumbai |
Proxy GetEventFinancing | Proxy | Polygonscan Mumbai |
MockGET | ERC20 | Polygonscan Mumbai |
relayerAddress (1): 0x383F07EccE503801F636Ad455106e270748bdE05 BufferAddress WL: 0xbC0A62565b48258665b9cee793af87C93a22A49E
relayerAddress (1): 0xb9F77e8FE9AEf5df3A4C3c465B9D88423e41F41a BufferAddress YTP: 0x0Eb7C00C78BFFefa65eB01d92D3778bDe630381B
Gnosis multi sig address: 0x4E242E831eE532AE39E626D254e5a718270dd75B The Gnosis multisig is deployed on Polygon blockchain.
Relayer 1 Playground: 0xEA7DFF0629474f9aAC107e01FA563c62498C90Fd Relayer 2 Playground: 0x492f5C2B40F22a21E1dfC91fde7e1Be884faA497
Bufferaddress relayer 1 - Playground: 0x441ca9c552809863B719b7a780C67250F0DD20eD Bufferaddress relayer 2 - Playground: 0x779Ae6498c27b572a8f6A9B9432299612D3331FB
Relayer 1 Testing: 0x35D59a290b08D2081441922aA9D4A36a9dd83dCA Relayer 2 Testing: 0x5400249158F83309AFCd8210ce0c995dB0B16E25
Bufferaddress relayer 1 Testing: 0x441ca9c552809863B719b7a780C67250F0DD20eD Bufferaddress relayer 2 Testing: 0x779Ae6498c27b572a8f6A9B9432299612D3331FB
Main contact point for interactions regarding NFTs. Stores the metadata (price, strings etc) of the ticket NFTs. Contract does NOT store/register whom owns an NFT as this is done by the getERC721 proxy contract.
Issuance of getNFT to address destinationAddress.\
function primarySale(
address _destinationAddress,
address _eventAddress,
uint256 _primaryPrice,
uint256 _basePrice,
uint256 _orderTime,
bytes32[] calldata _ticketMetadata
) external onlyRelayer {
Events emitted: PrimarySaleMint
event PrimarySaleMint(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime,
uint256 basePrice
);
Secondary market/P2P getNFT ownership change.\
function secondaryTransfer(
address _originAddress,
address _destinationAddress,
uint256 _orderTime,
uint256 _secondaryPrice) external onlyRelayer {
Events emitted: SecondarySale
event SecondarySale(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime,
uint256 resalePrice
);
Validation of getNFT by scanner/issuer. Does not make NFT claimable.\
function scanNFT(
address _originAddress,
uint256 _orderTime
) external onlyRelayer {
Events emitted: IllegalScan
or TicketScanned
event TicketScanned(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime
);
or
event IllegalScan(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime
);
Invalidates getNFT (makes unscannable, unclaimable).\
function invalidateAddressNFT(
address _originAddress,
uint256 _orderTime) external onlyRelayer {
Events emitted: TicketInvalidated
event TicketInvalidated(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime
);
Claims an NFT from custody controlled EOA to an external EOA\
function claimgetNFT(
address _originAddress,
address _externalAddress,
uint256 _orderTime) external onlyRelayer {
Events emitted: NftClaimed
event NftClaimed(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime
);
Checks in NFT, makes the asset CLAIMABLE. Drains the GET in the backpack to the DAO.
function checkIn(
address _originAddress,
uint256 _orderTime
) external onlyRelayer {
Events emitted: CheckedIn
event CheckedIn(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime
);
or
event NftClaimed(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime
);
function collateralMint(
address _basketAddress,
address _eventAddress,
uint256 _primaryPrice,
bytes32[] calldata _ticketMetadata
) external onlyFactory {
Events emitted: CollateralizedMint
event CollateralizedMint(
uint256 indexed nftIndex,
uint64 indexed getUsed,
uint64 indexed orderTime,
uint256 basePrice
);
Returns if a NFT owned by a certain address can be resold.
function isNFTSellable(
uint256 _nftIndex,
address _originAddress
) public view returns(bool _sell) {
Returns the metadata stored in an NFT.
function ticketMetadataAddress(
address _originAddress)
external view returns (
address _eventAddress,
bytes32[] memory _ticketMetadata,
uint32[2] memory _salePrices,
TicketStates _state
)
Stores the metadata of the events on the GET Protocol.
function registerEvent(
address _eventAddress,
address _integratorAccountPublicKeyHash,
string memory _eventName,
string memory _shopUrl,
string memory _imageUrl,
bytes32[4] memory _eventMeta, // -> [bytes32 latitude, bytes32 longitude, bytes32 currency, bytes32 ticketeerName]
uint256[2] memory _eventTimes, // -> [uin256 startingTime, uint256 endingTime]
bool _setAside, // -> false = default
bytes32[] memory _extraData,
bool _isPrivate
) public onlyRelayer {
Events emitted: NewEventRegistered
event NewEventRegistered(
address indexed eventAddress,
uint256 indexed getUsed,
string eventName,
uint256 indexed orderTime
);
Contract holds the GET balances and on-chain charging configuration of ticketeers(both whitelabels as digital twins). Fuels the NFTs in the depot contract.
Charge GET to the ticketeer silo in the economics contract.
function topUpRelayerFromBuffer(
uint256 _topUpAmount,
uint256 _priceGETTopUp,
address _relayerAddress
) external onlyAdmin nonReentrant onlyConfigured(_relayerAddress) returns(uint256) {
Events emitted: RelayerToppedUpBuffer
event RelayerToppedUpBuffer(
address indexed relayerAddress,
uint256 indexed topUpAmount,
uint256 priceGETTopUp,
uint256 indexed newsiloprice
);
loads the NFT balance with GET in its backpack (called by economicsGET)\
function setDynamicRateStruct(
address _relayerAddress,
uint32[12] calldata dynamicRates
) external onlyAdmin {
Events emitted: RelayerConfiguration
event RelayerConfiguration(
address relayerAddress,
uint32[12] dynamicRates
);
function setRelayerBuffer(
address _relayerAddress,
address _bufferAddressRelayer
) external onlyAdmin {
Events emitted: RelayerBufferMapped
event RelayerBufferMapped(
address relayerAddress,
address bufferAddressRelayer
);
function clearDynamicRateStruct(
address _relayerAddress
) external onlyAdmin {
Events emitted: RelayerConfigurationCleared
event RelayerConfigurationCleared(
address relayerAddress
);
function _calculateNewAveragePrice(
uint256 _topUpAmount,
uint256 _priceGETTopUp,
address _relayerAddress
) internal returns(uint256) {
Events emitted: AveragePriceUpdated
event AverageSiloPriceUpdated(
address relayerAddress,
uint256 oldPrice,
uint256 newPrice
);
function fuelBackpackTicket(
uint256 _nftIndex,
address _relayerAddress,
uint256 _basePrice
) external onlyFactory onlyConfigured(_relayerAddress) returns (uint256)
Moves the accumulated GET from the depot to the DAO treasury.
function swipeDepotBalance() external nonReentrant returns(uint256) {
require(collectedDepot > 0, "NOTHING_TO_SWIPE");
Events emitted: DepotSwiped
event DepotSwiped(
address feeCollectorAddress,
uint256 balance
);
Moves all the GET from the backpack to the depot.
function emptyBackpackBasic(
uint256 _nftIndex
) external onlyFactory returns(uint256) {
function chargeTaxRateBasic(
uint256 _nftIndex
) external onlyFactory returns(uint256) {
function chargeTaxRateBasic(
uint256 _nftIndex
) external onlyFactory returns(uint256) {
function balanceRelayerSilo(
address _relayerAddress
) external view returns (uint256)
function checkRelayerConfiguration(
address _relayerAddress
) external view returns (bool) {
function chargeTaxRateBasic(
uint256 _nftIndex
) external onlyFactory returns(uint256) {
function valueRelayerSilo(
address _relayerAddress
) public view returns(uint256) {
function estimateNFTMints(
address _relayerAddress
) external view returns(uint256) {
function viewRelayerRates(
address _relayerAddress
) external view returns (DynamicRateStruct memory)
function viewRelayerFactor(
address _relayerAddress
) external view returns (uint256) {
function viewRelayerGETPrice(
address _relayerAddress
) external view returns (uint256) {
function viewBackPackBalance(
uint256 _nftIndex
) external view returns (uint256) {
function viewBackPackValue(
uint256 _nftIndex,
address _relayerAddress
) external view returns (uint256) {
function viewDepotBalance() external view returns(uint256) {
function viewDepotValue() external view returns(uint256) {
function viewBufferOfRelayer(
address _relayerAddress
) public view returns (address) {
The Configuration contract contains all the global protocol variables and configurations.
function setAllContractsStorageProxies(
address _access_control_proxy,
address _base_proxy,
address _erc721_proxy,
address _metadata_proxy,
address _financing_proxy,
address _economics_proxy
) external onlyOwner {
function setAccessControlGETProxy(
address _access_control_proxy
) external onlyOwner {
Events emitted: UpdateAccessControl
event UpdateAccessControl(address _old, address _new);
function setBASEProxy(
address _base_proxy) external onlyOwner {
Events emitted: UpdatebaseGETNFT
event UpdatebaseGETNFT(address _old, address _new);
function setMetaProxy(
address _metadata_proxy) external onlyOwner {
Events emitted: UpdateMetdata
event UpdateMetdata(address _old, address _new);
function setERC721Proxy(
address _erc721_proxy) external onlyOwner {
Events emitted: UpdateERC721
event setERC721Proxy(address _old, address _new);
function setMetaProxy(
address _metadata_proxy) external onlyOwner {
Events emitted: setMetaProxy
event setMetaProxy(address _old, address _new);
function setFinancingProxy(
address _financing_proxy) external onlyOwner {
Events emitted: UpdateFinancing
event UpdateFinancing(address _old, address _new);
function setGETUSD(
uint256 _newGETUSD
) external onlyOwner {
Events emitted: UpdateGETUSD
event UpdateGETUSD(uint256 _old, uint256 _new);
function setBasicTaxRate(
uint256 _basicTaxRate
) external onlyOwner {
Events emitted: UpdateBasicTaxRate
event UpdateBasicTaxRate(uint256 _old, uint256 _new);