-
Notifications
You must be signed in to change notification settings - Fork 6
Upgrading Advertisement contracts
As explained in Advertisement contract architecture section, Advertisement contract is composed by three contracts, Advertisement contract, Advertisement Storage contract and Advertisement Finance contract. This separation allows for upgrade of a single contract when any of those contracts need upgrades without the need for redeploying all contracts.
Considering Advertisement Storage and Advertisement Finance contracts don't need upgrades the contracts' owner needs to perform the following calls in this exact order:
- Deploy Advertisement contract with the correct Advertisement Storage and Advertisement Finance contracts' addresses
- (Optional) If the new contract is required to keep track of campaign ids held by the old Advertisement contract, call
importBidIds
function of the new Advertisement contract with the old Advertisement contract address. Note: TheimportBidIds
function does not check for duplicates. - Call
addAddressToWhitelist
function of Advertisement Storage contract with the new Advertisement contract address - Call
setAllowedAddress
function of Advertisement Finance contract with the new Advertisement contract address
This operation will preserve all campaigns stored in Storage and Finance contracts.
Contracts' owner needs to perform the following calls in this exact order:
- Deploy new Advertisement Finance contract
- Call
setAdsContractAddress
on the new Advertisement Finance contract with the current Advertisement contract address - Call
upgradeFinance
on the current Advertisement contract
This operation will preserve all campaigns stored in Storage and Finance contracts.
This operation will cancel all campaigns stored in the smart contracts.
Contracts' owner needs to perform the following calls in this exact order:
- Deploy Advertisement Storage contract
- Call
setAllowedAddresses
function of the new Advertisement Storage contract with the Advertisement contract address - Call
upgradeStorage
function of Advertisement contract with the new Advertisement Storage contract address
Contracts
- Address Proxy
- Advertisement
- Advertisement Storage
- Advertisement Finance
- AppCoins IAB
- AppCoins Timelock
- AppCoins Credits Balance
Extended Contracts
Development
Other