Binance Square

爱与和平520

你好👋
3 Following
19 Followers
13 Liked
0 Shared
All Content
--
See original
Ethereum meme faucet potential inscription cats, can play a few self-defenseI would like to recommend you Inscription cats, which has the potential to be the leading meme in Ethereum. It has only hit 16% now. The reasons for recommendation are as follows: 1. There is currently no phenomenon-level meme currency such as BRC20 rats on Ethereum. 2.cats is a simple word that is easy to remember. There is a strong correlation between mouse and cat. 3.Who can resist such a cute cat? According to the current gas, only 0.6U of gas can be used to create a cats inscription. Here is how the ETH cats inscription is minted: 1. It is recommended to use a new wallet (Little Fox) and put some ETH into it, 5~10U of ETH is enough. 2. Visit http://etch.market, click the Connect Wallet button in the upper right corner to link your Little Fox or OK wallet

Ethereum meme faucet potential inscription cats, can play a few self-defense

I would like to recommend you Inscription cats, which has the potential to be the leading meme in Ethereum. It has only hit 16% now.
The reasons for recommendation are as follows:
1. There is currently no phenomenon-level meme currency such as BRC20 rats on Ethereum.
2.cats is a simple word that is easy to remember. There is a strong correlation between mouse and cat.
3.Who can resist such a cute cat?
According to the current gas, only 0.6U of gas can be used to create a cats inscription.
Here is how the ETH cats inscription is minted:
1. It is recommended to use a new wallet (Little Fox) and put some ETH into it, 5~10U of ETH is enough.
2. Visit http://etch.market, click the Connect Wallet button in the upper right corner to link your Little Fox or OK wallet
See original
[Learning the contract development language solidity] solidity eventsDear currency friends, it’s time to learn blockchain technology again. At the end of the bear market, watch more, move less, and learn more. After a month of spare time, I have learned the basics of solidity language😁 I hope to learn WEB3 related technologies before ETH reaches 1W US dollars. All can understand it $ETH 1. What are events in solidity language? External acquisition can only be about the status changes of the contract. The event is actually the log interface of Ethereum. When calling the contract function, you need to submit the call to the Ethereum network. This process is time-consuming and is usually executed asynchronously. After we submit The results cannot be obtained directly. If we want to know the results, we can use events to receive the processing results. Events are used for notification outside the contract. Events are actually the log interface of Ethereum. The log is a special structure that can be indexed. 2. How to use solidity events? Use the event keyword to declare an event. This event is inheritable. Solidity's looks like a log function in other languages. event EventName(uint param); Use the emit keyword to emit an event emit EventName(10) The picture below is the actual code. You can see that the logs contain information about saving event records. 3. What is the key role of solidity events? The main function of solidity is for DAPP monitoring. The following is the pseudo code for DAPP monitoring var ev = contractInstance.EventName(); ev.watch(function(err,result){ result.args.name;});

[Learning the contract development language solidity] solidity events

Dear currency friends, it’s time to learn blockchain technology again. At the end of the bear market, watch more, move less, and learn more. After a month of spare time, I have learned the basics of solidity language😁 I hope to learn WEB3 related technologies before ETH reaches 1W US dollars. All can understand it $ETH 1. What are events in solidity language? External acquisition can only be about the status changes of the contract. The event is actually the log interface of Ethereum. When calling the contract function, you need to submit the call to the Ethereum network. This process is time-consuming and is usually executed asynchronously. After we submit The results cannot be obtained directly. If we want to know the results, we can use events to receive the processing results. Events are used for notification outside the contract. Events are actually the log interface of Ethereum. The log is a special structure that can be indexed. 2. How to use solidity events? Use the event keyword to declare an event. This event is inheritable. Solidity's looks like a log function in other languages. event EventName(uint param); Use the emit keyword to emit an event emit EventName(10) The picture below is the actual code. You can see that the logs contain information about saving event records. 3. What is the key role of solidity events? The main function of solidity is for DAPP monitoring. The following is the pseudo code for DAPP monitoring var ev = contractInstance.EventName(); ev.watch(function(err,result){ result.args.name;});
See original
[Learning the contract development language solidity] Fallback functionDear currency friends, it’s time to learn blockchain technology again. Today I will share with you what solidity’s rollback function is. The end of the bear market is very difficult. The black blind man believes that ETH will definitely reach 10,000 US dollars in the next bull market. $ETH The fallback function, whose English name is Fallback, is a function with no name, no parameters, and no return value. A contract can have a fallback function. When transferring ETH to the contract, a payable fallback function is required. If the contract is called, If no function is matched, the fallback function will be called. Before the solidity0.5 version, the fallback function was usually used to receive ETH transfers because there was no default receiving function in the contract. After the solidity0.6 version, the fallback function has new syntax and keywords, which can be displayed using the fallback keyword. Declare fallback function

