5 ms·
Another issue I have been wondering about: what prevents people from simply cloning smart contracts? Like how can one even make money with them? Suppose I make
by kkjjkgjjgg 5y ago
Another issue I have been wondering about: what prevents people from simply cloning smart contracts? Like how can one even make money with them? Suppose I make a contract that provides a useful service, and in return asks for a 1% fee on the "money" it has processed. Why wouldn't somebody just clone the contract and set the fee to zero in the clone, and people just use the clone?
- mattdesl 5y agoThis does happen and tends to create competition. If your entire service is a very thin wrapper around a smart contract, the market may decide that a fork with equivalent functionality and lower fees is more worth using. On the other hand, if your service also provides other features on top of the contract (web/native interfaces, UX, hosting, ongoing development, customer support, and so on) then it may be hard to build a competitor simply by forking the underlying contract.
- alexb_ 5y agoI'm pretty sure only the bytecode is actually stored on the blockchain, not the source behind it. Cloning a smart contract would be as hard as decompiling any program. Although simple changes like what you are talking about (setting the fee to 0) sounds like it would be done almost immediately. It would probably violate whatever software license is being used, but... woo decentralization! No central authority to enforce these laws... It's not something I'm even close to knowledgeable about though, so if I'm wrong someone please correct me.
- ahtihn 5y ago> I'm pretty sure only the bytecode is actually stored on the blockchain, not the source behind it. Why would anyone trust a smart contract that doesn't provide readable source for auditing purposes? While only byte code is stored on chain, generally the source is available on github.
- alexb_ 5y agoSame reason we trust programs that are closed source: because people will always want what is the most efficient solution. And we don't really, it's just completely blind trust, but that's just how it works.
- pests 5y agoDeployed contracts are bytecode. It's up to the author to publish it on sites like etherscan. Yes decompilers exist I'm sure at some level of reasonable output. That's a problem that has existed in all paid software. Or like my sibling said you supplement the contract with a good UI, additional tools, good branding, etc. But then on the other hand open source exists with contracts too. Almost every defi swap on multiple chains (evm compatible) is based off Uniswap. There's multiple versions and the clones have upgraded as needed and it's all accepted. Makes integration with existing explorers and wallets easier as well. Most support these uniswap-compatible contract clones because the API is the same.
- kkjjkgjjgg 5y agoHm that seems to defeat the whole purpose of transparency and trustlessness? What is the point of a contract whose contents I can't read? Who would "sign" (interact with) such a thing? But others said the same, so it may be true. Perhaps for saving storage/bandwidth, and you can simply verify that it is the contract corresponding to some source code that has been published elsewhere?
- pests 5y agoEh, they exist. Not many people even know how to check the source or even if it's been verified. Saving bandwidth is definitely a reason. The EVM call to create the contract charges a gas fee per byte. Currently etherscan and other chain explorer sites will recompile your provided source (and compiler options) and ensure your deployed bytecode matches their results. If so they publicly provide the source and a nice verification checkbox. Some also give you (the public) tools to make read/write API calls to the contract directly by introspecting the API.
- pests 5y agoMost projects do opt in to transparency by verifying the source. Its up to you who you support.
- chrisco255 5y agoPrimarily network effects. Uniswap v2 was cloned by Sushi (and many others), with the difference being that they offered a token to their users for migrating liquidity over from Uni. It worked, at first, until Uni responded in kind and airdropped a token to their user base, which helped them to retain loyalty. But the two have since diverged in product depth and breadth with Uniswap taking a deeper AMM approach (with concentrated liquidity) and Sushi becoming a broader AMM available on multiple blockchains. That is to say, that even if a fork occurs, if the product is sufficiently complex, it's going to need improvements and users are going to stick with the contracts with the deepest assurances via reputation. With AMMs in particular, liquidity is a big factor. It would be tough to enter the Ethereum AMM game now without something novel to add, as you would struggle to attract liquidity otherwise. Liquidity begets liquidity.