forked from NearDeFi/ft-lockup-contract
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce contract update via manager
generating and adding public keys for signing deploying contracts to named accounts testing simple update call added test for multisig redeploy debugging promise call fixed exceeded gas error, added full update test added lockup test, migrated to new integration utils adding lockups added helper contract dependency deploy and migrate to multisig wip update with multisig integration test
- Loading branch information
Showing
31 changed files
with
1,171 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use model::migration::OldState; | ||
use near_sdk::{collections::UnorderedSet, env, env::log_str, near_bindgen, AccountId}; | ||
|
||
use crate::{Contract, ContractExt, StorageKey}; | ||
|
||
#[near_bindgen] | ||
impl Contract { | ||
#[private] | ||
#[init(ignore_state)] | ||
pub fn migrate(manager: AccountId) -> Self { | ||
log_str("Migrate"); | ||
|
||
let old_state: OldState = env::state_read().expect("Failed to read old state"); | ||
|
||
Contract { | ||
token_account_id: old_state.token_account_id, | ||
lockups: old_state.lockups, | ||
account_lockups: old_state.account_lockups, | ||
deposit_whitelist: old_state.deposit_whitelist, | ||
draft_operators_whitelist: UnorderedSet::new(StorageKey::DraftOperatorsWhitelist), | ||
next_draft_id: old_state.next_draft_id, | ||
drafts: old_state.drafts, | ||
next_draft_group_id: old_state.next_draft_group_id, | ||
draft_groups: old_state.draft_groups, | ||
manager, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.