Skip to content

Commit

Permalink
updated contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
the-code-writer committed Dec 19, 2021
1 parent 1e306f9 commit 94a23f4
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 29 deletions.
6 changes: 0 additions & 6 deletions src/token/BEP20/BEP20SmartContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ import "./dapps/dvault/BEP20DistributedVault.sol";

contract BEP20SmartContract is BEP20Capped, BEP20Mintable, BEP20Burnable, BEP20Operable, BEP20Pausable, BEP20Deflationary, TokenRecover, BEP20DecentralisedAutonomousOrganization, BEP20DistributedBank, BEP20DistributedExchange, BEP20DistributedVault {

/*
contract BEP20SmartContract is BEP20Capped, BEP20Mintable, BEP20Burnable, BEP20Operable, BEP20Pausable, BEP20Deflationary, TokenRecover {
*/

constructor (
string memory name_,
string memory symbol_,
Expand Down
9 changes: 2 additions & 7 deletions src/token/BEP20/dapps/dbank/BEP20DistributedBank.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.0;

import "../../interfaces/BEP20.sol";
//import "../../interfaces/BEP20.sol";

import "../dbank/deposits/Deposits.sol";
import "../dbank/collateral_loans/Borrow.sol";
Expand All @@ -13,7 +13,7 @@ import "../dbank/withdrawals/Withdrawals.sol";
* @title BEP20DistributedVault
* @dev Allow to recover any BEP20 sent into the contract for error
*/
abstract contract BEP20DistributedBank is BEP20, Deposits, Borrow, Lend, Withdrawals {
abstract contract BEP20DistributedBank is Deposits, Borrow, Lend, Withdrawals {

struct Transaction {
address fromAddress;
Expand All @@ -23,11 +23,6 @@ abstract contract BEP20DistributedBank is BEP20, Deposits, Borrow, Lend, Withdra

Transaction[] transactions;

modifier onlyOwner() {
require(owner == msg.sender);
_;
}

/*
* @dev Remember that only owner can call so be careful when use on contracts generated from other contracts.
* @param tokenAddress The token contract address
Expand Down
2 changes: 1 addition & 1 deletion src/token/BEP20/dapps/dbank/collateral_loans/Borrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract contract Borrow is BankBaseContract {
uint tokensToMint = collateralEther[msg.sender] / 2;

//mint&send tokens to user
super.token.mint(msg.sender, tokensToMint);
BankBaseContract.token.mint(msg.sender, tokensToMint);

//activate borrower's loan status
isBorrowed[msg.sender] = true;
Expand Down
4 changes: 2 additions & 2 deletions src/token/BEP20/dapps/dbank/interface/BankBaseContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "./BankToken.sol";

abstract contract BankBaseContract {

BankToken private token;
BankToken public token;

mapping(address => uint) public depositStart;
mapping(address => uint) public etherBalanceOf;
Expand All @@ -20,7 +20,7 @@ abstract contract BankBaseContract {
event BEP20DistributedBankBorrow(address indexed user, uint collateralEtherAmount, uint borrowedTokenAmount);
event BEP20DistributedBankPayOff(address indexed user, uint fee);

constructor(BankToken _token) public {
constructor(BankToken _token) {
token = _token;
}

Expand Down
2 changes: 1 addition & 1 deletion src/token/BEP20/dapps/dbank/interface/BankToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.0;

import "../../../interfaces/BEP20.sol";

abstract contract BankToken is BEP20 {
contract BankToken is BEP20 {

address public minter;

Expand Down
8 changes: 4 additions & 4 deletions src/token/BEP20/dapps/dbank/yeild_farming/Lend.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import "../interface/BankBaseContract.sol";
*/
abstract contract Lend is BankBaseContract{

string public name = "Dapp Token Farm";
address public owner;
string public lendTokenName = "Dapp Token Farm";
address public lendOwner;
DappToken public dappToken;
DaiToken public daiToken;

Expand All @@ -26,7 +26,7 @@ abstract contract Lend is BankBaseContract{
constructor(DappToken _dappToken, DaiToken _daiToken) public {
dappToken = _dappToken;
daiToken = _daiToken;
owner = msg.sender;
lendOwner = msg.sender;
}

// indicates if minting is finished
Expand Down Expand Up @@ -84,7 +84,7 @@ abstract contract Lend is BankBaseContract{
// Issuing Tokens
function bankIssueTokens() public {
// Only owner can call this function
require(msg.sender == owner, "caller must be the owner");
require(msg.sender == lendOwner, "caller must be the owner");

// Issue tokens to all stakers
for (uint i=0; i<stakers.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/token/BEP20/dapps/dex/BEP20DistributedExchange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract contract BEP20DistributedExchange is BEP20, Arbitrage, PriceMonitor, Tr
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function init(address tokenAddress, uint256 tokenAmount) public {
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) override virtual public {

}

Expand Down
2 changes: 1 addition & 1 deletion src/token/BEP20/dapps/dex/arbitrage/Arbitrage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract Arbitrage {
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) public {
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) virtual public {

}

Expand Down
2 changes: 1 addition & 1 deletion src/token/BEP20/dapps/dex/bot/PriceMonitor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract PriceMonitor {
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount) public {
function monitor(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) virtual public {

}

Expand Down
2 changes: 1 addition & 1 deletion src/token/BEP20/dapps/dex/bot/Trader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract Trader {
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount) public {
function trade(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) virtual public {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract FlashSwap001 {
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount) public {
function executeOpportunity1(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) virtual public {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract FlashSwap002 {
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount) public {
function executeOpportunity2(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) virtual public {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract FlashSwap003 {
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function executeOpportunity(address tokenAddressA, address tokenAddressB, uint256 tokenAmount) public {
function executeOpportunity3(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) virtual public {

}

Expand Down
2 changes: 1 addition & 1 deletion src/token/BEP20/dapps/dex/swaps/Exchange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract contract Exchange {
* @param tokenAddress The token contract address
* @param tokenAmount Number of tokens to be sent
*/
function swap(address tokenAddressA, address tokenAddressB, uint256 tokenAmount) public {
function swap(address tokenAddressA, address tokenAddressB, uint256 tokenAmount, string memory exchange) virtual public {

}

Expand Down

0 comments on commit 94a23f4

Please sign in to comment.