Single source of truth: bsc-rex.io
Verified REX links: linktr.ee/rextoken
NETWORK: BNB Smart Chain ("BSC")
Network Name:Smart Chain
RPC URL: https://bsc-dataseed.binance.org/
ChainID: 56
Symbol: BNB
Block Explorer URL: https://bscscan.com/
CONTRACT ADDRESSES
REX ("XRX")
0xb25583E5e2dB32b7FCbffe3f5e8E305C36157E54
code (published, verified, triple-audited): bscscan.com
trade: pancakeswap.finance
chart: dextools.io | poocoin.app
TREX ("XTRX")
0xA4d97197d7c2FaDf1C8e2226d03AAD8Ac1583b9C
code (published, verified, triple-audited): bscscan.com
buy: app.bsc-rex.io
MREX ("MREX")
0x76837D56D1105bb493CDDbEFeDDf136e7c34f0c4
code (published, verified, triple-audited): bscscan.com
trade: pancakeswap.finance
chart: dextools.io | poocoin.app
DAILY AUCTIONS
0x0bA69EdF05AbE71028f82202Bb394a64C224dDF5
code (published, verified, triple-audited): bscscan.com
STAKE DEX
0x3D11149b23C90379295681e773864A5a5d2b0D90
code (published, verified, triple-audited): bscscan.com
AIRDROP
0xd65b42a7FeF267a2E79cbD3b3C8672C1ECE35828
code (published, verified, triple-audited): bscscan.com
PCS PAIR (LP-Token)
0x207B298f4e08FaCb491f13E8335969E12c912d3e
code (AMM contract, automatically built by pancakeswap.finance): bscscan.com
SUMMARY
Time-based investments and bonding financial tools have been around for many years in the Traditional Finance (TradFi) world and have recently made their way onto blockchains, replacing centralized banking institutions with decentralized code-based protocols. These new technologies invite innovations in the financial models, making additional features and flexibility possible for the first time.
REX is a decentralized blockchain-based cryptocurrency utilizing smart contracts to provide highly rewarding and flexible time-based investments and bonding financial tools. Specifically, REX smart contracts provide a native investment option, called "staking": locking up tokens for a period of time to gain rewards, called "staking rewards".
This is comparable to a time deposit or certificate of deposit (CD) in traditional finance, but with more flexibility and greater possible gains. REX may also be thought of as an internet bond.
In crypto speech, REX is a staking token, so participants buy REX and stake it over time to earn more REX. The additional REX earned by stakers comes from new REX that is minted each day, causing the REX supply to increase, or inflate, over time. The REX token supply inflates by 12.9% per year. This inflation is created by the contract and distributed to the stakers.
REX Smart Contracts offer a wealth of functionality unprecedented in Decentralized Finance that makes managing stakes much easier, more flexible and - for the first time - fully decentralized.
For example, in REX it’s possible to name stakes (to keep track of their purpose), split stakes (for instance, in a divorce), transfer an active stake to another address (for example, as a gift) and even withdraw already-earned staking rewards while a stake is active (instead of having to emergency-end it early). The user may also choose to create a stake as revocable (the stake can be ended early and the user can withdraw staking rewards before maturity) or irrevocable (the stake can’t be ended early and the user can’t withdraw staking rewards before maturity) to increase its Annual Percentage Rate (APR).
Another example of innovation is a brand new feature in REX: a native decentralized exchange (DEX) for stakes; a user may buy and sell active stakes on the native stake DEX - a first in the Decentralized Finance (DeFi) space. This makes a REX STAKE itself a cryptocurrency.
A user may get REX tokens from
providing liquidity ("Initial Liquidity Phase"),
taking part in REX daily auctions ("Auction Phase"),
buying from PancakeSwap (REX-BUSD LP pair).
claiming an airdrop as a participant of the predecessor protocol REX CLASSIC.
In the Initial Liquidity Phase users may send BUSD to the contract where it is collected. At the beginning of REX DAY 2, it mints new REX tokens and sends a predefined portion of the BUSD and REX to PancakeSwap as "initial liquidity", the rest is added over the course of 200 days. The contract receives and stores the LP Tokens as they are gradually added to the liquidity pool over the first 200 days. The participants may withdraw their LP tokens from the contract starting on day 223, 10% every 30 days. The advantage for participants providing liquidity is they add liquidity without having to provide the REX half, as it is minted for free.
REX token creation and distribution is mainly managed via daily auctions. Each day a specified allocation of REX tokens is minted, a little less REX every day (earlier pays better). Starting on REX Day 1, users may bid BUSD to receive a portion of the daily REX allocation. There are 222 auction days. REX received from auctions can be claimed as a REX stake or as liquid REX.
Special feature: When claiming REX from an auction participation as a stake, the user will be eligible for Random Personal Big Pay Days. This feature was invented by REX to incentivize auction participation and was a popular feature in the original REX protocol. Every 24 hours a random generator distributes 75% of the BUSD received from auction that day back to eligible addresses. If an address gets hit, the contract tries to give that address all invested BUSD back, then the contract continues with the next eligible address, and so on, until the "Random-BUSD-pool" is empty. Remaining eligible means an address can be hit every day, again and again. There is no limit to the number of times a wallet can be hit. This is a unique feature only seen in REX.
REX protocol usage can be boosted by supportive tokens MREX and TREX. Holding these tokens provides advantages like receiving higher staking rewards, higher referral rewards, higher auction limits and getting rid of fees. Maximal boost is achieved with 1 TREX and 5 MREX.
1 INTRODUCTION
This document is a general technical specification of REX and its functionality.
To learn about the background and purpose of REX, visit rextoken.medium.com.
1.1 Security information
READ CAREFULLY and NEVER break a single rule.
⚠️ If you reveal your private keys to anyone, assume all your funds will be stolen.
⚠️ If you reveal your seed phrase to anyone, assume all your funds will be stolen.
⚠️ If you reveal your wallet password to anyone, assume all your funds will be stolen.
⚠️ If you connect your wallet to any third-party website or app, your funds can be stolen.
⚠️ When using a website/app, make sure it is official and the domain is written correctly.
⚠️ Always use contract addresses, not the name of tokens, to avoid fakes and imposters.
⚠️ Don't interact with REX smart contracts if prohibited by any law or regulation.
⚠️ Don't rely on social media. If you do, please be aware of the following risks.
⚠️ Be aware, people do steal identities, fake accounts and deceive.
⚠️ Never reveal any sensitive data to anyone for whatever reason.
⚠️ Never consider other people’s words/messages/posts as financial advice.
⚠️ Always do your own research (DYOR). Take responsibility for your actions.
⚠️ Take all the time you need to do your own research. Don't let anyone rush you.
⚠️ If anyone asks you to use third-party websites or apps or to send tokens, report them.
⚠️ Cryptocurrencies should be considered a new technology.
⚠️ Cryptocurrencies bear immense risk, total loss of tokens or their values.
⚠️ There is no guarantee, the technology or code will work forever - or at all.
⚠️ ONLY INVEST WHAT YOU CAN AFFORD TO LOSE.
⚠️ To minimize risks, strictly follow known investment rules, like Cramer's 25.
⚠️ REX smart contracts run on decentralized blockchains. Those blockchains are to be considered "third party" and their availability cannot be and is not guaranteed at any time.
⚠️ Apart from using the functions of REX smart contracts directly or via the blockchain explorer, REX smart contracts might be used via the "main website", but its functionality and availability - although well designed and protected - cannot be and is not guaranteed at any time.
2 ABOUT REX
REX is a blockchain-based, advanced, highly rewarding and flexible cryptocurrency and staking ecosystem, provided by a set of decentralized, unchangeable and irrevocable smart contracts. REX is not an organization, institution or person.
In addition to providing the usual cryptocurrency functions, the REX token natively provides properties of a certificate of deposit (CD) and a bond by utilizing smart contracts. However, compared to CDs and bonds in traditional finance, REX offers additional features and extended flexibility. In crypto speech, REX may be categorized as a staking token.
REX is the world’s first staking token providing a native Decentralized Exchange (DEX) for STAKES. Users may use the smart contract integrated functions to offer, buy and sell STAKES, without any restrictions, intermediaries, controllers, admins or any external service.
REX is the world’s first staking token where the user - and only the user - is in full control of their STAKES, even while offering them on the integrated Decentralized Exchange. This leads to a revolutionary zero counterparty risk environment for trading STAKES.
2.1 Special features of REX STAKES
A stake is "active" if it has SHARES that are actively earning rewards. That is, the initial time period defined for the REX to remain staked has not yet passed.
Stakes may be named (and re-named) to keep track of them
Staking rewards may be withdrawn from active stakes
Active stakes may be transferred to other addresses, as in a gift
Stakes may be split, as might be needed in a divorce
Active stakes may be sold on the native DEX for stakes
Staking rewards rates may be boosted with supportive tokens
2.2 REX Code
REX is immutable code, thoroughly tested, proven and made public.
REX source code (Solidity) is packed with English comments, so anybody may understand it.
REX source code may be examined by everyone so they may decide whether to interact with it.
Find the REX source code published and verified after deployment.
2.3 REX smart contracts
REX is audited (Certik / solidity.finance / TechRate-Hackathon), tested, no-admin, built-to-last.
REX is completely non-custodial, immutable and has verifiable security.
REX is not controlled by any person, institution or organization.
REX provides several functions to interact with it via apps and websites.
REX has a standard user interface: the main website.
Once deployed, initialized and "ownershipRenounced," REX contracts have no functionality granted to the deploying account and no administrative keys. They are unchangeable forever. All users, including the developers, have precisely equal access to the contracts' functionality.
There is one exception. After deployment and initialization of the DAILY AUCTIONS contract, that manages the auction phase in REX and creates most of the supply in the beginning of REX, one address, the GAS_REFUNDER, has additional rights. This address is allowed to send BNB to the DAILY AUCTIONS contract (which will be used for refunding gas fees to users) and withdraw tokens from the contract after the LAST CONTRACT DAY (when the auction phase is over and the TREASURY and all POOLS have already been emptied by the users). This right will be necessary to withdraw the remaining unused BNB and for withdrawing other tokens from the contract. For example, it can retrieve tokens that have accidentally been sent to the contract and would be otherwise unrecoverable (which happens a lot). To grant full security, this withdrawal permission explicitly excludes the REX-BUSD LP TOKENS that will wait in the contract for initial liquidity providers even after the auction phase.
2.4 REX TIME
Time is tracked by the contracts in whole day increments, beginning at REX DAY 0, which starts at the set LAUNCH_TIME, defined as unix time in the REX contract.
The time before REX DAY 0 starts (the time between contract deployment and LAUNCH_TIME) is also defined as REX DAY 0.
This REX DAY 0 phase from contract deployment until REX DAY 1 starts, is several days long and is called the Initial Liquidity Phase.
REX PHASES and special REX DAYS
DAY 0: Initial Liquidity Phase (several days long)
DAY 1-222: Daily Auction Phase
DAY 2-222: REX claim phase (airdrop)
DAY 2: Start of BUSD claim phase (airdrop)
DAY 1-250: BUSD claim phase (referrals)
DAY 2-250: BUSD claim phase (Big Pay Days)
DAY 2-259: REX claim phase (auctions and referrals)
DAY 223: Start of LP-TOKENS withdraw phase (Initial Liquidity)
DAY 251: All contract's BUSD are moved to TREASURY
DAY 252-258: BUSD claim phase (TREASURY)
2.5 Requirements for using REX
Users will need a computer or smartphone with an internet connection and a wallet (recommendation: MetaMask.io) to receive, hold, send and manage REX, REX stakes, and the boost tokens. On a computer, users will need a browser (recommendation: Firefox or Chrome) to install the wallet there.
Users will also need to hold BNB tokens (BSC native currency) in the wallet to execute functions (pay the blockchain transaction fees/"gas fees").
REX contracts use the BUSD token for their users to take part in daily auctions or to use the DEX for STAKES.
2.6 REX ecosystem
The REX smart contracts provide 3 different tokens and their functionality:
REX, TREX and MREX.
3 REX :: MAIN TOKEN
REX is the main token. It is fungible and transferable.
The name is REX, the token symbol is ?, and decimals is 18.
The base unit is PRINCE. 1 REX is composed of one quintillion (1018) PRINCES.
REX may be held in a private wallet (like MetaMask, for example).
The core purpose of REX is staking to gain staking rewards. REX provides usual staking functions (locking up tokens to earn staking rewards), advanced staking functions (naming stakes, transferring and splitting stakes and withdrawing staking rewards) and extended staking functions: offering/selling/buying stakes on the world's first native STAKE DEX.
3.1 How to get REX
Provide initial liquidity (before REX DAY 1).
Take part in the DAILY AUCTIONS as a participant or referrer (REX DAY 1 to 222).
Swap other tokens for REX on exchanges (from REX DAY 2), such as PancakeSwap (low slippage!).
Claim an airdrop as a participant of the predecessor protocol REX CLASSIC (REX DAY 2 to 222).
3.2 REX :: Token Supply
The REX token
is inflationary, has no fixed supply, has no pre-minted supply
is minted by users and referrers after DAILY AUCTIONS
is minted by users when ending a stake or withdrawing staking rewards
is minted by contract when adding liquidity to the PancakeSwap REX-BUSD LP pair
is minted by users by claiming the airdrop from REX CLASSIC
3.2.1 Auctioned REX
The main part of the supply is minted by participants of the daily auctions and their referrers. The auctions will create (a maximum of) 17,000,000,000 REX in the course of the 222 auction days. As those tokens will inflate during the auction phase, the supply from auctions at the end of the auction phase will be a little higher.
3.2.2 Daily Liquidity REX
10% of the BUSD sent to the auctions is forwarded to the REX-BUSD Liquidty Pool (LP pair) on PancakeSwap, together with the corresponding amount of new REX, in several transactions throughout the day, whenever the BUSD amount to send reaches or exceeds 500 BUSD - limited to 1000 BUSD per transaction. The quantity of REX, which is minted and sent with the BUSD, depends upon the amount of forwarded BUSD and the actual price ("reserves") on PancakeSwap. The LP tokens are burnt, so the liquidity is forever locked and cannot be withdrawn.
3.2.3 Liquidity Phase REX
A portion (1/200) of the Initial Liquidty (if any) is forwarded to the REX-BUSD Liqudity Pool (LP pair) on PancakeSwap, together with the corresponding amount of new REX, in several (500 BUSD + x REX) transactions throughout the day until the 1/200 is reached. The number of REX, which is minted and sent with the BUSD, depends upon the amount of forwarded BUSD and the actual price ("reserves") on PancakeSwap. The LP tokens received are stored in the contract and may be withdrawn by the liquidity providers when the auction phase has ended.
3.2.4 Allocated Supply
The actual total supply (circulating REX) may be fetched from the contract with the function totalSupply(). To receive a more useful value, the function allocatedSupply() has been implemented. This function returns the totalSupply (circulating REX) plus the REX that is locked in active stakes.
3.3 Supply Inflation
The allocated supply of REX (circulating + staked REX) inflates at a constant rate of 12.9% per year. The inflation might be higher, if users end their stakes early and penalties occur. At the end of every day, the contract calculates how many new REX will need to be minted for that day in order to achieve that rate of inflation.
totalREXSupply = circulatingREX + stakedREX
dailyInflationRate = (1.129 ^ (1 / 365) - 1)
dailyInflationRate = 0.00033247247636
newREXToday = totalREXSupply × dailyInflationRate
These new daily inflation REX tokens are not immediately minted. Instead, they are earmarked for distribution to all active stakes’ SHARES on that day. A fraction of this new REX is earmarked for each active stake in proportion to the stake's percentage of SHARES with respect to the total SHARE pool that day. Once a stake is closed (or staking rewards withdrawn), all earmarked tokens of the stake for all past days (until the desired withdrawal day, in case of a staking rewards withdrawal) are then minted at once.
Example scenario:
On REX DAY X, suppose there are
100,000,000 total circulating REX
30,000,000 total staked REX
10,000,000 total SHARES
The total new REX that will be generated on REX DAY X is then:
newREXDayX = (100,000,000 + 30,000,000) × 0.00033247247636
newREXDayX = 43,221.4219268 REX
Now, suppose user A has an active stake that is 2,000,000 SHARES.
On day X, this user's stake then gets REX earmarked for it:
userANewREXDayX = newREXDayX × stakeShares / totalShares
userANewREXDayX = 43,221.4219268 × 2,000,000 / 10,000,000
userANewREXDayX = 8,644.28438536 REX
In addition, the penalties from users ending stakes early are added to the inflation. Therefore, the actual inflation also depends upon the penalties that occur based on the users’ staking behavior. The exact formula in the code is
(_totalStaked + _totalSupply) * INFLATION_RATE + _totalPenalties
3.3.1 Inflation :: Code details
Inside the code, this "inflation amount" (on a certain day) is saved in the daily snapshot as snapshots[_day].inflationAmount. When a user ends a stake and the staking rewards are calculated (for each day, unless staking rewards have been withdrawn already), this daily number is used for calculating the daily reward:
_rewardAmount [day] +=
(_stakeShares * PRECISION) /
(TOTAL_SHARES * PRECISION / snapshots[_day].inflationAmount)
or, more simply:
_rewardAmount [day] += (myShares / totalShares) * snapshots[_day].inflationAmount
So, the staker receives their portion of the total inflation for every staking day.
3.3.2 Sustainability considerations
Token total supply: REX inflation creates 12.9% more tokens per year, distributed to stakers. This leads to a 5x of token supply after 13y (years), 20x after 25y (years):
4 TREX :: BOOST TOKEN
TREX is an optional fungible token for boosting user experience and user benefits.
The name is TREX, the token symbol is ?, and decimals is 0.
4.1 TREX benefits
An address holding 1 or more TREX gets:
Staking: 25% more SHARES when creating a stake
Auctions: 100% higher limit on BUSD sent to auction
4.2 How to get TREX
The user may use the "buy" function of the TREX contract linked from the REX website. The actual price (in BUSD) will be withdrawn from the user’s wallet and 1 TREX will be minted to the wallet.
The initial price of a TREX is 500 BUSD at the time of TREX contract deployment.
It rises by 5 BUSD every 100 TREX sold, called "TREX halving."
The supply is limited:
40,000 TREX may be bought from the contract.
10,000 TREX are airdropped to users who held TREX CLASSIC - claimable via the website after contract deployment and initialization.
This results in a total maximum supply of 50,000 TREX.
⚠️ Contracts cannot buy TREX.
NOTE: Holders of the predecessor "REX CLASSIC TREX" (early supporters of REX CLASSIC) are eligible to claim 10 TREX per "REX CLASSIC TREX" (held at the time of the snapshot) by using the "claim" function of TREX contract. A user may check the REX website to see if an address is eligible and (if so) also find the "claim" function there. The TREX contract allows the TREX airdropped addresses to sell their airdropped TREX (1 TREX every 3 days).
5 MREX :: BOOST TOKEN
MREX is an optional fungible token for boosting user experience and user benefits.
The name is MREX, the token symbol is MREX, and decimals is 0.
MREX BSC Address: 0x76837d56d1105bb493cddbefeddf136e7c34f0c4
NOTE: This MREX is the same token as was used to boost REX CLASSIC.
5.1 MREX benefits
An address holding between 1 to 5 MREX gets:
Referral rewards: Earn up to 5% of the BUSD sent to auction by a referee (1% per MREX). This reward is issued at the time the BUSD is sent by the referee in to auction.
Auctions: Earn bonus of up to 10% more REX from auctions (2% per MREX)
Native STAKE DEX: No buyer fee (2% of the stake’s price) when holding MREX
5.2 How to get MREX
Buy MREX via PancakeSwap.
(token address: 0x76837d56d1105bb493cddbefeddf136e7c34f0c4)
⚠️ Only 10,000 MREX are available in total (max total supply).
6 REX STAKING
REX allows users to stake (time deposit) their REX, locking it up for a period of time in order to earn staking rewards.
Users may open as many stakes as they like. After a stake reaches full maturity the user may close it at any time to receive their full principal, plus staking rewards, without penalty.
REX never penalizes the principal of a mature stake, no matter how late it is eventually closed, but its earned staking rewards decrease after a 14-day grace period, which starts after a stake's maturity. The staking rewards are then cut by 1% per week as long as the stake is not closed. This allows users a lot of flexibility in planning, especially for taxable income purposes.
6.1 Opening stakes
When a user opens a new stake, they choose an amount of REX to stake, a stake length in days, the name of the stake and the revocability. The minimum stake amount is 0.000000000001 REX (1000000 PRINCES). The minimum stake length is 7 days, and the maximum stake length is 3653 days (approx. 10 years). The longer the duration of a stake, the more REX SHARES are received.
Once a stake is opened, it is in "pending" status. This means that the stake won't technically begin until the following REX DAY. A user may close a pending STAKE, receiving back the stake's principal, without penalty or staking rewards. ATTENTION: It’s not possible to close a PENDING stake, when it has been created irrevocable.
Pending stakes begin "active" status once the next REX DAY begins. At this point, closing the stake before it reaches "mature" status will incur a penalty.
When a stake is opened, the REX tokens staked are burned by the REX contract and converted into SHARES. These SHARES exist for the life of the stake, provided no staking rewards are withdrawn before it matures. Once the stake is closed, the SHARES are deleted and REX is minted back to the user (with any staking rewards added and any penalties deducted).
6.2 Shares and Staking Rewards
When opening a stake, the REX tokens are burned (and saved in the contract as the stake’s "principal") and SHARES are created. These SHARES represent the stake size and length.
The amount of SHARES a newly opened stake gets is determined by a global SHARE PRICE tracked in the REX contract, as well as a percentage bonus based on the length of the stake. This SHARE PRICE increases with time and never decreases, hence staking earlier is better than later.
6.2.1 Staking rewards
Stakes earn staking rewards daily through the REX supply inflation, as well as from other stakes' penalties paid (when early ending a stake). The REX supply inflates at 12.9% per year (= 0.00033247247636 * total REX supply per day). This inflation is distributed daily to all active stakes, in proportion to their SHARES as compared to the total SHARE pool.
6.2.2 Bonus shares
Depending on the length of the stake, a bonus amount of SHARES will be generated on top: "longer pays better."
The number of SHARES received is calculated in such a way that a user gets 5% more SHARES when staking 365 days. So, the daily bonus percentage is (105%) / 365. This is valid for stakes up to 365 days (linear).
When staking longer than 365 days (1 full year), the amount above 365 receives another 5%, starting from the first day after day 365. For example, consider staking 465 days. The stake will receive 465 days * (105%) / 365 plus 100 days * (105%) / 365 more SHARES. In total, this could be expressed in short as (465+100) * (105%) / 365, daily.
This model increases for every new full year.
The following graphic shows the bonus SHARES in regard to the staking duration (in days).
Examples:
A staking duration of 7 days gets a bonus of around 0.000959% more SHARES.
So the total number of SHARES is (REX amount/SHARE PRICE) * 1.000959.
A staking duration of 3653 days gets a bonus of around 275.4521% more SHARES.
So the total number of SHARES is (REX amount/SHARE PRICE) * 3.754521.
Participants holding at least 1 TREX at the time of the stake's opening will receive 25% more SHARES.
Irrevocable stakes receive another 25% more SHARES.
If the user creates the stake irrevocable and has a TREX, the stakes will receive 56.25% more SHARES, as the bonuses are multiplied (1.25*1.25 = 1.5625).
Extreme examples:
An irrevocable stake of 3653 days, made with a TREX, would get a total number of SHARES of (REX amount/SHARE PRICE) * 3.754521 * 1.25 * 1.25, which equals (REX amount/SHARE PRICE) * 5.8664390625, so the stake will have around 6 times more SHARES than a revocable short stake made without TREX.
The website provides a calculator to compute the SHARES to be received.
6.2.3 Share price
The SHARE PRICE starts at a predetermined value of 0.1 REX/SHARE. Whenever any stake is closed, the contract calculates a ratio of that stake's total return (principal + staking rewards - penalty) to its SHARES. If this ratio is greater than the current SHARE PRICE, then the SHARE PRICE is immediately set to this new, increased value. The rise of the price is capped at +5%.
The SHARE PRICE can only increase over time, albeit fairly slowly. This ensures that earlier stakes get more SHARES than later stakes using the same amount of REX. This mechanism for increasing SHARE PRICE also prevents users from being able to compound their staking rewards with a sequence of smaller stakes in order to try and outperform a single long stake of the same size.
6.3 Withdrawing Staking Rewards
The user may withdraw already earned staking rewards from an active stake before the stake fully matures - unless it's an irrevocable stake.
The user may choose how many days' worth of staking rewards they wish to withdraw, up to the maximum available (= all past days).
Withdrawing staking rewards from an active stake may be done multiple times over the course of the stake.
Withdrawing staking rewards is possible starting on day 2 of the active stake. On day 1, the first active day, the stake has not yet completed a full day of being active, and thus has not yet accrued any staking rewards.
When a stake is closed, whether active or mature, the staking rewards minted back to the user only include rewards that haven't already been withdrawn.
Withdrawing rewards will not affect the stake's principal, but will reduce the number of SHARES the stake has going forward. This effectively means that the stake will earn less rewards on the current day (the day the rewards have been withdrawn) and on all future days of the stake than it otherwise would have. This SHARE reduction prevents users from being able to end up with more overall SHARES if they choose to immediately re-stake their withdrawn rewards.
⚠️ It is not possible to withdraw staking rewards from an irrevocable stake.
6.4 Closing a Stake
A user may close a stake at any time (unless it is irrevocable). Depending on the stake's status (where the stake is in its lifecycle), different things will happen:
Closing a pending stake - the stake SHARES are destroyed. The entire stake principal is minted back to the user, without rewards or penalty.
Closing an active (premature) stake - the stake SHARES are destroyed. The stake principal is penalized (see below) and minted back to the user along with all rewards accumulated thus far.
Closing a mature stake - the stake SHARES are destroyed. The entire stake principal and all rewards accumulated are minted back to the user. If the stake is closed later than 14 days after maturity, the rewards are penalized by 1% per week thereafter.
If an active premature stake is closed, the penalty deducted from the principal is as follows:
90% - if closed on the first day of it being active.
10% - if closed on its final day before maturity.
The penalty scales linearly between those two extremes.
Any such REX penalized from a stake's return is earmarked for distribution to all active stake SHARES that day. These penalty distributions are only realized by those stakes' SHARES when each of those stakes end.
Staking rewards will be paid for every full staked day, but will be penalized when closing late.
⚠️ Irrevocable stakes cannot be ended early.
6.5 Splitting a stake
A user may split an active stake into two stakes (in any desired ratio).
The new split stakes have the same name and duration. Neither stake can be split again.
⚠️ Splitting is not possible if staking rewards have been withdrawn before.
⚠️ Splitting is not possible if one of the resulting stakes would have less than the minimum required REX STAKING amount.
6.6 Transferring a stake
A user may transfer an active stake to another address.
⚠️ Stakes which have any of their staking rewards withdrawn are not transferable.
⚠️ It is not possible to transfer a stake to the sender’s own address.
6.7 Renaming a stake
The user may rename an active stake, which is effectively changing its "description."
6.8 Irrevocable stakes
Although REX is about flexibility, users may want to give up flexibility for higher rewards - maybe not in all their stakes, but in some of their stakes. The user may create a stake irrevocable to receive 25% more SHARES. Such an irrevocable stake is restricted from certain functions: staking rewards can’t be withdrawn and the stake can’t be ended early. Still, an irrevocable stake may be renamed, split, transferred to another address or sold on the native STAKE DEX.
6.9 Buying and selling a stake
REX provides its own native decentralized exchange ("DEX") for stakes, where users may offer their stakes for sale. This is implemented in the DEX contract.
When offering a stake, the user must set a desired BUSD price (5 BUSD minimum) and an offer duration from 1 to 30 days, where the scheduled end of the offer must be before the stake’s maturity date.
Offering a stake will list the stake on the DEX (in the DEX contract) and set the offered stake inactive, so the user can’t transfer, rename, end or split the stake, nor withdraw staking rewards during the time of the offering. The offered stake will be buyable by other users until the offer has expired or the user has revoked it.
A stake offer may be revoked by the seller anytime within the offer duration, unless a buyer has bought it.
Successfully buying a stake creates for the buyer a new active stake with the exact properties of the offered stake, with the description set to "Bought on DEX" and closes the offered stake of the seller.
If the offered stake isn’t sold before expiry, the seller must actively revoke the offer to restore the original name of the stake and reactivate it.
⚠️ A stake must have fulfilled at least 10% of the staking duration to be offered.
⚠️ Stake offers may be submitted from REX DAY 111 (DEX activation day).
⚠️ Stakes that have any of their staking rewards withdrawn can’t be offered.
⚠️ Buying a stake incurs a fee of 2% of the stake’s BUSD price for the buyer.
Fee usage: 1% goes to MARKETING FUND and 1% goes to DEV FUND.
If the buyer holds (at least one) MREX, the fee of 2% of the stake’s BUSD price will not be charged.
7 INITIAL LIQUIDITY
The INITIAL LIQUIDITY phase has been created to provide a certain level of liquidity in the REX-BUSD liquidity pool (LP pair) on PancakeSwap in the very early days of REX. For that, it allows early investors to provide BUSD before the auction phase starts.
The INITIAL LIQUIDITY phase starts with contract deployment and initialization and is referred to as REX DAY 0, which lasts several days.
The INITIAL LIQUIDITY phase ends with the beginning of REX DAY 1, when the auction phase starts.
For this phase, the DAILY AUCTIONS contract provides a function sendLiquidityBUSD for early investors to be able to send BUSD to the contract.
All provided BUSD tokens are stored in the contract as INITIAL_LIQ_BUSD. The contract tracks all investments (per address) for the later assignment of LP tokens.
7.1 REX starting price
A predefined portion of the INITIAL_LIQ_BUSD is added to the PancakeSwap liquidity pool (paired together with the corresponding amount of newly minted REX tokens) at the beginning of REX DAY 2 and create the first ever existing REX tokens - and thus make sure REX may be traded from then on.
Technically, this event will be triggered by the first contract interaction on REX DAY 2 - for example, someone participates in the auctions or claims REX from auctions or claims REX from referrals or uses any other external function of the DAILY AUCTIONS contract.
The event of adding the predefined portion of the initial liquidity will set the starting price of the REX-BUSD LP pair. There will be 7,143 REX minted per BUSD, so the price will be 1/7143 = 0.000139997 BUSD/REX.
7.2 Initial Liquidity Amounts
The INITIAL_LIQ_BUSD provided by early investors in the INITIAL LIQUIDITY phase will be between 0 BUSD and a maximum of 10,000,000 BUSD.
In case there are 0 BUSD, the following will happen: The functions managing initial liquidity will not trigger. No LP tokens will be created. Still, liquidity might be added to the LP pair with the beginning of REX DAY 2, as the addLiquidity function of the daily auctions will also try to add liquidty in that moment: the 10% of the BUSD sent to the daily auctions on REX DAY 1. So, just in case there were no INITIAL_LIQ_BUSD, the addLiquidity function of the daily auctions will still provide some liquidity to the LP pair and - in this special case - also take over the task of setting the LP pair's starting price to 0.000139997 BUSD/REX by minting 7143 REX per BUSD.
In case there are between 100 BUSD and 100,000 BUSD, all of the BUSD will be sent to the LP pair at the beginning of REX DAY 2.
In case there are more than 100,000 BUSD, the amount of BUSD sent to the LP pair at the beginning of REX DAY 2 is capped at 100,000 BUSD, so the initial liquidity in the LP pair is not too high at the very beginning. The rest of the INITIAL_LIQ_BUSD will be added daily (together with 10% of the daily BUSD from auctions), in the course of 200 days (REX DAY 3 until REX DAY 202): 1/200 each day. This shall lead to a constantly rising liquidity in the REX-BUSD LP pair.
Example:
If 1,100,000 BUSD had been sent to the contract in the LIQUIDITY PHASE in total, the contract would add 100,000 BUSD (plus the corresponding amount of 714,300,000 REX tokens) at the beginning of REX DAY 2 and then add the remaining liquidity of 1,000,000 BUSD in daily portions of 1,000,000 BUSD / 200 = 5,000 BUSD (plus the corresponding amount of REX tokens) per day over the next 200 days.
NOTE:
This "corresponding amount of REX tokens" will vary over time, most likely every day:
The REX_BUSD LP pair exists from the beginning of REX DAY 2 and most likely users will trade the token, so the RESERVES in the LP pair will vary, thus the daily amounts of corresponding REX minted (when the contract adds more liquidity every day) will no longer reflect the initial ratio of 7,143 REX per BUSD - the DAILY AUCTIONS contract will always (have to) use the actual REX/BUSD ratio of the LP pair when adding liquidity.
Rules for provisioning INITIAL LIQUIDITY:
Users providing "initial liquidty" should be familiar with impermanent loss and impermanent loss calculators (like this one)
Minimum amount per address and transaction: 100 BUSD, like in the daily auctions
Only multiples of 100 BUSD will be accepted (100 BUSD, 200 BUSD, 300 BUSD,...)
Providing liquidity in multiple transactions is possible. It adds up.
Total maximum amount per address: 500,000 BUSD
Total maximum initial liquidity: 10,000,000 BUSD
The LP tokens received in the DAILY AUCTIONS contract will be locked within the auction phase and will then be withdrawable by the liquidity providers in iterations (10% every 30 days) starting on REX DAY 223.
The advantage of providing initial liquidity in this way is that one only has to send BUSD and not the REX part of the LP pair, as the contract mints the REX part for free.
8 DAILY AUCTIONS
8.1 Auction Phase
The main part of REX supply is created and distributed via daily auctions. There are 222 auction days. Each auction day lasts 24 hours. The first auction takes place on REX DAY 1 (12:00:00 Cayman Islands time), the last auction takes place on REX DAY 222.
Each day an address may send BUSD to the contract to reserve REX.
An address may send BUSD every day, but only once a day.
The minimum participation amount is 100 BUSD.
The maximum participation amount is 50,000 BUSD (per address per day).
The daily participation limit can be raised to 100,000 BUSD when holding TREX.
Sending BUSD reserves a fraction of the daily auctioned REX. Also, addresses being used as a referrer, reserve a fraction of the daily auctioned REX (find details in the referrals section).
The assigned REX may be minted (or staked) on the next REX DAY.
Each day's auctioned REX are split amongst the auction participants and referrers of that day, in direct proportion.
Example (without MREX bonuses or referrer):
Consider a user that made a reservation on a particular auction day by sending 100 BUSD and other participants have sent 9,900 BUSD, so the total amount of BUSD sent to auction that day was 10,000 BUSD. If the total amount of new REX available that day is 200,000,000 REX, the user will be able to mint 100 / 10,000 * 200,000,000 = 2,000,000 REX.
The contract provides public functions for viewing the total amount of BUSD currently assigned to each auction day across all users, as well as the total REX available for each day.
A user will receive 2% more REX from auction for each MREX held in their wallet, up to 5 MREX - so the maximum bonus is 10% more REX from auction when holding 5 MREX.
Holding more than 5 MREX does not increase the REX bonus any more.
A user will receive 10% more REX when providing a referrer address.
The above example (with MREX bonuses and referrer):
Consider a user that made a reservation on a particular auction day by sending 100 BUSD (whilst holding 5 MREX and providing a referrer address), the contract will count the 100 BUSD as 100 BUSD +10% (MREX bonus) +10% (referral bonus) = 120 BUSD as the investment of the participant.
NOTE: Internally, the contract counts a bonus as a higher auction participation (in BUSD), 120 BUSD in the above case. Therefore the website will show higher BUSD values ("auction participation amounts") than BUSD actually sent to the contract - the bonuses have been included.
Also 10% of the participant's REX (10 REX) are reserved for the referrer.
Consider other participants have sent 9,900 BUSD to the contract, like in the example above. In sum, the total amount of "BUSD sent to auction" is now 9,900 + 120 + 10 = 10,030 BUSD ("with bonuses"). Finally, if the total amount of new REX available that day is still 200,000,000 REX, the user will be able to mint 120 / 10,030 * 200,000,000 = 2,392,821 REX.
The referrer will be able to mint 10 / 10,030 * 200,000,000 = 199,401 REX.
8.2 Daily REX
The amount of daily auctioned REX will decrease over time.
Auctioned REX amounts:
On auction day 1 there will be 200,000,000 REX in the auction.
On auction day 2, there will be 140,000,000 REX in the auction.
On auction day 3, there will be 90,000,000 REX in the auction.
After day 3, the daily amount decreases by 130,000 REX every day.
On auction day 4, there will be 89,870,000 REX in the auction.
On auction day 5, there will be 89,740,000 REX in the auction.
...
On auction day 220, there will be 61,790,000 REX in the auction.
On auction day 221, there will be 61,660,000 REX in the auction.
On auction day 222, there will only be 53,230,000 REX in the auction.
In total, 17,000,000,000 REX are claimable/mintable from REX daily auctions.
8.3 Minting/claiming REX after an auction
After an auction day has ended and the daily ratio "REX/BUSD" has been calculated for that day, users and referrers may mint their REX. The minting of REX is done on-demand by the user through the front-end website interface. The interface shows how many REX are mintable for the metamask-connected address, in total, from all past days' auction participation and/or referrals that haven’t yet been claimed.
Users may mint their REX from referrals as liquid REX immediately.
Users may also mint their REX from auction participation as liquid REX immediately.
Alternatively, users may claim their REX from auction participation as a stake, which has the advantage of making the address eligible for Personal Random Big Pay Days. Claiming REX staked will create a stake for the user, where the duration must be chosen between 222 and 3653 days.
⚠️ REX received from auctions must always be claimed staked for the address to be eligible for Personal Random Big Pay Days.
⚠️ Claiming liquid REX from auctions once will exclude the address from all further Personal Random Big Pay Days.
⚠️ The REX received from auctions must be claimed by REX DAY 259 or it is lost.
⚠️ Auction REX stakes are irrevocable: The staker will not be able to withdraw staking rewards or end the stake until the stake is mature. Still, the stake may be offered on the native STAKE DEX starting on REX DAY 111.
8.4 Referrals
The REX referral system is an incentive to help increase the amount of BUSD sent to auction and to increase the recognition and adoption of REX.
The REX contract has a unique referral system that rewards both the referrer and referee with REX and the referrer with additional BUSD (Hybrid Referral Rewards).
8.4.1 Referee Bonus: 10% in REX
If an auction participant (the "referee") has set a referrer, the participant receives a bonus of 10% more REX from that auction.
The same 10% bonus amount of REX is also credited to the referrer.
An address cannot refer itself. This is handled as non-referral.
It is not necessary for a referrer address to have taken part in an auction itself.
Users may provide a different referral address with every new auction reservation.
On each REX reservation, the user may provide a referrer's address. The REX contract then makes note of the referrer's address and associates it with the referee's token reservation. The contract also tags the user's token reservation as having been through a referral, and this reservation is credited as having been 10% more BUSD than it actually was. When the user mints their reserved tokens at the beginning of the next day, each token reservation that was through a referral will thus mint 10% more REX than if it hadn't been through a referral.
8.4.2 Referrer Bonuses: 10% in REX
The 10% more REX that a referee gets is also the amount of REX for the referrer.
Example:
The user has sent 50 BUSD and has given a valid referrer address, the user's address gets REX assigned as if 55 BUSD were sent by the address. The referrer address is assigned REX as if it had sent 5 BUSD to auctions itself.
⚠️ The REX credited from referrals must be claimed until REX DAY 259 or it is lost.
8.4.3 Referrer Bonuses: 1% to 5% in BUSD
In addition to the (10%) bonus REX for the referrer, the DAILY AUCTION smart contract reserves up to 5% of the sent BUSD (by the auction participant) for the referrer, depending on the referrer’s MREX holdings at the time of the (each) referee’s auction participation.
The BUSD not being reserved for the referrer are sent to the BUSD-Treasury directly.
If a referrer address holds 0 MREX, it gets 0% of the BUSD.
5% of the BUSD is sent to BUSD-Treasury.
If a referrer address holds 1 MREX, it gets 1% of the BUSD.
4% of the BUSD is sent to BUSD-Treasury.
If a referrer address holds 2 MREX, it gets 2% of the BUSD.
3% of the BUSD is sent to BUSD-Treasury.
If a referrer address holds 3 MREX, it gets 3% of the BUSD.
2% of the BUSD is sent to BUSD-Treasury.
If a referrer address holds 4 MREX, it gets 4% of the BUSD.
1% of the BUSD is sent to BUSD-Treasury.
If a referrer address holds 5 MREX, it gets 5% of the BUSD.
0% of the BUSD is sent to BUSD-Treasury.
If a referrer address holds more than 5 MREX, it gets 5% of the BUSD.
0% of the BUSD is sent to BUSD-Treasury.
The reserved BUSD may be withdrawn by the referrer anytime without any conditions on its use.
It is not necessary for a referrer address to have taken part in an auction itself, neither for receiving free REX, nor for receiving free BUSD. In this way, a user may send a "REX+BUSD surprise" to any wallet holder, regardless of whether they previously held REX prior to being named as a referral.
⚠️ The referrer may claim their BUSD until REX DAY 250. They become unclaimable for the referrer on REX DAY 251.
⚠️ On REX DAY 251 all unclaimed BUSD are sent to the BUSD-Treasury.
8.5 End of Auction Phase
When the final Auction Phase day (REX DAY 222) ends, no further token reservations can be made.
Reserved REX from the auctions may be fetched, by both participants and referrers, until REX DAY 259 (last day) or it is lost.
9 REX CLASSIC AIRDROP
If an address is eligible for the REX airdrop, the address may claim its assigned REX token amount, starting from REX DAY 2, any time until REX DAY 222.
The airdrop may be claimed as liquid REX in the basic airdrop amount of REX tokens, or as one REX stake with additional bonus tokens. When claimed as a stake, the stake’s duration must be chosen to be between 30 and 3653 days.
Bonus token calculation: When staking the airdropped REX for 30 days the address receives a bonus of 10% more REX tokens added to the stake’s principal. When staking for 600 days (or more), the address receives a bonus of 50% more REX tokens added to the stake’s principal.
When staking between 30 and 600 days, the bonus calculation is linear (between 10% and 50%).
When creating a REX stake from the airdrop, the usual REX STAKING mechanisms apply: Longer pays better (more SHARES, with regard to the actual SHARE PRICE), and the presence of a TREX earns 25% more SHARES. As this stake is irrevocable automatically, it receives a further bonus of 25% more SHARES (also on the TREX bonus, if applicable - which means 56.25% more SHARES in total).
The REX STAKE created from the airdrop is an irrevocable stake: The staker will not be able to withdraw staking rewards or end the stake until the stake is mature. Still, the stake may be offered on the native STAKE DEX starting on REX DAY 111.
The calculation of the airdrop numbers has been performed by the "REX Airdrop Group", an independent group of volunteers from the REX community. They explain all their findings, proceedings, blockchain analysis, calculations and explanations on their website. The airdrop website contains the REX airdrop and the BUSD airdrop.
NOTE: The BUSD airdrop for REX CLASSIC holders is not specifically part of this technical whitepaper, as it is not directly managed by the basic REX contracts. Details are published by the REX Airdrop Group.
10 RANDOM PERSONAL BIG PAY DAYS (BPD)
75% of the BUSD tokens that are sent to DAILY AUCTIONS are collected in the BUSD-POOL. Those BUSD in the BUSD-POOL are randomly redistributed (made claimable) to the eligible addresses (auction participants) in the form of Random Personal Big Pay Days.
Every 24 hours the DAILY AUCTIONS contract creates a new BPD event, where randomly selected eligible addresses receive the right to claim back (up to) 100% of their total invested BUSD - all the BUSD that it has invested into the DAILY AUCTIONS to date.
10.1 BPD distribution function
The function _createBPD of the DAILY AUCTIONS contract randomly picks an eligible address and grants that address the right to claim back all their invested BUSD ("payout"), then moves on to the next eligible address and so on, until the BUSD-POOL is empty or every eligible address has been hit or the maximum number of BigPayDays have been distributed (400 addresses every 24 hours - plus unlimited "user-triggered BPD" explained later).
The BPD amount per address is limited by two factors:
If there are 50 or more than 50 addresses eligible and the payout for a specific address exceeds 2% of the BUSD-POOL, the payout will be limited to 2% of the BUSD-POOL. This cap at 2% of the BUSD-POOL serves as whale protection and leads to the advantage that at least 50 addresses will receive a BPD every day.
If a payout would exceed the BUSD remaining in the BUSD-POOL, it will be limited to what is left in the pool.
These limitations may sometimes lead to payouts less than an address’s total BUSD investment amount.
If there are less than 50 addresses eligible, every address will receive a payout.
Every payout will be limited to 1 / number of eligible addresses.
Example: There are 10,000 BUSD in the BUSD-POOL and 10 eligible addresses. The contract will try to credit every address a claimable BUSD amount of 10,000 BUSD / 10 = 1,000 BUSD. Imagine, nine addresses sent 1,000 or more BUSD in to auctions: They will get 1,000 BUSD credited. Imagine, one address only sent 500 BUSD in to auctions before, then it will only get 500 BUSD credited. There will be an undistributed remainder of 500 BUSD, which will be carried forward to the next BPD event.
An address may be hit only once per BPD event.
However, an address may be hit every time, again and again. Therefore, it is possible that - over several BPD events - an address might receive more BUSD back than it has ever sent.
If not enough addresses are eligible for a BPD event to empty the BUSD-POOL and there are still more than 50,000 BUSD in the BUSD-POOL, anyone may call the external function _createUserBPD() to create an additional user-triggered BPD for another 222 addresses. This may be repeated until there are less than 50,000 BUSD left in the BUSD-POOL. All left BUSD-POOL balances will always be carried over to the next day - until REX DAY 250, where a remainder would be sent to the BUSD-Treasury.
10.2 BPD eligible addresses
To be eligible for BPD, an address needs to send BUSD to the daily auction and "Claim REX as a stake" the next REX DAY (or any day thereafter).
"Claiming REX as a stake" from an auction participation will create an irrevocable stake for the user and the user has to set the stake’s duration between 222 and 3653 days for such a stake. As the stake will be irrevocable, it will not be possible to withdraw staking rewards before maturity.
Still, the stake may be offered on the native STAKE DEX starting on REX DAY 111.
The event of claiming REX from auctions as a stake makes an address eligible to receive BPDs (in all future BPD events). The amount of BUSD sent to auction is saved in the originalDonation storage for that address. This originalDonation of the address is the number of BUSD the address shall receive when chosen by the random generator, as long as the address is eligible. All further auction participations will raise the addresses' originalDonation and every personal BPD tries to pay back the originalDonation every time.
Being eligible once, an address will always remain eligible for BPD - given it never claims liquid REX from auctions. The event of claiming liquid REX from auctions makes an address ineligible to receive any future BPDs. All BUSD the address has been credited from past BPDs will still be claimable for that address (until REX DAY 250).
The BPD BUSD is not distributed or sent automatically, but must be claimed.
⚠️ If an address hasn’t claimed their BUSD by REX DAY 250, the BUSD becomes unclaimable.
⚠️ On REX DAY 251 all unclaimed BUSD will be sent to the BUSD-Treasury.
11 BUSD-Treasury
The BUSD-Treasury is a pool of BUSD that will be granted to all participants of the daily auctions who always claimed their REX from auctions as a stake and who never claimed their REX from auctions liquid and who never had a Big Pay Day.
[Edited March 11, 2023: The above sentence is from an old paper version and unfortunately has not been updated to the new contract behavior. Correct is: "All auction participants who did not receive a Big Pay Day will receive their share from the Treasury". Notably, his discrepancy was not noticed by the three audit firms. Comment: The Treasury was designed to return all (!) remaining BUSD to auction participants who did not receive a Big Pay Day (after the contract has fulfilled its task of managing the auction phase) - instead of keeping the BUSD in the project - and this is still what the contract does. It has to be admitted that the paper here was not 100% correct, but anyway all BUSD will be given to the participants.]
The BUSD-Treasury comprises
0% to 5% of the daily sent BUSD (see Referrer Bonuses)
all unclaimed BUSD from Random Personal Big Pay Days
all unclaimed BUSD from referrals
The claimable BUSD amount of an address is in proportion to what that address invested in to daily auctions relative to the total invested BUSD of the other eligible addresses. It might be the case that the eligible addresses receive more BUSD than they invested.
The BUSD-Treasury has been "opened" on REX DAY 252.
⚠️ The BUSD must be claimed within 7 days (REX DAY 258).
⚠️ On REX DAY 259 all unclaimed BUSD are sent to the MARKETING FUND.
12 BEP20 FUNCTIONALITY
REX is a BEP20 token that fully conforms with BEP20/ERC20 token standard.
Please read Binance FAQ to learn more.
13 ACKNOWLEDGMENTS
Everyone helping blockchain technology evolve and proceed shall be thanked.
Especially:
OpenZeppelin — for your development of essential Solidity smart contract interfaces and building blocks.
The REX Telegram crowd — for your steady stream of valuable ideas, constructive criticism, honest feedback, witty banter, and comic relief throughout the design and development process.
14 AVAILABILITY
The web version of this paper is hosted at rex.io/paper.
15 APPENDICES
15.1 Appendix A: Terminology
REX — the token and contract described herein.
PRINCE — the base unit of the REX token, analogous to wei for $ETH, or satoshi for $BTC.
One REX equals one quintillion PRINCES (1,000,000,000,000,000,000).
STAKE — a time locked deposit of REX which earns staking rewards over time.
15.2 Appendix B: Coding Standards
The REX contracts are written entirely in Solidity and compiled with solc 0.7.4.
The code should adhere to the formats prescribed by the style guide section of in the official Solidity 0.7.4 documentation.
All public interfaces (at a minimum) should be annotated using the NatSpec format.
Unit tests should provide 100% coverage of the source code. All conceivable edge and corner cases should be covered.
Function and variable names should convey their purpose and usage as clearly and tersely as possible, in plain English. Avoid using digits, unnecessary abbreviations, acronyms, shorthand, or slang.
Functions should be as short as is practical. They should do what their name implies, and not much else. A good rule of thumb is that a function should try to be viewable in its entirety on a typical monitor, at a typical font size, if at all possible.
Comments should be employed wisely. Don't comment to explain what code does. Good function and variable names will accomplish that. Rather, use comments to explain why something is coded a certain way. Use comments to explain any non-obvious technical points or decisions involved in a piece of code.
require() function calls should return a short but descriptive error message.
Avoid duplicated code (don't repeat yourself).
Wherever possible and practical, write with gas efficiency as a priority. Some parts of the code may sacrifice minuscule gas efficiencies for various important reasons. When deemed to be of greater value, code legibility, clean architecture, and a straightforward and fully featured end-user experience should take priority over such tiny gas savings.