pub fn claim_admin(
    deps: DepsMut,
    info: MessageInfo,
    env: Env,
    contract: String,
) -> Result<Response, ContractError> {
    let sender_raw: CanonicalAddr = deps.api.addr_canonicalize(info.sender.as_str())?;

    if !is_addr_authorized(deps.storage, sender_raw, env.block.time.seconds()) {
        return Err(ContractError::Unauthorized {});
    }

    Ok(Response::new()
        .add_message(CosmosMsg::Wasm(WasmMsg::UpdateAdmin {
            contract_addr: contract.to_string(),
            admin: info.sender.to_string(),
        }))
        .add_attributes(vec![
            attr("action", "claim_admin"),
            attr("contract", contract),
        ]))
}
/// An `authorized_address` can claim admin privilages on a `contract` during the auth period
An `authorized_address` can claim admin privilages on a `contract` during the auth period
An ` authorized_address ` can claim admin privilages on a ` contract ` during the auth period
pub fn claim_admin(
    deps: DepsMut,
    info: MessageInfo,
    env: Env,
    contract: String,
) -> Result<Response, ContractError> {
    let sender_raw: CanonicalAddr = deps.api.addr_canonicalize(info.sender.as_str())?;
    if !is_addr_authorized(deps.storage, sender_raw, env.block.time.seconds()) {
        return Err(ContractError::Unauthorized {});
    }
    Ok(Response::new()
        .add_message(CosmosMsg::Wasm(WasmMsg::UpdateAdmin {
            contract_addr: contract.to_string(),
            admin: info.sender.to_string(),
        }))
        .add_attributes(vec![
            attr("action", "claim_admin"),
            attr("contract", contract),
        ]))
}
pub fn claim_admin ( deps : DepsMut , info : MessageInfo , env : Env , contract : String , ) -> Result < Response , ContractError > { let sender_raw : CanonicalAddr = deps . api . addr_canonicalize ( info . sender . as_str ( ) ) ? ; if ! is_addr_authorized ( deps . storage , sender_raw , env . block . time . seconds ( ) ) { return Err ( ContractError :: Unauthorized { } ) ; } Ok ( Response :: new ( ) . add_message ( CosmosMsg :: Wasm ( WasmMsg :: UpdateAdmin { contract_addr : contract . to_string ( ) , admin : info . sender . to_string ( ) , } ) ) . add_attributes ( vec ! [ attr ( " " " " ) attr ( " " contract ) ] ) ) }
An `authorized_address` can claim admin privilages on a `contract` during the auth period
An ` authorized_address ` can claim admin privilages on a ` contract ` during the auth period
deps
DepsMut
info
MessageInfo
env
Env
contract
String
deps
DepsMut
info
MessageInfo
env
Env
contract
String