As ex-cryptominers with our own cloud crypto mining platform, we already have experience with building an accounting system that supports various blockchains with various decimals.
We have important takeouts from our past experience:
- with GameTradeMarket, we do not consider any blockchain as a final destination; everything can change in one moment and we need to quickly switch to another blockchain
- Prices in fiat need to be recalculated frequently, but transactions that already happened need to remember the fiat conversion rate
- Never build our own solutions when possible - always use 3rd party providers such as Moralis, Infura, BigQuery
- Failproof accounting is a must - we make sure that transaction are processed in 100% of cases in not much than 30 seconds after they happen on the blockchain
GameTradeMarket can support any token of any nature, as long as we have an internal provider for a specific protocol. The system is built in such a way that interactions with new blockchains can be added on-the-go.
The blockchains already supported are: Ethereum, Polygon and Binance Smart Chain. The system is built to support any blockchain, it already supports any WalletConnect-compliant cryptowallet (virtually any cryptowallet). Next blockchains to be supported are Avax, Solana and Avalanche.
To work with blockchain, we use ethers.js and web3.js on the frontend and Infura on the backend. For parsing large amounts of data on the blockchain (e.g. parsing tokens belonging to our users) we use Google BigQuery pre-filled database.
We have our own marketplace smart-contract. It is based off the open-source template smart contract that takes funds from the buyer, transfers the token from the sellet to the buyer and releases the funds to the seller. We added a couple of enhancements like dynamically setting the fee, in case we decide to change it. Such manipulations can only be done from the smart contract creator’s wallet address. Also, we save each listing directly in the smart contract’s storage, otherwise we could expect someone hijacking the smart contract and setting their own price.