[Learning the contract development language solidity] Fallback function

Dear currency friends, it’s time to learn blockchain technology again. Today I will share with you what solidity’s rollback function is. The end of the bear market is very difficult. The black blind man believes that ETH will definitely reach 10,000 US dollars in the next bull market. $ETH

The fallback function, whose English name is Fallback, is a function with no name, no parameters, and no return value. A contract can have a fallback function. When transferring ETH to the contract, a payable fallback function is required. If the contract is called, If no function is matched, the fallback function will be called.

Before the solidity0.5 version, the fallback function was usually used to receive ETH transfers because there was no default receiving function in the contract. After the solidity0.6 version, the fallback function has new syntax and keywords, which can be displayed using the fallback keyword. Declare fallback function
See original
[Learning the contract development language solidity] Use of the solidity libraryDear currency friends, it’s time to learn blockchain technology again. Let’s recharge and believe that ETH will definitely reach 10,000 US dollars in the next bull market. $ETH 1. What is the solidity library? The solidity library is a special contract that can be deployed like a contract, but has no state variables and cannot store ETH. The library can be reused. It can be deployed once and used repeatedly in different contracts. Using the library can save gas and the same code does not need to be deployed multiple times. 2. How to define and use the solidity library? Using the library keyword, the function library calls DELEGATECALL using delegation. The library code is actually executed in the initiating contract.

[Learning the contract development language solidity] Use of the solidity library

Dear currency friends, it’s time to learn blockchain technology again. Let’s recharge and believe that ETH will definitely reach 10,000 US dollars in the next bull market. $ETH

1. What is the solidity library?

The solidity library is a special contract that can be deployed like a contract, but has no state variables and cannot store ETH. The library can be reused. It can be deployed once and used repeatedly in different contracts. Using the library can save gas and the same code does not need to be deployed multiple times.

2. How to define and use the solidity library?

Using the library keyword, the function library calls DELEGATECALL using delegation. The library code is actually executed in the initiating contract.
See original
[Learning the contract development language solidity] inheritanceCurrency friends, it’s time to learn blockchain technology again. If you learn more and reserve more at the end of the bear market, ETH will definitely reach 10,000 US dollars in the next bull market. $ETH Solidity is an object-oriented language and also has inheritance characteristics. Contracts inherited from the contract can access all non-private members. 1. How is solidity inheritance used? What are the inherited accesses? In solidity, the keyword is represents inheritance, which is achieved by copying code. There are a total of 4 visibility modifiers for solidity objects: external (external access), public (both internal/external access), internal (internal and inherited), private (internal access), of which external, public, and internal can all be inherited. .

[Learning the contract development language solidity] inheritance

Currency friends, it’s time to learn blockchain technology again. If you learn more and reserve more at the end of the bear market, ETH will definitely reach 10,000 US dollars in the next bull market. $ETH

Solidity is an object-oriented language and also has inheritance characteristics. Contracts inherited from the contract can access all non-private members.

1. How is solidity inheritance used? What are the inherited accesses?

