I am looking at the possibility of creating a custom token on the Ethereum network & wanted to know if there is a way if i can put an limit on the gasPrice in order to prevent the so called "gas wars" ?
Asked
Active
Viewed 161 times
1 Answers
2
require(tx.gasprice < 5 * 1000000000);
Roman Frolov
- 3,177
- 2
- 11
- 29
-
what happens to the state of the transaction if i do this ? – Sujal Mandal Jan 31 '18 at 15:05
-
1"require(false) compiles to 0xfd which is the REVERT opcode, meaning it will refund the remaining gas." Source. – Roman Frolov Jan 31 '18 at 15:08
-
The transaction will be reverted to the initial state. – Roman Frolov Jan 31 '18 at 15:11
-
its safe to say that require(false) is equal to if(false) revert(); ? – Sujal Mandal Jan 31 '18 at 15:52
-
1@SujalMandal yes. Solidity performs a revert operation (instruction 0xfd) in both scenarios. – Roman Frolov Jan 31 '18 at 16:00