dsa-connectors/contracts/mainnet/connectors/chi/main.sol
Ardhead 0ef4667258
Checker for solidity code (#32)
* raw logic

* rename and output update

* checks update

* name & comments checks update

* Updated comments for reflexer

* Updated comments

* colors and line numbers

* commit test

* commit test 2

* commit test 3

* commit test 4

* commit test 5

* commit test 6

* commit test 7

* reset branch

* commit test 1

* commit test 1

* test commit 1

* test commit

* test

* test

* test workflow

Co-authored-by: Thrilok Kumar <thrilok2000@gmail.com>
2021-05-07 22:06:52 +05:30

38 lines
1.1 KiB
Solidity

pragma solidity ^0.7.0;
import { Helpers } from "./helpers.sol";
import { Events } from "./events.sol";
abstract contract ChiResolver is Events, Helpers {
/**
* @dev Mint token.
* @notice Mint CHI token.
* @param amt token amount to mint.
*/
function mint(uint amt) public payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = amt == uint(-1) ? 140 : amt;
require(_amt <= 140, "Max minting is 140 chi");
chi.mint(_amt);
_eventName = "LogMint(uint256)";
_eventParam = abi.encode(_amt);
}
/**
* @dev Burn token.
* @notice burns CHI token.
* @param amt token amount to burn.
*/
function burn(uint amt) public payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = amt == uint(-1) ? chi.balanceOf(address(this)) : amt;
chi.approve(address(chi), _amt);
chi.free(_amt);
_eventName = "LogBurn(uint256)";
_eventParam = abi.encode(_amt);
}
}
contract ConnectV2CHI is ChiResolver {
string public name = "CHI-v1";
}