Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration to update a number of users total allocations #30

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

dancreee
Copy link
Contributor

A number of Labs members gave up a part of their allocations on the Labs fundraise, this migration is claiming back the required allocation portion to re-allocate investors. This was needed to be done as a migration because some of these allocations had already vested more than what they should have now had... and as a result terminating the position with existing vested amount is not sufficient

@dancreee
Copy link
Contributor Author

this is what the execute msg will look like:

{
  "v1_1_0_to_v1_1_1": {
    "position_alterations": [
      {
        "addr": "mars1effmxc0hvaxtmmec9x55ehxz07m470a7atygm8",
        "total_old": "11799288000000",
        "total_new": "10587828000000",
        "reclaim": "1211460000000"
      },
      {
        "addr": "mars18sp4f5nqdc828ffmyht7m024rxyfsx3v8c43z5",
        "total_old": "3458333000000",
        "total_new": "3332854000000",
        "reclaim": "125479000000"
      },
      {
        "addr": "mars18tjvkygwv6kncq47k86ad90gsewn6ww3as2uue",
        "total_old": "2875000000000",
        "total_new": "2629498000000",
        "reclaim": "245502000000"
      },
      {
        "addr": "mars1c2azjxyl99eaf77wg8sd02h8qlcwz2dxf3z24f",
        "total_old": "14111790000000",
        "total_new": "13284321000000",
        "reclaim": "827469000000"
      },
      {
        "addr": "mars1kulelj5sk5r7l4vzgccfu9wdswsjcg2u97fzww",
        "total_old": "4609220000000",
        "total_new": "4378952000000",
        "reclaim": "230268000000"
      },
      {
        "addr": "mars1frc3w749jtqv8p0dlx5sr3rs0xjw6x5vuzgs6w",
        "total_old": "16858380000000",
        "total_new": "15742912000000",
        "reclaim": "1115468000000"
      },
      {
        "addr": "mars150n3ck6darcgy8w3eupqtxk8j34ky9csjvnv77",
        "total_old": "7125000000000",
        "total_new": "6715830000000",
        "reclaim": "409170000000"
      },
      {
        "addr": "mars1ps573wtcc49n8jhpq7jznn63cls6g2ygv0pwql",
        "total_old": "11799288000000",
        "total_new": "10587828000000",
        "reclaim": "1211460000000"
      },
      {
        "addr": "mars1d69qre3vke0vhxl776e4xxjkcru99tqavfr2ct",
        "total_old": "7813575000000",
        "total_new": "7084253000000",
        "reclaim": "729322000000"
      },
      {
        "addr": "mars16aaenku57ln8zl63gxcx9dml25kvtf3eggqkk4",
        "total_old": "11933460000000",
        "total_new": "10722000000000",
        "reclaim": "1211460000000"
      }
    ],
    "total_reclaim": "7317058000000"
  }
}

@dancreee
Copy link
Contributor Author

successfully executed on mainnet fork:

marsd query tx --type hash C9C02C1CE39C63D6814F8F309A7F007A9879D9C8C1E28FE45F37C8881D02FECD --node https://cradle-manager.ec1-prod.newmetric.xyz:443/cradle/proxy/3ed3f61e-ade8-47b5-b81f-95131a115b4a --chain-id mars-1

v1_1_0::migrate(deps)
pub fn migrate(deps: DepsMut, _: Env, msg: MigrateMsg) -> Result<Response> {
match msg {
MigrateMsg::V1_0_0ToV1_1_0 {} => v1_1_0::migrate(deps),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we set version numbers in the cargo.toml meant the old test failed, it was checking for 1.1.0 but since the cargo is now set to 1.1.1 that is what gets set regardless of what migration you are doing, I cross-referenced to the other contract migrations, e.g. oracle contract and seems to be doing the same thing so just left it as is

@dancreee dancreee requested review from piobab and markonmars January 23, 2024 18:01
contracts/vesting/tests/tests.rs Outdated Show resolved Hide resolved
contracts/vesting/tests/tests.rs Outdated Show resolved Hide resolved
@piobab
Copy link
Collaborator

piobab commented Jan 25, 2024

LGTM

@dancreee dancreee merged commit a6784f4 into main Jan 25, 2024
5 checks passed
@dancreee dancreee deleted the migration/update_user_allocations branch January 25, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants