Skip to content

Instantly share code, notes, and snippets.

View JTraversa's full-sized avatar

Julian Traversa JTraversa

View GitHub Profile
struct RPCSig{
uint8 v;
bytes32 r;
bytes32 s;
}
struct EIP712Domain {
string name;
string version;
uint256 chainId;
function createErcOffer() {
const typedData = {
types: {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' }
],
Offer: [
if (window.ethereum) {
var web3 = new Web3(window.ethereum);
window.ethereum.enable();}
const childChain = new ChildChain({ watcherUrl: "https://watcher-info.ropsten.v1.omg.network" });
account = getAccounts(function(result) {
document.getElementById("useraddress").innerHTML = result[0];
});
async function transfer () {
// We want to pay the fee in ETH, so we have to fetch the ETH fee amount from the Watcher
const allFees = await childChain.getFees()
pragma solidity ^0.5.9;
pragma experimental ABIEncoderV2;
import "./safeMath.sol";
contract DefiHedge {
struct RPCSig{
uint8 v;
bytes32 r;
/// Taker signs a previously created/validated offer, submits it to chain for signature verification.
var d = new Date();
var t = d.getTime().toString();
var currentAddress = document.getElementById("useraddress").innerHTML;
var minorSalt = currentAddress + t;
var Salt = web3.utils.keccak256(minorSalt).toString();