HelloWorld合约

Remix编辑器

image-20250524144934373

1
2
3
4
5
6
7
8
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

contract helloworld{
function helloWorld() public pure returns (string memory) {
return "Hello, World!";
}
}

image-20250524145024856

发行代币

在闲鱼,淘宝上买些测试币,也可以通过水龙头获取(只是有点要求和门槛,不如直接买),这里我买了两笔

新建合约文件

image-20250529101100930

1
2
3
4
5
6
7
8
9
10
11
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyError20Token is ERC20{

constructor(string memory _name,string memory _symbol) ERC20(_name,_symbol){
_mint(msg.sender,10000 * 10 ** 18);
}
}

image-20250529101412816

image-20250529101510973

image-20250529101815851

image-20250529102052827