Hey everyone, my friend & colleague @razgraf and I created Sablier. We call it “the protocol for real-time finance”.
How it Works
Say Alice wants to pay Bob a salary worth 3,000 DAI over 30 days:
- Alice locks-up the salary in Sablier and sets the “streaming” duration to 30 days
- After 1 second, the contract will “stream” a tiny amount of DAI to Bob (around 0.0011574074 DAI)
- After 1 day, the contract will stream 100 DAI to Bob, the remaining 2,900 DAI still belonging to Alice
- After 5 days, the contract will stream 500 DAI to Bob, the remaining 2,500 DAI still belonging to Alice
- At the end, Bob receives the 3,000 DAI, *if* Alice hasn’t cancelled the payment
See this short video for a demo.
Why it matters
The salary use case from above is just one example, as Sablier is actually a new financial primitive that makes the passage of time itself the trust-binding mechanism.
Sablier establishes trust between strangers in ways that hadn’t been possible before:
- Freelancing
- Mentoring
- UBI payouts
- Rent
- Lending
- Insurance
- Subscriptions
- Parking lots
- …
How we use OpenZeppelin
Sablier.sol (money streaming engine)
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/utils/ReentrancyGuard.sol";
Payroll.sol (dapp proxy)
import "@openzeppelin/contracts-ethereum-package/contracts/GSN/bouncers/GSNBouncerSignature.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
Gas Station Network
In Payroll.sol
, we implemented the acceptRelayedCall
function, so that we can subsidise the gas costs for our premium plan users.
Initializability
Some of our contracts inherit from Initializable.sol
, but right before the launch we decided not to make the contracts upgradeable. We’re a small startup and can’t afford the responsibility that inexorably comes with the power of upgradeability.
Misc
We also forked Ownable
, Pausable
and PauserRoler
and removed the renounce function, as per the discussion in Contract request: Ownable without `renounceOwnership`.
Links
If you have any questions, ideas, or issues, ping us on one of the channels below. We’d love to hear from you.
- Dapp: pay.sablier.finance
- Blog: medium.com/sablier
- GitHub: https://github.com/sablierhq/sablier
- Twitter: @sablierhq
- Telegram: t.me/sablier
- Discord: discord.gg/bsS8T47