Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 28, 2024
2 parents 325a902 + 82358eb commit ce533a6
Show file tree
Hide file tree
Showing 11 changed files with 1,118 additions and 2,047 deletions.
2 changes: 1 addition & 1 deletion 06_ArrayAndStruct/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tags:
bytes memory array9 = new bytes(9);
```
- 数组字面常数(Array Literals)是写作表达式形式的数组,用方括号包着来初始化array的一种方式,并且里面每一个元素的type是以第一个元素为准的,例如`[1,2,3]`里面所有的元素都是`uint8`类型,因为在Solidity中,如果一个值没有指定type的话,默认就是最小单位的该type,这里 `uint` 的默认最小单位类型就是`uint8`。而`[uint(1),2,3]`里面的元素都是`uint`类型,因为第一个元素指定了是`uint`类型了,我们都以第一个元素为准
- 数组字面常数(Array Literals)是写作表达式形式的数组,用方括号包着来初始化array的一种方式,并且里面每一个元素的type是以第一个元素为准的,例如`[1,2,3]`里面所有的元素都是`uint8`类型,因为在Solidity中,如果一个值没有指定type的话,会根据上下文推断出元素的类型,默认就是最小单位的type,这里默认最小单位类型是`uint8`。而`[uint(1),2,3]`里面的元素都是`uint`类型,因为第一个元素指定了是`uint`类型了,里面每一个元素的type都以第一个元素为准
下面的例子中,如果没有对传入 `g()` 函数的数组进行 `uint` 转换,是会报错的。
Expand Down
8 changes: 4 additions & 4 deletions 25_Create2/create2test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ describe("create2 test", function () {
console.log("1.==> deploy pair");
const PairFactory = await ethers.getContractFactory("Pair");
const Pair = await PairFactory.deploy();
await Pair.deployed();
console.log("pair address =>",Pair.address);
await Pair.waitForDeployment();
console.log("pair address =>",Pair.target);

console.log();
console.log("2.==> deploy PairFactory2");
const PairFactory2Factory = await ethers.getContractFactory("PairFactory2");
const PairFactory2 = await PairFactory2Factory.deploy();
await PairFactory2.deployed();
console.log("PairFactory2 address =>",PairFactory2.address);
await PairFactory2.waitForDeployment();
console.log("PairFactory2 address =>",PairFactory2.target);

console.log("3.==> calculateAddr for wbnb people");
const WBNBAddress = "0x2c44b726ADF1963cA47Af88B284C06f30380fC78";
Expand Down
8 changes: 4 additions & 4 deletions Languages/en/25_Create2_en/create2test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ describe("create2 test", function () {
console.log("1.==> deploy pair");
const PairFactory = await ethers.getContractFactory("Pair");
const Pair = await PairFactory.deploy();
await Pair.deployed();
console.log("pair address =>",Pair.address);
await Pair.waitForDeployment();
console.log("pair address =>",Pair.target);

console.log();
console.log("2.==> deploy PairFactory2");
const PairFactory2Factory = await ethers.getContractFactory("PairFactory2");
const PairFactory2 = await PairFactory2Factory.deploy();
await PairFactory2.deployed();
console.log("PairFactory2 address =>",PairFactory2.address);
await PairFactory2.waitForDeployment();
console.log("PairFactory2 address =>",PairFactory2.target);

console.log("3.==> calculateAddr for wbnb people");
const WBNBAddress = "0x2c44b726ADF1963cA47Af88B284C06f30380fC78";
Expand Down
8 changes: 4 additions & 4 deletions Languages/pt-br/25_Create2/create2test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ describe("create2 test", function () {
console.log("1.==> implantar par")
const PairFactory = await ethers.getContractFactory("Pair");
const Pair = await PairFactory.deploy();
await Pair.deployed();
console.log("par endereço =>", Pair.address)
await Pair.waitForDeployment();
console.log("par endereço =>", Pair.target)

console.log()
console.log("2.==> implantar PairFactory2")
const PairFactory2Factory = await ethers.getContractFactory("PairFactory2");
const PairFactory2 = await PairFactory2Factory.deploy();
await PairFactory2.deployed();
console.log("Endereço do PairFactory2 =>", PairFactory2.address)
await PairFactory2.waitForDeployment();
console.log("Endereço do PairFactory2 =>", PairFactory2.target)

console.log("3.==> calcularEndereço para pessoas wbnb")
const WBNBAddress = "0x2c44b726ADF1963cA47Af88B284C06f30380fC78";
Expand Down
14 changes: 14 additions & 0 deletions Topics/Tools/TOOL06_Hardhat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json
2 changes: 1 addition & 1 deletion Topics/Tools/TOOL06_Hardhat/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require("@nomicfoundation/hardhat-toolbox");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.17",
solidity: "0.8.21",
networks: {
goerli: {
url: "https://eth-goerli.g.alchemy.com/v2/API_KEY",
Expand Down
Loading

0 comments on commit ce533a6

Please sign in to comment.