@@ -131,10 +131,10 @@ func (aw *AccessWitness) TouchAndChargeContractCreateInit(addr []byte, createSen
131131func (aw * AccessWitness ) TouchAndChargeContractCreateCompleted (addr []byte , withValue bool ) uint64 { // TODO(jsign): withValue not used?
132132 var gas uint64
133133 gas += aw .TouchAddressOnWriteAndComputeGas (addr , zeroTreeIndex , utils .VersionLeafKey )
134- gas += aw .TouchAddressOnReadAndComputeGas (addr , zeroTreeIndex , utils .CodeSizeLeafKey )
135- gas += aw .TouchAddressOnReadAndComputeGas (addr , zeroTreeIndex , utils .CodeKeccakLeafKey )
136- gas += aw .TouchAddressOnWriteAndComputeGas (addr , zeroTreeIndex , utils .NonceLeafKey )
137134 gas += aw .TouchAddressOnWriteAndComputeGas (addr , zeroTreeIndex , utils .BalanceLeafKey )
135+ gas += aw .TouchAddressOnWriteAndComputeGas (addr , zeroTreeIndex , utils .CodeSizeLeafKey )
136+ gas += aw .TouchAddressOnWriteAndComputeGas (addr , zeroTreeIndex , utils .CodeKeccakLeafKey )
137+ gas += aw .TouchAddressOnWriteAndComputeGas (addr , zeroTreeIndex , utils .NonceLeafKey )
138138 return gas
139139}
140140
@@ -220,7 +220,7 @@ func (aw *AccessWitness) touchAddress(addr []byte, treeIndex uint256.Int, subInd
220220 chunkValue := aw .chunks [chunkKey ]
221221 if (chunkValue & AccessWitnessWriteFlag ) == 0 {
222222 chunkWrite = true
223- aw .chunks [chunkKey ] |= chunkValue
223+ aw .chunks [chunkKey ] |= AccessWitnessWriteFlag
224224 }
225225
226226 // TODO: charge chunk filling costs if the leaf was previously empty in the state
0 commit comments