Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC677BridgeFixedSupplyToken #685

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Modify into ERC677BridgeFixedSupplyToken
dapplion committed Apr 3, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 6b68a49f85c138bca1a4b5a3f1dd8e6a7ec5092d
26 changes: 19 additions & 7 deletions contracts/ERC677BridgeFixedSupplyToken.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pragma solidity 0.4.24;

import "openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol";
import "openzeppelin-solidity/contracts/AddressUtils.sol";
import "./interfaces/IBurnableMintableERC677Token.sol";
@@ -11,7 +9,7 @@ import "./upgradeable_contracts/Claimable.sol";
* @title ERC677BridgeToken
* @dev The basic implementation of a bridgeable ERC677-compatible token
*/
contract ERC677BridgeToken is IBurnableMintableERC677Token, DetailedERC20, BurnableToken, MintableToken, Claimable {
contract ERC677BridgeFixedSupplyToken is IBurnableMintableERC677Token, DetailedERC20, Claimable {
bytes4 internal constant ON_TOKEN_TRANSFER = 0xa4c0ed36; // onTokenTransfer(address,uint256,bytes)

address internal bridgeContractAddr;
@@ -94,10 +92,6 @@ contract ERC677BridgeToken is IBurnableMintableERC677Token, DetailedERC20, Burna
return _to.call(abi.encodeWithSelector(ON_TOKEN_TRANSFER, _from, _value, _data));
}

function finishMinting() public returns (bool) {
revert();
}

function renounceOwnership() public onlyOwner {
revert();
}
@@ -118,5 +112,23 @@ contract ERC677BridgeToken is IBurnableMintableERC677Token, DetailedERC20, Burna
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
return super.decreaseApproval(spender, subtractedValue);
}

/**
* @dev No-op burn function, caller keeps the tokens
* @param _value
*/
function burn(uint256 _value) public {
// no-op
}

/**
* @dev Pass-through function to transfer
* @param _to The address that will receive the tokens.
* @param _amount The amount of tokens to transfer.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) public returns (bool) {
return transfer(_to, _amount);
}
}