In solidity, the keyword is represents inheritance, which is achieved by copying code. There are a total of 4 visibility modifiers for solidity objects: external (external access), public (both internal/external access), internal (internal and inherited), private (internal access), of which external, public, and internal can all be inherited. .
See original
[Learning the contract development language solidity] Function modifiersDear currency friends, it’s time to learn blockchain technology again😄. Today, Heixiazi will share with you what the function modifier of solidity is. 1. Payable function modifier The payable function indicates that a function can be called with an attached Ethereum currency and can be used for ordinary functions, constructors and fallback functions. 2. Function modifier view View indicates that a function cannot modify the state and does not consume gas when executed locally. Under what circumstances is it considered that the status has changed: 1. Write state variables 2. Trigger contract events 3. Create other contracts

[Learning the contract development language solidity] Function modifiers

Dear currency friends, it’s time to learn blockchain technology again😄. Today, Heixiazi will share with you what the function modifier of solidity is.

1. Payable function modifier

The payable function indicates that a function can be called with an attached Ethereum currency and can be used for ordinary functions, constructors and fallback functions.

2. Function modifier view

View indicates that a function cannot modify the state and does not consume gas when executed locally.

Under what circumstances is it considered that the status has changed:

1. Write state variables

2. Trigger contract events

3. Create other contracts
【合约开发语言solidity学习】 函数修改器一、什么是函数修改器? 函数修改器(Modifier)可以用来改变一个函数的行为,通常用于在函数执行时检查某种前置条件,有点类似于面向对象编程里面的切面或者是中间件。和切面、中间件不同的是,solidity的函数修改器会把修改器的代码插入到要修改的函数前面去执行。 modifier onlyAdmin { require(msg.sender==admin); // do some thing... _; } function start() public onlyAdmin{ _; // do some thing... 代码会被引入到这里来 } 二、理解函数修改器的执行流程 在修改器中或者函数内执行return语句,此时执行流程仅跳出当前的修改器或者函数,“_”后面会继续执行; modifier isLock{ requrie(!locked); locked = ture; _; locked = false; } function add(uint a;uint b) isLock returns(uint){ return a+b; } 上面两个函数的伪代码是 function add(uint a;uint b) isLock returns(uint){ requrie(!locked); locked = ture; (return a+b;) locked = false; } 三、写代码实战

【合约开发语言solidity学习】 函数修改器

一、什么是函数修改器?

函数修改器(Modifier)可以用来改变一个函数的行为,通常用于在函数执行时检查某种前置条件,有点类似于面向对象编程里面的切面或者是中间件。和切面、中间件不同的是,solidity的函数修改器会把修改器的代码插入到要修改的函数前面去执行。 modifier onlyAdmin {

require(msg.sender==admin);

// do some thing...

_;

}

function start() public onlyAdmin{

_; // do some thing... 代码会被引入到这里来

}

二、理解函数修改器的执行流程

在修改器中或者函数内执行return语句,此时执行流程仅跳出当前的修改器或者函数,“_”后面会继续执行;

modifier isLock{

requrie(!locked);

locked = ture;

_;

locked = false;

}

function add(uint a;uint b) isLock returns(uint){

return a+b;

}

上面两个函数的伪代码是

function add(uint a;uint b) isLock returns(uint){

requrie(!locked);

locked = ture;

(return a+b;)

locked = false;

}

三、写代码实战
See original
[Learning the contract development language solidity] Mathematical function API and encryption API1. The following are some commonly used mathematical functions. Using them is safer and more reliable. addmod(uint x, uint y, uint k) returns (uint): Computes x + y modulo k. mulmod(uint x, uint y, uint k) returns (uint): Computes x * y modulo k. 2. API related to hash function The hash function is also called a hash function: input of any length is transformed into a fixed-length output through a hash algorithm (MD4, MD5, ripemd-160, SHA "Secure Hash Algorithm" cryptographic hash function family). SHA family: SHA1: 160-bit bit value, currently proven not to be particularly secure. It is possible that different input values ​​will get the same hash value.

[Learning the contract development language solidity] Mathematical function API and encryption API

1. The following are some commonly used mathematical functions. Using them is safer and more reliable.

addmod(uint x, uint y, uint k) returns (uint): Computes x + y modulo k.

mulmod(uint x, uint y, uint k) returns (uint): Computes x * y modulo k.

2. API related to hash function

The hash function is also called a hash function: input of any length is transformed into a fixed-length output through a hash algorithm (MD4, MD5, ripemd-160, SHA "Secure Hash Algorithm" cryptographic hash function family).

SHA family:

SHA1: 160-bit bit value, currently proven not to be particularly secure. It is possible that different input values ​​will get the same hash value.
See original
[Learning the contract development language solidity] Block transaction information API and ABI The ancients said that in the bear market, read more and study more. Without further ado, Heixiazi will share with you the relevant knowledge of the block transaction information API and ABI in the ETH smart contract development language solidity. It is not easy to code. I hope you will support me and look forward to the next bull market for ETH to break through 10,000 US dollars🙌 $ETH 1. What are the commonly used APIs for blocks and transactions? blockhash(uint blockNumber) Returns the hash value of the given block number, only supports the latest 256 blocks block.coinbase returns(address) The address of the current block miner

[Learning the contract development language solidity] Block transaction information API and ABI

The ancients said that in the bear market, read more and study more. Without further ado, Heixiazi will share with you the relevant knowledge of the block transaction information API and ABI in the ETH smart contract development language solidity. It is not easy to code. I hope you will support me and look forward to the next bull market for ETH to break through 10,000 US dollars🙌 $ETH

1. What are the commonly used APIs for blocks and transactions?

blockhash(uint blockNumber) Returns the hash value of the given block number, only supports the latest 256 blocks

block.coinbase returns(address) The address of the current block miner
See original
[Learning the contract development language solidity] Understanding date time and timestamp1. The time unit of sodidity Solidity has a total of 6 time units, seconds, minutes, hours, days, weeks, and years. Each time unit is converted. Solidity's time conversion does not take into account the situation of leap years and leap months, and the time conversion is not very accurate. The following is the relationship between various time units 2. How to get the current time The current timestamp can be obtained through the timestamp attribute in the bolck object block.timestamp; 3. How to execute it only once a day? The implementation idea is to keep the last execution time, and compare each execution time with the last execution time. If it is greater than one day, it can be executed. The code is as follows

[Learning the contract development language solidity] Understanding date time and timestamp

1. The time unit of sodidity

Solidity has a total of 6 time units, seconds, minutes, hours, days, weeks, and years. Each time unit is converted. Solidity's time conversion does not take into account the situation of leap years and leap months, and the time conversion is not very accurate.

The following is the relationship between various time units

2. How to get the current time

The current timestamp can be obtained through the timestamp attribute in the bolck object block.timestamp;

3. How to execute it only once a day?

The implementation idea is to keep the last execution time, and compare each execution time with the last execution time. If it is greater than one day, it can be executed. The code is as follows
See original
How to build an ETH archive node from scratch-01 1. What are the configuration requirements of the ETH client? ETH archive nodes do not have very high requirements for network and CPU, but mainly for storage. Using Geth and Nethermind clients to synchronize archive nodes requires more than 12T of disk space, while the Erigon client only needs a 4T hard drive. Heixiazi currently uses Kaixia CD6 8T solid-state drive. If there are no performance requirements, it is also possible to use a mechanical hard drive, but the synchronization time will be much slower, and it may take more than ten days to complete the construction of the archive node. Heixiazi has currently used 2 machines with different configurations to run the ETH archive node, and there were no problems. The machine configuration is as follows, you can use it as a reference

How to build an ETH archive node from scratch-01

1. What are the configuration requirements of the ETH client?

ETH archive nodes do not have very high requirements for network and CPU, but mainly for storage. Using Geth and Nethermind clients to synchronize archive nodes requires more than 12T of disk space, while the Erigon client only needs a 4T hard drive. Heixiazi currently uses Kaixia CD6 8T solid-state drive. If there are no performance requirements, it is also possible to use a mechanical hard drive, but the synchronization time will be much slower, and it may take more than ten days to complete the construction of the archive node.

Heixiazi has currently used 2 machines with different configurations to run the ETH archive node, and there were no problems. The machine configuration is as follows, you can use it as a reference
See original
[Learning the contract development language solidity] Type conversion and delete instructions1. What is type conversion? Type conversion is to convert one type to another type. Conversion can be divided into implicit and explicit conversion. Implicit conversion means there are different types on both sides of the operator. The compiler will try to implicitly convert the type without losing data. For example: uint8 -> uint16, uint256 can be converted uint16,uint256 -> uint8 will not be converted automatically because data may be lost Explicit conversion is forced conversion through code. For example, the above uint16 is converted to uint8. If you know that there is no problem with this variable conversion, you can force the conversion yourself.

[Learning the contract development language solidity] Type conversion and delete instructions

1. What is type conversion?

Type conversion is to convert one type to another type. Conversion can be divided into implicit and explicit conversion.

Implicit conversion means there are different types on both sides of the operator. The compiler will try to implicitly convert the type without losing data.

For example: uint8 -> uint16, uint256 can be converted

uint16,uint256 -> uint8 will not be converted automatically because data may be lost

Explicit conversion is forced conversion through code. For example, the above uint16 is converted to uint8. If you know that there is no problem with this variable conversion, you can force the conversion yourself.
See original
[Learning the contract development language solidity] Structure struct1. Keyword struct custom type struct Player{                     string name; uint coins; } 2. Declaration and initialization of structure 1. Only declare variables, not initialize them Player public player; 2. Initialize in member order. If the structure has mapping, it needs to be skipped. Player public player = Player(1,"Tom",1); 3. Initialize by specifying member names, so there is no need to specify the order of members. When there are many structure variables, it is recommended to initialize in this way. Player public player = Player({id:1,level:1});

[Learning the contract development language solidity] Structure struct

1. Keyword struct custom type

struct Player{

                    string name;

uint coins;

}

2. Declaration and initialization of structure

1. Only declare variables, not initialize them

Player public player;

2. Initialize in member order. If the structure has mapping, it needs to be skipped.

Player public player = Player(1,"Tom",1);

3. Initialize by specifying member names, so there is no need to specify the order of members. When there are many structure variables, it is recommended to initialize in this way.

Player public player = Player({id:1,level:1});
See original
[Learning the contract development language solidity] Mapping type mapping1. What is the mapping type? Mapping types and PHP arrays are more like a key-value relationship. The difference is that the mapping type is mapping. After the mapping relationship is defined, the data types of key and value are fixed and cannot be changed. Mapping is usually used to store data in contracts, such as storing user addresses and their token balances, or storing user addresses and their levels. 2. How to define and access mapping types The mapping type is defined through the mapping field. The key type cannot be a variable-length array, contract type, or nested type. The value type is unlimited.

[Learning the contract development language solidity] Mapping type mapping

1. What is the mapping type?

Mapping types and PHP arrays are more like a key-value relationship. The difference is that the mapping type is mapping. After the mapping relationship is defined, the data types of key and value are fixed and cannot be changed. Mapping is usually used to store data in contracts, such as storing user addresses and their token balances, or storing user addresses and their levels.

2. How to define and access mapping types

The mapping type is defined through the mapping field. The key type cannot be a variable-length array, contract type, or nested type. The value type is unlimited.
Login to explore more contents
Explore the latest crypto news
⚡️ Be a part of the latests discussions in crypto
💬 Interact with your favorite creators
👍 Enjoy content that interests you
Email / Phone number

Latest News

--
View More

Trending Articles

Crypto-Stock
View More
Sitemap
Cookie Preferences
Platform T&Cs