Integrate with Smart Contracts
Making Calls to the Other Contract's Entry Points
// Construct the Transfer message for the other contract
let transfer_msg = to_binary(&Transfer {
recipient: deps.api.addr_humanize(&recipient_raw)?,
amount,
})?;
// Construct the WasmMsg
let msg = WasmMsg::Execute {
contract_addr: other_contract_addr.to_string(),
msg: transfer_msg,
send: vec![],
};
// Return the WasmMsg to be executed by the runtime
Ok(Response::new()
.add_attribute("action", "call_other_contract")
.add_message(msg))Last updated
Was this helpful?