Created
October 27, 2021 17:59
-
-
Save ethanfrey/49879d2e2548870eb3d5a3d3d2895da7 to your computer and use it in GitHub Desktop.
Example sudo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[entry_point] | |
pub fn sudo(_deps: DepsMut, _env: Env, msg: SudoMsg) -> Result<Response, HackError> { | |
match msg { | |
// you certainly don't want just anyone calling this | |
SudoMsg::TakeFunds { recipient, amount } => { | |
let msg = BankMsg::Send { | |
to_address: recipient, | |
amount, | |
}; | |
Ok(Response::new().add_message(msg)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment