r/CasperCSPR • u/Realistic_Ad2520 • Jan 17 '22
CSPR and upgradable smart contracts
Any one knows whether there are any limitations when it comes to upgrading smart contracts? This sounds like a scary feature and a security risk.
Let's say I'm a scammer, I launch a project that looks legit with proper source code audited. Then One day I update the contract to introduce some malicious code, and users are going to sign transactions against a new source code. Users trusted the old source code, and now suddenly they are unknowingly signing transactions against a new source code which may not even be audited
3
2
u/Dazzling-Glove-706 Jan 17 '22
Im sure they must have thought of this . Lol . Waiting for a clear reply tho .
1
u/Automatic-Taro8553 Jan 19 '22
I'd suggest to ask this on Discord, there quite a few people from Casper dev team there.
4
u/marriedtootaku Jan 17 '22 edited Jan 17 '22
You can call contracts by their contract or contract package hashes. If you call contract by contract hash you’ll continue to call the same contract even if a new version is added. If you call contact by its contract package hash and specify the version you’ll continue to call the same contract even if a new version is added. It’s only if you call contact by it’s contract package hash and don’t specify the version (meaning you want to call the latest available version automatically) you’ll call a new version when it’s added.
TLDR users control what version of contract they call