Skip to content

Commit 046504d

Browse files
codchenudpatil
authored andcommitted
Add CW721 wrapper for ERC721 (#1264)
* Add CW721 wrapper for ERC721 * tests
1 parent d4baa88 commit 046504d

21 files changed

+1299
-14
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ coverage.out
4848
# example artifacts
4949
example/cosmwasm/echo/target
5050
example/cosmwasm/cw20/target
51+
example/cosmwasm/cw721/target
5152

5253
# Solidity contracts artifacts
5354
contracts/artifacts
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
80d19ac2966703511c136c07663280feaadb9f785570ff70da11060ab458d90f cwerc20.wasm
1+
6c2094e79d3166ff3b6e25292a999cd2da47cf06dea3aea1c5b41b57d3df1805 cwerc20.wasm
-415 Bytes
Binary file not shown.

example/cosmwasm/cw20/src/contract.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ pub fn instantiate(
1515
_info: MessageInfo,
1616
msg: InstantiateMsg,
1717
) -> Result<Response, ContractError> {
18-
let erc20_addr = deps.api.addr_validate(&msg.erc20_address)?;
19-
ERC20_ADDRESS.save(deps.storage, &erc20_addr)?;
18+
ERC20_ADDRESS.save(deps.storage, &msg.erc20_address)?;
2019
Ok(Response::default())
2120
}
2221

@@ -48,7 +47,7 @@ pub fn execute_transfer(
4847

4948
let querier = EvmQuerier::new(&deps.querier);
5049
let payload = querier.erc20_transfer_payload(recipient.clone(), amount)?;
51-
let msg = EvmMsg::DelegateCallEvm { to: erc_addr.into_string(), data: payload.encoded_payload };
50+
let msg = EvmMsg::DelegateCallEvm { to: erc_addr, data: payload.encoded_payload };
5251
let res = Response::new()
5352
.add_attribute("action", "transfer")
5453
.add_attribute("from", info.sender)

example/cosmwasm/cw20/src/state.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use cosmwasm_std::Addr;
21
use cw_storage_plus::Item;
32

4-
pub const ERC20_ADDRESS: Item<Addr> = Item::new("erc20_address");
3+
pub const ERC20_ADDRESS: Item<String> = Item::new("erc20_address");

0 commit comments

Comments
 (0)