Global Contracts
If you've ever deployed the same contract code to multiple accounts, you’ve likely noticed that each deployment requires you to pay the full storage cost again.
Imagine that you want to deploy the same 500 KB contract to three accounts: each deployment pays 5 NEAR for the storage — a total of 15 NEAR is locked just to hold identical code. Global Contracts eliminates this redundancy by allowing the same contract code to be shared across multiple accounts, so storage cost is paid only once.
In this tutorial you'll learn how to deploy and use a global contract by Account ID or by Hash, depending on your needs.
Global Contract types
- By Account: an upgradable contract is published globally under a specific account ID.
- By Hash: an immutable contract is deployed globally and identified by its code hash.