logo
bg
Home Blog Staking on the Shoulders of Giants - A $HIT introduction to Rug-Proof Staking
Jul 26, 2024
Staking on the Shoulders of Giants - A $HIT introduction to Rug-Proof Staking
Scrypto makes not only building, but modifying existing code so straightforward and intuitive, that small teams and even one-person-bands can make significant contributions to the Radix platform.
$HIT, memecoin, Staking, Rug-Proof, Scrypto
Felix_xrd

Welcome $HITTERS

It is an absolute delight to roll out Addix’s novel Rug-Proof Staking Smart Contract. Ok, there’s a lot of words there, let’s break that down.

First of all, we are all Addix to some extent. The meme was born out of recognition of this. No amount of FUD, Wen X, or prohibited p-word main thread discourse could keep us away. We’ve seen the light, we’re hooked, and in many cases, to the maxi.

Keen to include features beyond the memecoin staple of ‘number go up’, the first piece of functionality we decided on was an easy choice; and all credit must begin with the Titan that is Timan.

Staking on the Shoulders of Giants

Astrolescent is a Decentralised Exchange Aggregator, which works by bundling together all liquidity from the top DEXes on Radix, and creating a route for best value. Timan introduced a brilliant and elegant staking feature, which we forked. “We” very much being the Royal version - I struggle to even hold a fork. Here we meet our second giant; Don Marco.

It's Staking Jim, But Not As We Know It

The original Astrolescent contract requires the creator of the token to hold all of the future staking rewards in their wallet. The power of scrypto, in the hands of an excellent developer, meant that in 10 additional lines of code, Don Marco created a "rug proof" fork, where the owner can deposit all of the future staking rewards in the staking smart contract, with no way to get them back. Later this can be distributed as part of the previously deposited amount. The nature of decentralisation means it’s impossible to know if this has been done before. To our knowledge, this is the first time - which we are really excited about!

Why is Rug-Proofing Important

Unfortunately, crypto is littered with rugs - bad actors who claim to have the community interests at heart, then pull the rug out from underneath everyone. Within crypto, memecoins tend to be where most rugs occur. A staking contract like this could be beneficial for the whole memecoin scene. If a token is to have a staking feature, even if it’s a small percentage of the total supply, there is no reason for it not to be placed into a rug-proof contract. Don’t just say you won’t rug, sign it!

What is a Rug-Proof Staking Smart Contract?

Users' stakes are deposited in a OneResourcePool, which is a blueprint developed by the Radix team, called "sastrl"

The badge holder then deposits the rewards in a Vault (a simple coin storage) called "future_rewards"

The only way out of "future_rewards", the "take" method, is used here

Coins taken go directly into "sastrl" via the "protected_deposit" method.

The difference among "protected_deposit" and the "contribute" method used by users is that "contribute" mints new Staked HIT and returns them while "protected_deposit" returns nothing.

Ok - Now Explain Like I'm 5, please

I plan to give out sweeties to everyone who has supported me. Rather than keeping the sweets in a draw in my room, where I can pick at them, I lock them inside a gumball machine, then flush the key down the loo. I am unable to take the sweets back out, even though I put them in there. All I can do is twist the mechanism, so the sweets are handed out to the people who rightfully deserve them.

It’s inevitable

There is no other platform out there, where the events above could have unfolded like they did. Firstly, two OGs directly and indirectly helping out a burgeoning new project. Radix is unique in terms of community, and the collaboration between projects is widespread. People recognise that we are not in competition, but in collaboration with each other. This might be because we’ve had years of low-key frustration, or simply because people here are cool, but I also think it’s because of the elegance of Scrypto.

Scrypto’s intuitive nature facilities collaboration. If someone can add a few lines of code and fork a contract for a specific purpose, then the demands of that piece of work is reduced, and the chances of collaboration increase. The rate of growth, new features and advances then becomes exponential as more and more builders arrive.

This is why Radix is inevitable

logo

© 2023 Shardspace Ltd. All Rights Reserved

runs on radix