Challenges

  • Figuring out how we’ll handle accepting multiple crytocurrencies (ETH and BNB) from users before swapping to BUSDs on the binance smart chain. We eventually resolved to stay with the native BNB token which will be swapped for BUSD tokens.

  • How to update match states on the smart contract (Match not started, Match started, Match Ended) automatically.

    • For Match started state, we resolved to using the match starting time which is saved when the match is created. A check on the place bet function will update the match state to match started if the start time is before the current block's timestamp.

    • For Match Ended, we resolved to passing the task of closing and setting the match result to the admin.

  • Getting a Yield Aggregator available on the BSC testnet. For instance, there is no 1inch.exchange version on the BSC testnet since the aggregated protocols aren’t on the testnet.

  • No available doc to guide integrating with PancakeSwap for BNB -> BUSD exchange.

    • We looked into the uniswap source code and documentation to understand the function to use for swapping and it's expected parameters.

  • Varying BUSD contracts on the testnet making it difficult to use the same exchanged stablecoin as stake for borrowing-lending protocol.

  • There’s no Chainlink node/oracle on BSC testnet with HTTP_GET adapter.

    • This meant we had to pass the task of fetching and setting the match result to the admin.

  • Bettors bare the cost of liquidating their assets in terms of gas fee for the transaction.

    • We need to integrate to a gas station network to avoid this.

  • To achieve a fully trustless platform,

    • the contract should be able to fetch the match result via an oracle and set the match result without the admin doing so. This way users don't need to trust the admin to set the right match result.

    • the contract should be able to close a match itself once the match is over so this is not in the control of the owner of the contract. The way the users don't need to rely on the admin to close the match when the match is over. Any delay in closing a match will result in users not being able to liquidate their tokens immediately the match is over.

Last updated