Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Generic handler update (#88)
Browse files Browse the repository at this point in the history
* Add semicolon

* Update genric handler. Add tests

* Remove test events

* Refactor _bytesToBytes32 method

* Update Bridge generic deposit test:

* Add CentrifugeAsset contract

* Add executeDeposit test for generic handler

* Remove no longer used Centrifuge Asset handler

* Update deposit method and add executeDeposit method

* Remove no longer needed contract

* Update assembly

* Add test to verify depositRecord was created correctly

* Add test to verify AssetStored event wasn't emitted in executeDeposit call

* Remove no longer needed method

* Update to inherit from IDepositHandler

* Update tests to work with new GenericHandler

* Remove no longer needed Handler and test

* FunctionSignature is now parsed and used to compare with function sig stored in _contractAddressToExecuteFunctionSignature mapping

* Update test to check for AssertStored event and verify asset was marked as stored

* Temporarily disable Centrifuge CLI command

* Temporarily disable Centrifuge CLI command

* Debugging

* Debugging

* Debugging

* Debugging

* Debugging

* Debugging

* Remove test event
  • Loading branch information
spacesailor24 committed Apr 24, 2020
1 parent 2dd9b2a commit af8d5cb
Show file tree
Hide file tree
Showing 14 changed files with 498 additions and 365 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/deploy.js
Expand Up @@ -18,7 +18,7 @@ const deployCmd = new Command("deploy")
await deployERC20Handler(args);
await deployERC721(args)
await deployERC721Handler(args)
await deployCentrifugeHandler(args);
// await deployCentrifugeHandler(args);
args.cost = startBal.sub((await args.provider.getBalance(args.wallet.address)))
displayLog(args)
})
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/index.js
@@ -1,11 +1,11 @@
const deploy = require("./deploy");
const erc20 = require("./erc20");
const erc721 = require("./erc721");
const centrifuge = require("./centrifuge");
// const centrifuge = require("./centrifuge");

module.exports = {
deploy,
erc20,
erc721,
centrifuge,
// centrifuge,
}
2 changes: 1 addition & 1 deletion cli/constants.js
Expand Up @@ -12,7 +12,7 @@ const ContractABIs = {
Erc20Mintable: require(CONTRACT_PATH + "/build/contracts/ERC20PresetMinterPauser.json"),
Erc721Handler: require(CONTRACT_PATH + "/build/contracts/ERC721Handler.json"),
Erc721Mintable: require(CONTRACT_PATH + "/build/contracts/ERC721MinterBurnerPauser.json"),
CentrifugeHandler: require(CONTRACT_PATH + "/build/contracts/CentrifugeAssetHandler.json")
// CentrifugeHandler: require(CONTRACT_PATH + "/build/contracts/CentrifugeAssetHandler.json")
}

module.exports.ContractABIs = ContractABIs
Expand Down
4 changes: 2 additions & 2 deletions cli/index.js
Expand Up @@ -8,7 +8,7 @@ const {
deploy,
erc20,
erc721,
centrifuge,
// centrifuge,
} = require('./cmd/index');
const constants = require('./constants');

Expand All @@ -19,7 +19,7 @@ program.option('--private-key <value>', 'Private key to use', constants.deployer
program.addCommand(deploy)
program.addCommand(erc20)
program.addCommand(erc721)
program.addCommand(centrifuge)
// program.addCommand(centrifuge)

program.allowUnknownOption(false);

Expand Down
15 changes: 15 additions & 0 deletions contracts/CentrifugeAsset.sol
@@ -0,0 +1,15 @@
pragma solidity 0.6.4;
pragma experimental ABIEncoderV2;

contract CentrifugeAsset {
mapping (bytes32 => bool) public _assetsStored;

event AssetStored(bytes32 indexed asset);

function store(bytes32 asset) public {
require(!_assetsStored[asset], "asset is already stored");

_assetsStored[asset] = true;
emit AssetStored(asset);
}
}
187 changes: 0 additions & 187 deletions contracts/handlers/CentrifugeAssetHandler.sol

This file was deleted.

0 comments on commit af8d5cb

Please sign in to comment.