From 37efb0c69cb497f71ee549b934e75e19bcf03667 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 4 Aug 2020 15:38:53 +0530 Subject: [PATCH] Removed events, setId, getId from chi connector --- contracts/connectors/chi.sol | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/contracts/connectors/chi.sol b/contracts/connectors/chi.sol index 5d1fe25..2cc15db 100644 --- a/contracts/connectors/chi.sol +++ b/contracts/connectors/chi.sol @@ -23,53 +23,28 @@ contract ChiHelpers is DSMath, Stores { contract ChiResolver is ChiHelpers { - event LogMint(uint256 tokenAmt, uint256 getId, uint256 setId); - event LogBurn(uint256 tokenAmt, uint256 getId, uint256 setId); - /** * @dev Mint CHI token. * @param amt token amount to mint. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. */ - function mint(uint amt, uint getId, uint setId) public payable { - uint _amt = getUint(getId, amt); - _amt = _amt == uint(-1) ? 140 : _amt; + function mint(uint amt) public payable { + uint _amt = amt == uint(-1) ? 140 : amt; require(_amt <= 140, "Max minting is 140 chi"); - CHIInterface(getCHIAddress()).mint(_amt); - - setUint(setId, _amt); - - emit LogMint(_amt, getId, setId); - bytes32 _eventCode = keccak256("LogMint(uint256,uint256,uint256)"); - bytes memory _eventParam = abi.encode(_amt, getId, setId); - emitEvent(_eventCode, _eventParam); } /** * @dev burn CHI token. * @param amt token amount to burn. - * @param getId Get token amount at this ID from `InstaMemory` Contract. - * @param setId Set token amount at this ID in `InstaMemory` Contract. */ - function burn(uint amt, uint getId, uint setId) public payable { - uint _amt = getUint(getId, amt); + function burn(uint amt) public payable { CHIInterface chiToken = CHIInterface(getCHIAddress()); - _amt = _amt == uint(-1) ? chiToken.balanceOf(address(this)) : _amt; + uint _amt = amt == uint(-1) ? chiToken.balanceOf(address(this)) : amt; chiToken.free(_amt); - - setUint(setId, _amt); - - emit LogBurn(_amt, getId, setId); - bytes32 _eventCode = keccak256("LogBurn(uint256,uint256,uint256)"); - bytes memory _eventParam = abi.encode(_amt, getId, setId); - emitEvent(_eventCode, _eventParam); } } - contract ConnectCHI is ChiResolver { string public name = "CHI-v1"; } \ No newline at end of file