@@ -70,17 +70,17 @@ This is necessary because
7070> - On Windows, it uses ` Invoke-WebRequest ` and ` Start-Process ` in PowerShell for a similar effect.
7171
7272To activate HTS emulation in your tests, you need to add the following setup code in your test files.
73- Import our wrapper function to deploy HTS emulation and enable cheat codes for it.
73+ Import our System Contracts ` library ` to deploy HTS emulation and enable cheat codes for it.
7474
7575``` solidity
76- import {htsSetup } from "hedera-forking/contracts/htsSetup .sol";
76+ import {Hsc } from "hedera-forking/Hsc .sol";
7777```
7878
7979and then invoke it in your [ test setup] ( https://book.getfoundry.sh/forge/writing-tests )
8080
8181``` solidity
8282 function setUp() public {
83- htsSetup();
83+ Hsc. htsSetup();
8484 }
8585```
8686
@@ -89,12 +89,12 @@ and then invoke it in your [test setup](https://book.getfoundry.sh/forge/writing
8989Now you can use Hedera Token Services and remote tokens as if they were deployed locally when fork testing.
9090For example
9191
92- ``` solidity examples/foundry-hts/src /USDC.t.sol
92+ ``` solidity examples/foundry-hts/test /USDC.t.sol
9393// SPDX-License-Identifier: Apache-2.0
9494pragma solidity ^0.8.0;
9595
9696import {Test} from "forge-std/Test.sol";
97- import {htsSetup } from "hedera-forking/htsSetup .sol";
97+ import {Hsc } from "hedera-forking/Hsc .sol";
9898import {IERC20} from "hedera-forking/IERC20.sol";
9999import {IHederaTokenService} from "hedera-forking/IHederaTokenService.sol";
100100import {HederaResponseCodes} from "hedera-forking/HederaResponseCodes.sol";
@@ -106,7 +106,7 @@ contract USDCExampleTest is Test {
106106 address private user1;
107107
108108 function setUp() external {
109- htsSetup();
109+ Hsc. htsSetup();
110110
111111 user1 = makeAddr("user1");
112112 deal(USDC_mainnet, user1, 1000 * 10e8);
@@ -148,17 +148,17 @@ forge test --fork-url https://mainnet.hashio.io/api --fork-block-number 72433403
148148
149149You can use all the tools and cheatcodes Foundry provides, _ e.g._ , ` console.log `
150150
151- ``` solidity examples/foundry-hts/src /USDCConsole.t.sol
151+ ``` solidity examples/foundry-hts/test /USDCConsole.t.sol
152152// SPDX-License-Identifier: Apache-2.0
153153pragma solidity ^0.8.0;
154154
155155import {Test, console} from "forge-std/Test.sol";
156- import {htsSetup } from "hedera-forking/htsSetup .sol";
156+ import {Hsc } from "hedera-forking/Hsc .sol";
157157import {IERC20} from "hedera-forking/IERC20.sol";
158158
159159contract USDCConsoleExampleTest is Test {
160160 function setUp() external {
161- htsSetup();
161+ Hsc. htsSetup();
162162 }
163163
164164 function test_using_console_log() view external {
@@ -186,29 +186,27 @@ To enable Foundry Scripts to work with HTS, you can use `htsSetup()` as describe
186186You can include
187187For example
188188
189- ```` solidity examples/foundry-hts/scripts /CreateToken.s.sol
189+ ``` solidity examples/foundry-hts/script /CreateToken.s.sol
190190// SPDX-License-Identifier: Apache-2.0
191191pragma solidity ^0.8.0;
192192
193193import {Script, console} from "forge-std/Script.sol";
194194import {HTS_ADDRESS} from "hedera-forking/HtsSystemContract.sol";
195195import {IHederaTokenService} from "hedera-forking/IHederaTokenService.sol";
196196import {HederaResponseCodes} from "hedera-forking/HederaResponseCodes.sol";
197- import {htsSetup } from "hedera-forking/htsSetup .sol";
197+ import {Hsc } from "hedera-forking/Hsc .sol";
198198
199199/**
200200 * Given how Foundry script works, the flag `--skip-simulation` is necessary.
201201 * For example
202202 *
203- * ```
204203 * forge script scripts/CreateToken.s.sol -vvv --rpc-url testnet --skip-simulation --broadcast
205- * ```
206204 */
207205contract CreateTokenScript is Script {
208206 uint256 PRIVATE_KEY = vm.envUint("PRIVATE_KEY");
209207
210208 function run() public {
211- htsSetup();
209+ Hsc. htsSetup();
212210
213211 address signer = vm.addr(PRIVATE_KEY);
214212 console.log("Signer address %s", signer);
@@ -241,7 +239,7 @@ contract CreateTokenScript is Script {
241239 vm.stopBroadcast();
242240 }
243241}
244- ````
242+ ```
245243
246244where ` testnet ` is an [ RPC endpoint] ( https://book.getfoundry.sh/reference/config/testing#rpc_endpoints ) declared in ` foundry.toml ` .
247245For example
@@ -604,7 +602,7 @@ This allow us to ensure that all examples and tables are never outdated (if we c
604602Code fences that contains a file name after the language definition, _ e.g._ ,
605603
606604```` markdown
607- ``` solidity examples/foundry-hts/src /USDC.t.sol
605+ ``` solidity examples/foundry-hts/test /USDC.t.sol
608606 ```
609607````
610608
0 commit comments