Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
update kip160 about front table and rationale
Browse files Browse the repository at this point in the history
  • Loading branch information
yoomee1313 committed Apr 22, 2024
1 parent a1c8190 commit 515b2b3
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions KIPs/kip-160.md
Original file line number Diff line number Diff line change
@@ -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
---

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 515b2b3

Please sign in to comment.