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

Cannot find Contract address and interface verification #679

Closed
Flydexo opened this issue Mar 14, 2022 · 1 comment
Closed

Cannot find Contract address and interface verification #679

Flydexo opened this issue Mar 14, 2022 · 1 comment

Comments

@Flydexo
Copy link

Flydexo commented Mar 14, 2022

Hello, I am trying to implement CW1155 requirements on my contract. The first execute "send_from" requires this:

If to is an address controlled by a smart contract, it must implement the CW1155Receiver interface, msg will be passed to it along with other fields, otherwise, msg should be None.

But in the send_from function it only sends the message to the "to" address and I don't find where it verifies if the address is pointing to a contract and if the contract implements the CW1155Receive interface.

pub fn execute_send_from(
    env: ExecuteEnv,
    from: String,
    to: String,
    token_id: TokenId,
    amount: Uint128,
    msg: Option<Binary>,
) -> Result<Response, ContractError> {
    let from_addr = env.deps.api.addr_validate(&from)?;
    let to_addr = env.deps.api.addr_validate(&to)?;

    let ExecuteEnv {
        mut deps,
        env,
        info,
    } = env;

    guard_can_approve(deps.as_ref(), &env, &from_addr, &info.sender)?;

    let mut rsp = Response::default();

    let event = execute_transfer_inner(
        &mut deps,
        Some(&from_addr),
        Some(&to_addr),
        &token_id,
        amount,
    )?;
    event.add_attributes(&mut rsp);

    if let Some(msg) = msg {
        rsp.messages = vec![SubMsg::new(
            Cw1155ReceiveMsg {
                operator: info.sender.to_string(),
                from: Some(from),
                amount,
                token_id: token_id.clone(),
                msg,
            }
            .into_cosmos_msg(to)?,
        )]
    }

    Ok(rsp)
}
@uint
Copy link
Contributor

uint commented Nov 9, 2022

Closing as cw1155 has been removed from this repo

@uint uint closed this as completed Nov 9, 2022
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

No branches or pull requests

2 participants