Skip to content

Commit

Permalink
feat: poap smart contract migration
Browse files Browse the repository at this point in the history
  • Loading branch information
n4l5u0r committed Mar 4, 2022
1 parent d8a2d3a commit 5ac9356
Show file tree
Hide file tree
Showing 26 changed files with 115 additions and 442 deletions.

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions tests/networks/ethereum/poap/b2c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"chainId": 1,
"contracts": [
{
"address": "0x0bb4d3e88243f4a057db77341e6916b0e449b158",
"contractName": "PoapBridge",
"selectors": {
"0xaf68b302": {
"erc20OfInterest": [],
"method": "mintToken",
"plugin": "Poap"
}
}
}
],
"name": "Poap"
}
22 changes: 0 additions & 22 deletions tests/poap/b2c.json

This file was deleted.

Binary file modified tests/snapshots/nanos_mint_token/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_mint_token/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_mint_token/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_mint_token/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanos_mint_token/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed tests/snapshots/nanos_safe_transfer/00000.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00001.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00002.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00003.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00004.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00005.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00006.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00007.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00008.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00009.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00010.png
Binary file not shown.
Binary file removed tests/snapshots/nanos_safe_transfer/00011.png
Binary file not shown.
Binary file modified tests/snapshots/nanox_mint_token/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox_mint_token/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/nanox_mint_token/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions tests/src/generate_plugin_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ function assert(condition, message) {
function generate_plugin_config() {

var fs = require('fs');
var files = fs.readdirSync(`${pluginFolder}/abis/`);
var files = fs.readdirSync(`networks/ethereum/${pluginFolder}/abis/`);

// `contracts_to_abis` holds a maping of contract addresses to abis
let contracts_to_abis = {};
for (let abiFileName of files) {
assert(abiFileName.toLocaleLowerCase() == abiFileName, `FAILED: File ${abiFileName} should be lower case.`);

// Strip ".json" suffix
let contractAddress = abiFileName.slice(0, abiFileName.length - ".json".length);
let contractAddress = abiFileName.slice(0, abiFileName.length - ".abi.json".length);
// Load abi
let abi = require(`../${pluginFolder}/abis/${abiFileName}`);
let abi = require(`../networks/ethereum/${pluginFolder}/abis/${abiFileName}`);
// Add it to contracts
contracts_to_abis[contractAddress] = abi;
}

// Load the b2c.json file
const b2c = require(`../${pluginFolder}/b2c.json`);
const b2c = require(`../networks/ethereum/${pluginFolder}/b2c.json`);

let res = {};

Expand Down
4 changes: 2 additions & 2 deletions tests/src/mint_token.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { processTest } from "./test.fixture";

const contractName = "PoapDelegatedMint";
// From : https://etherscan.io/tx/0x1c926a7d245bca1384527db34bfd31eb63b4177bb48097504fcbd2f340a05593
const rawTxHex = "0x02f90172010684625900808518ae17a40083055d16946f2235864cf897078fcdcc2854b76c482cd1687480b901043da5b8f0000000000000000000000000000000000000000000000000000000000000377300000000000000000000000000000000000000000000000000000000002a0c4c0000000000000000000000002fe50deacdb83eb8beababc73ac8d78cf478675f00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000041b9273bc96569b576e0dd193b51f0d06f9014a46bd49c528c224e58c7589862ae6df7f62f39a46f4f3d67d6d9a9adb0467631b53dbf999df94c139c380fe9ee2e1c00000000000000000000000000000000000000000000000000000000000000c080a0f9fd00402d510a7c89d81dbea9c93da5add1c923eaddeb8fcd20070c51768ff3a07bdf6784281b97b9edadcbec055ca24d8989d5496b336e264001af3df8c9d195";
// From : https://etherscan.io/tx/0x1b661fb1ed634031b13d7532fa2982f95c73b3c926ee91960d5c7fcca0ff581a
const rawTxHex = "0x02f9019d018201328505b11d38338505b11d38338313d620940bb4d3e88243f4a057db77341e6916b0e449b15888016345785d8a0000b90124af68b3020000000000000000000000000000000000000000000000000000000000006cf600000000000000000000000000000000000000000000000000000000003f150200000000000000000000000081168c14e5a89f60b30e9a7f82a229406a64369d000000000000000000000000000000000000000000000000000000006221db8200000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000418d0ac5f026acfc0cc918f254c6800da31d530f81fc4a2f5db1560325a8603cbc3d99171f880ea7ca8a58f015babdfdc35c57b4b71c13e7a287d0f157789443441b00000000000000000000000000000000000000000000000000000000000000c001a0e08a75698f4c3d3b49ed28b4351a8459cf9871348fc4e5abeca91abd5c8611d3a0522183a413ee3abcad93c5f3dbfcfdfe9b4eca34acf855005e2f2d8d4f2ff80f";

const testLabel = "Mint Token"; // <= Name of the test
const testDirSuffix = "mint_token"; // <= directory to compare device snapshots to
Expand Down
49 changes: 0 additions & 49 deletions tests/src/safe_transfer.test.js

This file was deleted.

0 comments on commit 5ac9356

Please sign in to comment.