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

💥 Add a pausable Contract Module #297

Merged
merged 10 commits into from
Jan 22, 2025
Merged

💥 Add a pausable Contract Module #297

merged 10 commits into from
Jan 22, 2025

Conversation

pcaversaccio
Copy link
Owner

@pcaversaccio pcaversaccio commented Jan 21, 2025

🕓 Changelog

This PR adds a pausable contract module which can be used to implement an emergency stop mechanism that can be triggered by an authorised account. Please note that this contract does not include an access control mechanism (e.g., ownable) for triggering the emergency stop. Such functionality must be implemented by the importing contract, for instance:

from snekmate.auth import ownable
initializes: ownable

from snekmate.utils import pausable
initializes: pausable

exports: ...

...

@external
def pause():
    ownable._check_owner()
    pausable._pause()

@external
def unpause():
    ownable._check_owner()
    pausable._unpause()

Additionally, the version pragmas in all Vyper source files have been updated to target the latest master version v0.4.1rc2, aligning with the release of Vyper's newest release candidate version v0.4.1rc1. Eventually, all submodules have been updated to their most recent commits.

🐶 Cute Animal Picture

Signed-off-by: Pascal Marco Caversaccio <[email protected]>
@pcaversaccio pcaversaccio self-assigned this Jan 21, 2025
@pcaversaccio pcaversaccio added documentation 📖 Improvements or additions to documentation feature 💥 New feature or request labels Jan 21, 2025
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
@pcaversaccio pcaversaccio added the dependencies 🔁 Pull requests that update a dependency file label Jan 21, 2025
@pcaversaccio pcaversaccio added this to the 0.1.1 milestone Jan 21, 2025
@pcaversaccio pcaversaccio marked this pull request as ready for review January 21, 2025 14:03
Copy link

@AlbertoCentonze AlbertoCentonze left a comment

Choose a reason for hiding this comment

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

Left a few comments with very minor stuff, awesome work as usual! Feel free to ignore :)

test/utils/Pausable.t.sol Show resolved Hide resolved
src/snekmate/utils/pausable.vy Outdated Show resolved Hide resolved
test/utils/Pausable.t.sol Show resolved Hide resolved
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
@pcaversaccio pcaversaccio added the ci/cd 👷‍♂️ CI/CD configurations label Jan 22, 2025
@pcaversaccio pcaversaccio merged commit 7bbc024 into main Jan 22, 2025
14 of 15 checks passed
@pcaversaccio pcaversaccio deleted the feat/pausable branch January 22, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd 👷‍♂️ CI/CD configurations dependencies 🔁 Pull requests that update a dependency file documentation 📖 Improvements or additions to documentation feature 💥 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants