Skip to content

Commit

Permalink
fix(tvm): impl the buggy origin opcode before multisig
Browse files Browse the repository at this point in the history
Fix #42
  • Loading branch information
andelf committed Nov 4, 2020
1 parent 1591e54 commit a7352a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions opentron/src/manager/executor/actuators/smart_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ fn get_current_tvm_upgrade(manager: &Manager) -> TvmUpgrade {
stake: false,
istanbul: false,
asset_issue: false,
multisig: manager.state_db.must_get(&keys::ChainParameter::AllowMultisig) != 0,
}
}

Expand Down
5 changes: 5 additions & 0 deletions tvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub struct TvmUpgrade {
pub istanbul: bool,
/// AllowTvmAssetIssueUpgrade
pub asset_issue: bool,
/// AllowMultisig
pub multisig: bool,
}

impl TvmUpgrade {
Expand All @@ -48,6 +50,9 @@ impl From<TvmUpgrade> for Config {
panic!("inconsistent TVM state");
}
let mut config = Config::tvm();
if upgrade.multisig {
config.has_buggy_origin = false;
}
if upgrade.asset_transfer {
config.allow_tvm_asset_transfer();
}
Expand Down

0 comments on commit a7352a4

Please sign in to comment.