interface.jsView |
---|
101 | 101 | |
102 | 102 | const address = Address.fromMemory(this.getMemory(addressOffset, constants.ADDRESS_SIZE_BYTES)) |
103 | 103 | |
104 | 104 | const balance = this.environment.getBalance(address) |
105 | | - this.setMemory(offset, constants.BALANCE_SIZE_BYTES, balance.toMemory(constants.BALANCE_SIZE_BYTES)) |
| 105 | + this.setMemory(offset, constants.U128_SIZE_BYTES, balance.toMemory(constants.U128_SIZE_BYTES)) |
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | 109 | * Gets the execution's origination address and loads it into memory at the |
135 | 135 | */ |
136 | 136 | getCallValue (offset) { |
137 | 137 | this.takeGas(2) |
138 | 138 | |
139 | | - this.setMemory(offset, constants.BALANCE_SIZE_BYTES, this.environment.callValue.toMemory(constants.BALANCE_SIZE_BYTES)) |
| 139 | + this.setMemory(offset, constants.U128_SIZE_BYTES, this.environment.callValue.toMemory(constants.U128_SIZE_BYTES)) |
140 | 140 | } |
141 | 141 | |
142 | 142 | |
143 | 143 | * Get size of input data in current environment. This pertains to the input |
332 | 332 | */ |
333 | 333 | create (valueOffset, dataOffset, length) { |
334 | 334 | this.takeGas(32000) |
335 | 335 | |
336 | | - const value = U256.fromMemory(this.getMemory(valueOffset, constants.BALANCE_SIZE_BYTES)) |
| 336 | + const value = U256.fromMemory(this.getMemory(valueOffset, constants.U128_SIZE_BYTES)) |
337 | 337 | const data = this.getMemory(dataOffset, length) |
338 | 338 | const result = this.environment.create(value, data) |
339 | 339 | return result |
340 | 340 | } |
355 | 355 | this.takeGas(40) |
356 | 356 | |
357 | 357 | |
358 | 358 | const address = Address.fromMemory(this.getMemory(addressOffset, constants.ADDRESS_SIZE_BYTES)) |
359 | | - const value = U256.fromMemory(this.getMemory(valueOffset, constants.BALANCE_SIZE_BYTES)) |
| 359 | + const value = U256.fromMemory(this.getMemory(valueOffset, constants.U128_SIZE_BYTES)) |
360 | 360 | const data = this.getMemory(dataOffset, dataLength) |
361 | 361 | |
362 | 362 | const [result, errorCode] = this.environment.call(gas, address, value, data) |
363 | 363 | this.setMemory(resultOffset, resultLength, result) |
380 | 380 | this.takeGas(40) |
381 | 381 | |
382 | 382 | |
383 | 383 | const address = Address.fromMemory(this.getMemory(addressOffset, constants.ADDRESS_SIZE_BYTES)) |
384 | | - const value = U256.fromMemory(this.getMemory(valueOffset, constants.BALANCE_SIZE_BYTES)) |
| 384 | + const value = U256.fromMemory(this.getMemory(valueOffset, constants.U128_SIZE_BYTES)) |
385 | 385 | const data = this.getMemory(dataOffset, dataLength) |
386 | 386 | |
387 | 387 | const [result, errorCode] = this.environment.callCode(gas, address, value, data) |
388 | 388 | this.setMemory(resultOffset, resultLength, result) |