بهینه سازی gas در قراردادهای هوشمند

ژوئیه 09, 2024 26 mins read

اطلاعات مرجع کد opcode EVM از یلوپپیر اتریوم برای تشخیص و بهینه سازی گس تراکنش های قراردادهای هوشمند در اتریوم

بهینه سازی gas در قراردادهای هوشمند

اطلاعات  مرجع  کد opcode EVM  از یلوپپیر اتریوم برای تشخیص و بهینه سازی گس تراکنش های قراردادهای هوشمند در اتریوم
 
Opcodeنام عملیاتتوضیحاتاطلاعات اضافیگس فی
0x00STOPHalts execution0
0x01ADDAddition operation3
0x02MULMultiplication operation5
0x03SUBSubtraction operation3
0x04DIVInteger division operation5
0x05SDIVSigned integer division operation (truncated)5
0x06MODModulo remainder operation5
0x07SMODSigned modulo remainder operation5
0x08ADDMODModulo addition operation8
0x09MULMODModulo multiplication operation8
0x0aEXPExponential operation10*
0x0bSIGNEXTENDExtend length of two’s complement signed integer5
0x0c0x0fUnusedUnused 
0x10LTLess-than comparison3
0x11GTGreater-than comparison3
0x12SLTSigned less-than comparison3
0x13SGTSigned greater-than comparison3
0x14EQEquality comparison3
0x15ISZEROSimple not operator3
0x16ANDBitwise AND operation3
0x17ORBitwise OR operation3
0x18XORBitwise XOR operation3
0x19NOTBitwise NOT operation3
0x1aBYTERetrieve single byte from word3
0x1bSHLShift LeftEIP1453
0x1cSHRLogical Shift RightEIP1453
0x1dSARArithmetic Shift RightEIP1453
0x20KECCAK256Compute Keccak-256 hash30*
0x210x2fUnusedUnused  
0x30ADDRESSGet address of currently executing account2
0x31BALANCEGet balance of the given account700
0x32ORIGINGet execution origination address2
0x33CALLERGet caller address2
0x34CALLVALUEGet deposited value by the instruction/transaction responsible for this execution2
0x35CALLDATALOADGet input data of current environment3
0x36CALLDATASIZEGet size of input data in current environment2*
0x37CALLDATACOPYCopy input data in current environment to memory3
0x38CODESIZEGet size of code running in current environment2
0x39CODECOPYCopy code running in current environment to memory3*
0x3aGASPRICEGet price of gas in current environment2
0x3bEXTCODESIZEGet size of an account’s code700
0x3cEXTCODECOPYCopy an account’s code to memory700*
0x3dRETURNDATASIZEPushes the size of the return data buffer onto the stackEIP 2112
0x3eRETURNDATACOPYCopies data from the return data buffer to memoryEIP 2113
0x3fEXTCODEHASHReturns the keccak256 hash of a contract’s codeEIP 1052700
0x40BLOCKHASHGet the hash of one of the 256 most recent complete blocks20
0x41COINBASEGet the block’s beneficiary address2
0x42TIMESTAMPGet the block’s timestamp2
0x43NUMBERGet the block’s number2
0x44DIFFICULTYGet the block’s difficulty2
0x45GASLIMITGet the block’s gas limit2
0x46CHAINIDReturns the current chain’s EIP-155 unique identifierEIP 13442
0x470x4fUnused  
0x48BASEFEEReturns the value of the base fee of the current block it is executing in.EIP 31982
0x50POPRemove word from stack2
0x51MLOADLoad word from memory3*
0x52MSTORESave word to memory3*
0x53MSTORE8Save byte to memory3
0x54SLOADLoad word from storage800
0x55SSTORESave word to storage20000**
0x56JUMPAlter the program counter8
0x57JUMPIConditionally alter the program counter10
0x58GETPCGet the value of the program counter prior to the increment2
0x59MSIZEGet the size of active memory in bytes2
0x5aGASGet the amount of available gas, including the corresponding reduction for the cost of this instruction2
0x5bJUMPDESTMark a valid destination for jumps1
0x5c0x5fUnused  
0x60PUSH1Place 1 byte item on stack3
0x61PUSH2Place 2-byte item on stack3
0x62PUSH3Place 3-byte item on stack3
0x63PUSH4Place 4-byte item on stack3
0x64PUSH5Place 5-byte item on stack3
0x65PUSH6Place 6-byte item on stack3
0x66PUSH7Place 7-byte item on stack3
0x67PUSH8Place 8-byte item on stack3
0x68PUSH9Place 9-byte item on stack3
0x69PUSH10Place 10-byte item on stack3
0x6aPUSH11Place 11-byte item on stack3
0x6bPUSH12Place 12-byte item on stack3
0x6cPUSH13Place 13-byte item on stack3
0x6dPUSH14Place 14-byte item on stack3
0x6ePUSH15Place 15-byte item on stack3
0x6fPUSH16Place 16-byte item on stack3
0x70PUSH17Place 17-byte item on stack3
0x71PUSH18Place 18-byte item on stack3
0x72PUSH19Place 19-byte item on stack3
0x73PUSH20Place 20-byte item on stack3
0x74PUSH21Place 21-byte item on stack3
0x75PUSH22Place 22-byte item on stack3
0x76PUSH23Place 23-byte item on stack3
0x77PUSH24Place 24-byte item on stack3
0x78PUSH25Place 25-byte item on stack3
0x79PUSH26Place 26-byte item on stack3
0x7aPUSH27Place 27-byte item on stack3
0x7bPUSH28Place 28-byte item on stack3
0x7cPUSH29Place 29-byte item on stack3
0x7dPUSH30Place 30-byte item on stack3
0x7ePUSH31Place 31-byte item on stack3
0x7fPUSH32Place 32-byte (full word) item on stack3
0x80DUP1Duplicate 1st stack item3
0x81DUP2Duplicate 2nd stack item3
0x82DUP3Duplicate 3rd stack item3
0x83DUP4Duplicate 4th stack item3
0x84DUP5Duplicate 5th stack item3
0x85DUP6Duplicate 6th stack item3
0x86DUP7Duplicate 7th stack item3
0x87DUP8Duplicate 8th stack item3
0x88DUP9Duplicate 9th stack item3
0x89DUP10Duplicate 10th stack item3
0x8aDUP11Duplicate 11th stack item3
0x8bDUP12Duplicate 12th stack item3
0x8cDUP13Duplicate 13th stack item3
0x8dDUP14Duplicate 14th stack item3
0x8eDUP15Duplicate 15th stack item3
0x8fDUP16Duplicate 16th stack item3
0x90SWAP1Exchange 1st and 2nd stack items3
0x91SWAP2Exchange 1st and 3rd stack items3
0x92SWAP3Exchange 1st and 4th stack items3
0x93SWAP4Exchange 1st and 5th stack items3
0x94SWAP5Exchange 1st and 6th stack items3
0x95SWAP6Exchange 1st and 7th stack items3
0x96SWAP7Exchange 1st and 8th stack items3
0x97SWAP8Exchange 1st and 9th stack items3
0x98SWAP9Exchange 1st and 10th stack items3
0x99SWAP10Exchange 1st and 11th stack items3
0x9aSWAP11Exchange 1st and 12th stack items3
0x9bSWAP12Exchange 1st and 13th stack items3
0x9cSWAP13Exchange 1st and 14th stack items3
0x9dSWAP14Exchange 1st and 15th stack items3
0x9eSWAP15Exchange 1st and 16th stack items3
0x9fSWAP16Exchange 1st and 17th stack items3
0xa0LOG0Append log record with no topics375
0xa1LOG1Append log record with one topic750
0xa2LOG2Append log record with two topics1125
0xa3LOG3Append log record with three topics1500
0xa4LOG4Append log record with four topics1875
0xa50xafUnused  
0xb0JUMPTOTentative libevmasm has different numbersEIP 615 
0xb1JUMPIFTentativeEIP 615 
0xb2JUMPSUBTentativeEIP 615 
0xb4JUMPSUBVTentativeEIP 615 
0xb5BEGINSUBTentativeEIP 615 
0xb6BEGINDATATentativeEIP 615 
0xb8RETURNSUBTentativeEIP 615 
0xb9PUTLOCALTentativeEIP 615 
0xbaGETLOCALTentativeEIP 615 
0xbb0xe0Unused  
0xe1SLOADBYTESOnly referenced in pyethereum
0xe2SSTOREBYTESOnly referenced in pyethereum
0xe3SSIZEOnly referenced in pyethereum
0xe40xefUnused  
0xf0CREATECreate a new account with associated code32000
0xf1CALLMessage-call into an accountComplicated
0xf2CALLCODEMessage-call into this account with alternative account’s codeComplicated
0xf3RETURNHalt execution returning output data0
0xf4DELEGATECALLMessage-call into this account with an alternative account’s code, but persisting into this account with an alternative account’s codeComplicated
0xf5CREATE2Create a new account and set creation address to sha3(sender + sha3(init code)) % 2**160 
0xf60xf9Unused 
0xfaSTATICCALLSimilar to CALL, but does not modify state40
0xfbUnused 
0xfcTXEXECGASNot in yellow paper FIXME
0xfdREVERTStop execution and revert state changes, without consuming all provided gas and providing a reason0
0xfeINVALIDDesignated invalid instruction0
0xffSELFDESTRUCTHalt execution and register account for later deletion5000*
Image NewsLetter
Icon primary
Newsletter

در خبرنامه آرتا رسانه عضو شوید

با آخرین اخبار و تخفیف های ما آگاه شوید