Skip to content

Commit

Permalink
feat: using correct sample token in examples and fixing query address (
Browse files Browse the repository at this point in the history
…#191)

Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas@arianelabs.com>
  • Loading branch information
arianejasuwienas committed Jan 21, 2025
1 parent 801cdf6 commit f5a483e
Show file tree
Hide file tree
Showing 11 changed files with 1,242 additions and 655 deletions.
8 changes: 3 additions & 5 deletions examples/foundry-hts/NFT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {htsSetup} from "hedera-forking/contracts/htsSetup.sol";
import {IERC721} from "hedera-forking/contracts/IERC721.sol";

contract NFTExampleTest is Test {
// https://hashscan.io/mainnet/token/0.0.640346
address NFT_mainnet = 0x000000000000000000000000000000000009c55a;
// https://hashscan.io/mainnet/token/0.0.4970613
address NFT_mainnet = 0x00000000000000000000000000000000004bd875;

address private user1;

Expand All @@ -19,10 +19,8 @@ contract NFTExampleTest is Test {
}

function test_get_owner_of_existing_account() view external {
// https://hashscan.io/mainnet/account/0.0.696303
address nftHolder = 0x00000000000000000000000000000000000a9fef;
// Owner of nft 2 is currently nftHolder
assertEq(IERC721(NFT_mainnet).ownerOf(2), nftHolder);
assertNotEq(IERC721(NFT_mainnet).ownerOf(2), address(0));
}

function test_dealt_nft_assigned_to_local_account() view external {
Expand Down
10 changes: 5 additions & 5 deletions examples/foundry-hts/NFTConsole.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ contract NFTConsoleExampleTest is Test {
}

function test_using_console_log() view external {
// https://hashscan.io/mainnet/token/0.0.8098137
address NFT_mainnet = 0x00000000000000000000000000000000007b9159;
// https://hashscan.io/mainnet/token/0.0.4970613
address NFT_mainnet = 0x00000000000000000000000000000000004bd875;

string memory name = IERC721(NFT_mainnet).name();
string memory symbol = IERC721(NFT_mainnet).symbol();
string memory tokenURI = IERC721(NFT_mainnet).tokenURI(1);
assertEq(name, "Hash Monkey Community token support");
assertEq(symbol, "NFTmonkey");
assertEq(tokenURI, "ipfs://bafkreif4t2apm7apgyu3lsi6ak3vxa3nd2oqpczqhnqapno2jbnj62oszy");
assertEq(name, "Concierge Collectibles");
assertEq(symbol, "Concierge Collectibles");
assertEq(tokenURI, "ipfs://QmVtsRvgZkqbBr5h5NB17LntAWC9DgXToLTLhNKCzB9RHZ");
console.log("name: %s, symbol: %s, tokenURI: %s", name, symbol, tokenURI);
}
}
3 changes: 2 additions & 1 deletion examples/hardhat-hts/contracts/CallNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ contract CallNFT {
// You can use `console.log` as usual
// https://hardhat.org/tutorial/debugging-with-hardhat-network#solidity--console.log
console.log("Transferring from %s to %s %s tokens", msg.sender, to, serialId);
IERC721(tokenAddress).transferFrom(msg.sender, to, serialId);
address owner = IERC721(tokenAddress).ownerOf(serialId);
IERC721(tokenAddress).transferFrom(owner, to, serialId);
}
}
Loading

0 comments on commit f5a483e

Please sign in to comment.