Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
fab8c869
Commit
fab8c869
authored
Dec 16, 2020
by
Alina
Committed by
GitHub
Dec 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uint -> uint256 (#112)
* uint -> uint256 * indent fix
parent
ef9d1e75
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
54 deletions
+54
-54
OVM_CanonicalTransactionChain.sol
...stic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
+1
-1
OVM_FraudContributor.sol
...mistic-ethereum/OVM/verification/OVM_FraudContributor.sol
+2
-2
iOVM_ExecutionManager.sol
...imistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
+6
-6
iOVM_L2ToL1MessagePasser.sol
...ic-ethereum/iOVM/precompiles/iOVM_L2ToL1MessagePasser.sol
+4
-4
Lib_OVMCodec.sol
...acts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
+5
-5
Lib_RLPWriter.sol
...racts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol
+18
-18
Helper_GasMeasurer.sol
...s/contracts/contracts/test-helpers/Helper_GasMeasurer.sol
+5
-5
TestERC20.sol
packages/contracts/contracts/test-helpers/TestERC20.sol
+12
-12
TestLib_RLPWriter.sol
...tracts/contracts/test-libraries/rlp/TestLib_RLPWriter.sol
+1
-1
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
View file @
fab8c869
...
@@ -16,7 +16,7 @@ import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
...
@@ -16,7 +16,7 @@ import { OVM_ExecutionManager } from "../execution/OVM_ExecutionManager.sol";
library Math {
library Math {
function min(uint
x, uint y) internal pure returns (uint
z) {
function min(uint
256 x, uint256 y) internal pure returns (uint256
z) {
if (x < y) {
if (x < y) {
return x;
return x;
}
}
...
...
packages/contracts/contracts/optimistic-ethereum/OVM/verification/OVM_FraudContributor.sol
View file @
fab8c869
...
@@ -10,9 +10,9 @@ abstract contract OVM_FraudContributor is Lib_AddressResolver {
...
@@ -10,9 +10,9 @@ abstract contract OVM_FraudContributor is Lib_AddressResolver {
/// Decorate your functions with this modifier to store how much total gas was
/// Decorate your functions with this modifier to store how much total gas was
/// consumed by the sender, to reward users fairly
/// consumed by the sender, to reward users fairly
modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
modifier contributesToFraudProof(bytes32 preStateRoot, bytes32 txHash) {
uint startGas = gasleft();
uint
256
startGas = gasleft();
_;
_;
uint gasSpent = startGas - gasleft();
uint
256
gasSpent = startGas - gasleft();
iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
iOVM_BondManager(resolve('OVM_BondManager')).recordGasSpent(preStateRoot, txHash, msg.sender, gasSpent);
}
}
}
}
packages/contracts/contracts/optimistic-ethereum/iOVM/execution/iOVM_ExecutionManager.sol
View file @
fab8c869
...
@@ -29,7 +29,7 @@ interface iOVM_ExecutionManager {
...
@@ -29,7 +29,7 @@ interface iOVM_ExecutionManager {
PREV_EPOCH_SEQUENCER_QUEUE_GAS,
PREV_EPOCH_SEQUENCER_QUEUE_GAS,
PREV_EPOCH_L1TOL2_QUEUE_GAS
PREV_EPOCH_L1TOL2_QUEUE_GAS
}
}
/***********
/***********
* Structs *
* Structs *
***********/
***********/
...
@@ -91,7 +91,7 @@ interface iOVM_ExecutionManager {
...
@@ -91,7 +91,7 @@ interface iOVM_ExecutionManager {
function ovmGASLIMIT() external view returns (uint256 _gasLimit);
function ovmGASLIMIT() external view returns (uint256 _gasLimit);
function ovmCHAINID() external view returns (uint256 _chainId);
function ovmCHAINID() external view returns (uint256 _chainId);
/**********************
/**********************
* L2 Context Opcodes *
* L2 Context Opcodes *
**********************/
**********************/
...
@@ -99,11 +99,11 @@ interface iOVM_ExecutionManager {
...
@@ -99,11 +99,11 @@ interface iOVM_ExecutionManager {
function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
function ovmL1QUEUEORIGIN() external view returns (Lib_OVMCodec.QueueOrigin _queueOrigin);
function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
function ovmL1TXORIGIN() external view returns (address _l1TxOrigin);
/*******************
/*******************
* Halting Opcodes *
* Halting Opcodes *
*******************/
*******************/
function ovmREVERT(bytes memory _data) external;
function ovmREVERT(bytes memory _data) external;
...
@@ -118,7 +118,7 @@ interface iOVM_ExecutionManager {
...
@@ -118,7 +118,7 @@ interface iOVM_ExecutionManager {
/*******************************
/*******************************
* Account Abstraction Opcodes *
* Account Abstraction Opcodes *
******************************/
******************************/
function ovmGETNONCE() external returns (uint256 _nonce);
function ovmGETNONCE() external returns (uint256 _nonce);
function ovmSETNONCE(uint256 _nonce) external;
function ovmSETNONCE(uint256 _nonce) external;
function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
function ovmCREATEEOA(bytes32 _messageHash, uint8 _v, bytes32 _r, bytes32 _s) external;
...
@@ -153,7 +153,7 @@ interface iOVM_ExecutionManager {
...
@@ -153,7 +153,7 @@ interface iOVM_ExecutionManager {
/**************************************
/**************************************
* Public Functions: Execution Safety *
* Public Functions: Execution Safety *
**************************************/
**************************************/
function safeCREATE(address _address, bytes memory _bytecode) external;
function safeCREATE(address _address, bytes memory _bytecode) external;
/***************************************
/***************************************
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/precompiles/iOVM_L2ToL1MessagePasser.sol
View file @
fab8c869
...
@@ -12,15 +12,15 @@ interface iOVM_L2ToL1MessagePasser {
...
@@ -12,15 +12,15 @@ interface iOVM_L2ToL1MessagePasser {
**********/
**********/
event L2ToL1Message(
event L2ToL1Message(
uint
_nonce,
uint256
_nonce,
address _sender,
address _sender,
bytes _data
bytes _data
);
);
/********************
/********************
* Public Functions *
* Public Functions *
********************/
********************/
function passMessageToL1(bytes calldata _message) external;
function passMessageToL1(bytes calldata _message) external;
}
}
packages/contracts/contracts/optimistic-ethereum/libraries/codec/Lib_OVMCodec.sol
View file @
fab8c869
...
@@ -131,15 +131,15 @@ library Lib_OVMCodec {
...
@@ -131,15 +131,15 @@ library Lib_OVMCodec {
{
{
if (_isEthSignedMessage) {
if (_isEthSignedMessage) {
(
(
uint _nonce,
uint
256
_nonce,
uint _gasLimit,
uint
256
_gasLimit,
uint _gasPrice,
uint
256
_gasPrice,
uint _chainId,
uint
256
_chainId,
address _to,
address _to,
bytes memory _data
bytes memory _data
) = abi.decode(
) = abi.decode(
_transaction,
_transaction,
(uint
, uint, uint, uint
, address ,bytes)
(uint
256, uint256, uint256, uint256
, address ,bytes)
);
);
return EIP155Transaction({
return EIP155Transaction({
nonce: _nonce,
nonce: _nonce,
...
...
packages/contracts/contracts/optimistic-ethereum/libraries/rlp/Lib_RLPWriter.sol
View file @
fab8c869
...
@@ -94,11 +94,11 @@ library Lib_RLPWriter {
...
@@ -94,11 +94,11 @@ library Lib_RLPWriter {
/**
/**
* RLP encodes a uint.
* RLP encodes a uint.
* @param _in The uint to encode.
* @param _in The uint
256
to encode.
* @return _out The RLP encoded uint in bytes.
* @return _out The RLP encoded uint
256
in bytes.
*/
*/
function writeUint(
function writeUint(
uint _in
uint
256
_in
)
)
internal
internal
pure
pure
...
@@ -140,8 +140,8 @@ library Lib_RLPWriter {
...
@@ -140,8 +140,8 @@ library Lib_RLPWriter {
* @return _encoded RLP encoded bytes.
* @return _encoded RLP encoded bytes.
*/
*/
function _writeLength(
function _writeLength(
uint _len,
uint
256
_len,
uint _offset
uint
256
_offset
)
)
private
private
pure
pure
...
@@ -155,8 +155,8 @@ library Lib_RLPWriter {
...
@@ -155,8 +155,8 @@ library Lib_RLPWriter {
encoded = new bytes(1);
encoded = new bytes(1);
encoded[0] = byte(uint8(_len) + uint8(_offset));
encoded[0] = byte(uint8(_len) + uint8(_offset));
} else {
} else {
uint lenLen;
uint
256
lenLen;
uint i = 1;
uint
256
i = 1;
while (_len / i != 0) {
while (_len / i != 0) {
lenLen++;
lenLen++;
i *= 256;
i *= 256;
...
@@ -212,16 +212,16 @@ library Lib_RLPWriter {
...
@@ -212,16 +212,16 @@ library Lib_RLPWriter {
* @param _len Length of memory to copy.
* @param _len Length of memory to copy.
*/
*/
function _memcpy(
function _memcpy(
uint _dest,
uint
256
_dest,
uint _src,
uint
256
_src,
uint _len
uint
256
_len
)
)
private
private
pure
pure
{
{
uint dest = _dest;
uint
256
dest = _dest;
uint src = _src;
uint
256
src = _src;
uint len = _len;
uint
256
len = _len;
for(; len >= 32; len -= 32) {
for(; len >= 32; len -= 32) {
assembly {
assembly {
...
@@ -231,7 +231,7 @@ library Lib_RLPWriter {
...
@@ -231,7 +231,7 @@ library Lib_RLPWriter {
src += 32;
src += 32;
}
}
uint mask = 256 ** (32 - len) - 1;
uint
256
mask = 256 ** (32 - len) - 1;
assembly {
assembly {
let srcpart := and(mload(src), not(mask))
let srcpart := and(mload(src), not(mask))
let destpart := and(mload(dest), mask)
let destpart := and(mload(dest), mask)
...
@@ -258,20 +258,20 @@ library Lib_RLPWriter {
...
@@ -258,20 +258,20 @@ library Lib_RLPWriter {
return new bytes(0);
return new bytes(0);
}
}
uint len;
uint
256
len;
uint i = 0;
uint
256
i = 0;
for (; i < _list.length; i++) {
for (; i < _list.length; i++) {
len += _list[i].length;
len += _list[i].length;
}
}
bytes memory flattened = new bytes(len);
bytes memory flattened = new bytes(len);
uint flattenedPtr;
uint
256
flattenedPtr;
assembly { flattenedPtr := add(flattened, 0x20) }
assembly { flattenedPtr := add(flattened, 0x20) }
for(i = 0; i < _list.length; i++) {
for(i = 0; i < _list.length; i++) {
bytes memory item = _list[i];
bytes memory item = _list[i];
uint listPtr;
uint
256
listPtr;
assembly { listPtr := add(item, 0x20)}
assembly { listPtr := add(item, 0x20)}
_memcpy(flattenedPtr, listPtr, item.length);
_memcpy(flattenedPtr, listPtr, item.length);
...
...
packages/contracts/contracts/test-helpers/Helper_GasMeasurer.sol
View file @
fab8c869
...
@@ -7,13 +7,13 @@ contract Helper_GasMeasurer {
...
@@ -7,13 +7,13 @@ contract Helper_GasMeasurer {
bytes memory _data
bytes memory _data
)
)
public
public
returns ( uint )
returns ( uint
256
)
{
{
uint gasBefore;
uint
256
gasBefore;
uint gasAfter;
uint
256
gasAfter;
uint calldataStart;
uint
256
calldataStart;
uint calldataLength;
uint
256
calldataLength;
assembly {
assembly {
calldataStart := add(_data,0x20)
calldataStart := add(_data,0x20)
calldataLength := mload(_data)
calldataLength := mload(_data)
...
...
packages/contracts/contracts/test-helpers/TestERC20.sol
View file @
fab8c869
...
@@ -8,43 +8,43 @@ contract TestERC20 {
...
@@ -8,43 +8,43 @@ contract TestERC20 {
string public constant name = 'Test';
string public constant name = 'Test';
string public constant symbol = 'TST';
string public constant symbol = 'TST';
uint8 public constant decimals = 18;
uint8 public constant decimals = 18;
uint public totalSupply;
uint
256
public totalSupply;
mapping(address => uint) public balanceOf;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
mapping(address => mapping(address => uint)) public allowance;
event Approval(address indexed owner, address indexed spender, uint value);
event Approval(address indexed owner, address indexed spender, uint
256
value);
event Transfer(address indexed from, address indexed to, uint value);
event Transfer(address indexed from, address indexed to, uint
256
value);
constructor() public {}
constructor() public {}
function mint(address to, uint value) public {
function mint(address to, uint
256
value) public {
totalSupply = totalSupply.add(value);
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
emit Transfer(address(0), to, value);
}
}
function _approve(address owner, address spender, uint value) private {
function _approve(address owner, address spender, uint
256
value) private {
allowance[owner][spender] = value;
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
emit Approval(owner, spender, value);
}
}
function _transfer(address from, address to, uint value) private {
function _transfer(address from, address to, uint
256
value) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
emit Transfer(from, to, value);
}
}
function approve(address spender, uint value) external returns (bool) {
function approve(address spender, uint
256
value) external returns (bool) {
_approve(msg.sender, spender, value);
_approve(msg.sender, spender, value);
return true;
return true;
}
}
function transfer(address to, uint value) external returns (bool) {
function transfer(address to, uint
256
value) external returns (bool) {
_transfer(msg.sender, to, value);
_transfer(msg.sender, to, value);
return true;
return true;
}
}
function transferFrom(address from, address to, uint value) external returns (bool) {
function transferFrom(address from, address to, uint
256
value) external returns (bool) {
if (allowance[from][msg.sender] != uint(-1)) {
if (allowance[from][msg.sender] != uint(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
}
}
...
@@ -54,15 +54,15 @@ contract TestERC20 {
...
@@ -54,15 +54,15 @@ contract TestERC20 {
}
}
library SafeMath {
library SafeMath {
function add(uint
x, uint y) internal pure returns (uint
z) {
function add(uint
256 x, uint256 y) internal pure returns (uint256
z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
require((z = x + y) >= x, 'ds-math-add-overflow');
}
}
function sub(uint
x, uint y) internal pure returns (uint
z) {
function sub(uint
256 x, uint256 y) internal pure returns (uint256
z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
}
function mul(uint
x, uint y) internal pure returns (uint
z) {
function mul(uint
256 x, uint256 y) internal pure returns (uint256
z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
}
}
packages/contracts/contracts/test-libraries/rlp/TestLib_RLPWriter.sol
View file @
fab8c869
...
@@ -60,7 +60,7 @@ contract TestLib_RLPWriter {
...
@@ -60,7 +60,7 @@ contract TestLib_RLPWriter {
}
}
function writeUint(
function writeUint(
uint _in
uint
256
_in
)
)
public
public
pure
pure
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment