A New Way for Devs to Earn

Sell code on the blockchain securely and trustlessly, using Buyable.sol

Adrian Lawson
3 min readAug 26, 2022

Freelance developers enjoy a lot of benefits over 9–5ers. Flexible hours, being their own boss, being able to be selective about what they work on are just a few examples. But there are some downsides to working as a freelance developer, as well. The main downside being the uncertainty of getting paid. If you are lucky enough to have consistent freelance work, you still need to trust that clients will pay for your work. You can get paid upfront, but then the client needs to trust that you will do the work after being paid. There needs to be a trustless way for both parties to get what they are due. Now there is with Buyable.sol!

Buyable.sol is a library contract that any Solidity contract can benefit from.

With just about a line of code, you can make your smart contract purchasable by anyone else at whatever price you determine. This has huge implications for how developers get paid for their work. For example, if you develop and deploy a smart contract for a client, using Buyable.sol, you can keep ownership of that smart contract until they pay your predetermined price. Likewise, if you hire a smart contract developer, you can take your time reviewing the smart contract and even get another developer to audit it before you pay for ownership of that contract.

If you are not a freelance developer, Buyable.sol can still work for your benefit.

Let’s say you have a brilliant idea for a decentralized application (DApp). With Buyable.sol, you can build it, deploy it, and sell it for what you feel it is worth. Beyond that, you will earn a royalty on every time that contract is sold afterwards! Think of it as a decentralized shark tank.

How do you use Buyable.sol?

Download the GitHub repository and copy the files in the ‘contracts’ folder to your workspace (except for BuyMe.sol, which is just an example contract). From there, just import the file into your Solidity contract and inherit from it.

And that’s it! Once you have deployed your smart contract, you can call the ‘sellContract’ function, inputting the price of your contract in Wei. You can also call the ‘setFee’ function and determine what percentage royalty you want to receive on any subsequent sales.

If you want to test out using Buyable.sol, follow the steps above and deploy to the Goerli Testnet. Then go to this website and enter your contract’s address.

Comment your Buyable contracts’ addresses below so we can all buy each other’s smart contracts! (On the Goerli Testnet, of course)

--

--

Adrian Lawson
Adrian Lawson

Written by Adrian Lawson

Building Web3 solutions to Web2 problems

No responses yet