Why do you need a pause function and when do you use it in contract?
Why do you need a pause function and when do you use it in contract?
Loading saved threads...
Dobyb · External communityPost link
External question — Ethereum Stack Exchange
Author: Dobyb
Original post: https://ethereum.stackexchange.com/questions/122851
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
It's my first time writing a contract and I am playing with it, working on creating a minting NFT contract. I did a research and understood that the pause function is to pause the contract, pausing all the tokens that belong to the contract. So why do you really need this pause function and when do you use it? I already implemented a logic that sets presale duration and end time, etc. Is pause used to pause the contract to save the gas fees between presale and public sale for my case? If so, would it completely stop the transfer and even prevent the nft being transferred from one wallet to another?
Quote
Report
rohit01 · External communityPost link
External answer — Ethereum Stack Exchange
Author: rohit01
Original post: https://ethereum.stackexchange.com/a/135173
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
when we apply pause functionality on some function in our smart contract , it will restrict their ( function's) visibility for a while or can temporarily remove a function's ability to work without impacting other smart contract's functions and without opting to destroy the entire contract and start from scratch.
ex.
Imagine your smart contract offers minting an NFT or sell goods then apply pausing functionality on these sales or minting can be profitable for you.
Quote
Report
Canard Coca · External communityPost link
External answer — Ethereum Stack Exchange
Author: Canard Coca
Original post: https://ethereum.stackexchange.com/a/165012
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
This article can effectively answer your questions.
https://www.halborn.com/blog/post/how-to-pause-a-smart-contract
Quote
Report
Post Reply
Checking account access…