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

Update vesting contract #28

Merged
merged 7 commits into from
Aug 31, 2023
Merged

Update vesting contract #28

merged 7 commits into from
Aug 31, 2023

Conversation

larry0x
Copy link
Contributor

@larry0x larry0x commented Aug 25, 2023

We want to extend unlocking by 3 months. Currently the contract does not allow changing the unlocking schedule.

This PR adds a method to allow the contract owner to change the config.

@larry0x larry0x marked this pull request as ready for review August 31, 2023 04:50
@larry0x larry0x requested review from piobab and brimigs August 31, 2023 04:51
contracts/vesting/src/contract.rs Outdated Show resolved Hide resolved
@dancreee
Copy link
Contributor

@piobab @larry0x can you decide what to do about the failing build due to drop in code coverage

let cfg = CONFIG.load(deps.storage)?;

// only owner can update config
if info.sender != cfg.owner {
Copy link
Collaborator

Choose a reason for hiding this comment

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

btw in cosmwasm there is new macro:

ensure_eq!(info.sender, cfg.owner, Error::NotOwner);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At a later point we can update all contracts to use this

};

CONFIG.save(deps.storage, &cfg)?;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add set_new_version

@piobab
Copy link
Collaborator

piobab commented Aug 31, 2023

@larry0x @dancreee pushed one commit for migration update & tests. @larry0x feel free to accept it or not.

@piobab
Copy link
Collaborator

piobab commented Aug 31, 2023

@larry0x if you have problem with migration "unsupported optcode" on mars hub downgrade rust-optimizer.

@larry0x
Copy link
Contributor Author

larry0x commented Aug 31, 2023

@larry0x @dancreee pushed one commit for migration update & tests. @larry0x feel free to accept it or not.

Very nice

@larry0x larry0x merged commit 93771fa into main Aug 31, 2023
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