diff --git a/KIPs/kip-160.md b/KIPs/kip-160.md index a9aa1419..fe9ca41c 100644 --- a/KIPs/kip-160.md +++ b/KIPs/kip-160.md @@ -1,6 +1,11 @@ --- kip: 160 title: An Update of Treasury Fund Rebalancing +author: Yumiel (@yoomee1313) and Ollie (@blukat29) +status: Final +type: Standards Track +category: Core +created: 2024-04-22 requires: 103 --- @@ -66,17 +71,17 @@ While executing the core logic of the KIP-103 treasury rebalance, the unintended The following pseudocode illustrates how to define a contract callers for each rebalancing. ```golang RebalanceTreasury() { - if current block number is equal to KIP-160 hard fork block number { - // Define the caller for the NewTreasuryRebalanceV2 contract - caller, err = system_contracts.NewTreasuryRebalanceV2Caller(chain.Config().RandaoRegistry.Records["kip160"], backends.NewBlockchainContractBackend(chain, nil, nil)) - } - if current block number is equal to KIP-103 hard fork block number { - // Define the caller for the NewTreasuryRebalance contract - caller, err = system_contracts.NewTreasuryRebalanceCaller(chain.Config().Kip103ContractAddress, &Kip103ContractCaller{state: state, chain: chain, header: header}, - } - if err != nil { - stop - } + if current block number is equal to KIP-160 hard fork block number { + // Define the caller for the NewTreasuryRebalanceV2 contract + caller, err = rebalance.NewTreasuryRebalanceV2Caller(chain.Config().Kip160ContractAddress, backends.NewBlockchainContractBackend(chain, nil, nil)) + } + if current block number is equal to KIP-103 hard fork block number { + // Define the caller for the NewTreasuryRebalance contract + caller, err = NewKip103ContractCaller(state, chain, header) + } + if err != nil { + stop + } } ``` ## Test cases