Skip to content

Conversation

@meomeocoj
Copy link
Member

@meomeocoj meomeocoj commented Feb 1, 2024

What this pr do?

  • Add period unbonding-time when register staking asset
  • Add LOCK_INFO which is multiple array of lock asset
  • Unbond will move the token to lock and return all the reward and all when lock.unlock_time < env.block.time

@meomeocoj meomeocoj requested review from ducphamle2, lehieuhust and tubackkhoa and removed request for ducphamle2 February 1, 2024 11:28
}

for res in unbond_responses.into_iter() {
response = response.add_attributes(res.clone().attributes);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to add_messages here as well for the _unbond messages?

),
ExecuteMsg::UnbondLock {
staking_token,
lock_id,
Copy link
Collaborator

@ducphamle2 ducphamle2 Feb 1, 2024

Choose a reason for hiding this comment

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

For simplicity I think we can re-use the ExecuteMsg::Unbond by locking new amounts then unbonding old locks all in the same tx

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is similar to MsgDelegate, where we delegate new tokens while withdrawing all rewards

amount,
unlock_time,
},
)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can refactor the unbond_lock logic so we can call it in here

tubackkhoa
tubackkhoa previously approved these changes Feb 5, 2024
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

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.

4 participants