Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function keccak256(...args) {
return Utils.Conversion.toHexString(Utils.EVM.keccak256(...args));
}
[action.storageAddress]: {
storage: {},
code: "0x",
context: null
//there will be more here in the future!
}
}
};
return newState;
case actions.STORE: {
debug("store action");
//on a store, the relevant page should already exist, so we can just
//add or update the needed slot
const { address, slot, value } = action;
if (address === CodecUtils.EVM.ZERO_ADDRESS) {
//as always, we do not maintain a zero page
return state;
}
newState = state.slice(); //clone the state
topCodex = newState[newState.length - 1];
newState[newState.length - 1] = updateFrameStorage(
topCodex,
address,
slot,
value
);
return newState;
}
case actions.LOAD: {
debug("load action");
address =>
address !== undefined && address !== CodecUtils.EVM.ZERO_ADDRESS
)
/*
* Default case
*/
default:
return state;
}
}
const info = combineReducers({
contexts
});
const DEFAULT_TX = {
gasprice: new BN(0),
origin: CodecUtils.EVM.ZERO_ADDRESS
};
function tx(state = DEFAULT_TX, action) {
switch (action.type) {
case actions.SAVE_GLOBALS:
let { gasprice, origin } = action;
return { gasprice, origin };
case actions.UNLOAD_TRANSACTION:
return DEFAULT_TX;
default:
return state;
}
}
const DEFAULT_BLOCK = {
coinbase: CodecUtils.EVM.ZERO_ADDRESS,