Racing Raptors Contract Architecture p1.

RealmLink
3 min readSep 9, 2022

--

This project is still a work in progress.

There’s a lot going on here, let’s unpack it.

Starting with the minters.
Minter 1 — 10k Raptor Collection
Minter 2 — Collab Raptor Collection
Minter 3 — Raptor Breeding

They all use the same singular stats & game contract. This is so that all stats are on-chain & were obtained using verifiable game logic.

There are 3 types of available races
QP — Quick-play
Comp — Competitive
DR — Death-Race.

8 Racers per race.
2 Fighters per race.

Winner of the race gets an increase in their speed stat.
Winner of the fight gets an increase in their strength stat.

In QP/Comp the loser of the fight will have a 12 hour cooldown. If the raptor loses a fight in Death Race it is burned/destroyed.

It costs to enter a race, the fee increases from QP to DR. The winner of the race wins 50% of the entrance fees, 5% are sent to a community multi sig wallet used for purchasing NFTs from other NFT projects to give to the community & 45 % of entrance fees are burned.

When a game starts the contract requests random numbers from Chainlink VRFv2 which can take a few minutes to complete so users will have a chance to bet on a race as to what raptor will win the fight. When a user places a bet the tokens are burned & the tokens the user is rewarded with are minted.

NFT DR Staking.

Every raptor staked in this contract receives a base reward per block, for every DR your raptor has survived (upto 50 races survived) your raptors reward increases by a % which is compounding.

NFT Strength Staking.

Shared between all raptors in this contract is a total reward per block.
A raptors share of this reward per block is based upon their strength vs the cumulative strength of all raptors staked in the staking contract. Essentially a yield farming contract where yield is based on a stat earned from playing the game.

Users would pay 1USD to stake their raptor, this 1USD would be paired with some Raptor Coin & sent to the LP under a locked liquidity address.

NFT Marketplace.

Since we have on-chain stats, Opensea wouldn’t recognise these so we need our own marketplace. Transactions would be in Raptor Coin. 1% of all resales would be burned.

Uniswap V2.

This was not the easiest step, upgrading Uniswap V2 to the latest version of solidity lol. This is here for seamless interaction with the ecosystem.

LP Staking.

Users would be reward in Raptor Coin for coming to the ecosystem & locking up their liquidity.

Raptor Coin Staking.

Users would be able to stake their Raptor Coin for a rather conservative reward of about 1–3%.

Claws(Secondary Token).

Users would be able to exchange their Raptor coin for claws which they would then be able to stake & be rewarded in a number of tokens from other polygon projects that choose to Collab & reward users.

Right so that’s a lot, I know.
I’m going to leave it at that for now but make sure to come back for p2 if you enjoyed this :)

Part 2 — https://medium.com/p/cd06bca5e541

Solidity Dev Study Group — https://discord.gg/KzbcGmrnfN

-Polygon Alliance — https://www.polygonalliance.com/

-Polygon Alliance Discord — https://discord.gg/kJKPCGQu66

Did you enjoy this article?
Feel like buying me a cup of coffee?
Polygon/Eth/Bsc — 0x4A581E0eaf6b71D05905e8E6014dc0277A1B10ad

New to trading? Try crypto trading bots or copy trading on best crypto exchanges

Join Coinmonks Telegram Channel and Youtube Channel get daily Crypto News

Also, Read

--

--