Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
MasterHealer
作成日
5 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
33 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
124 行
すべてコピー
17 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
112 行
すべてコピー
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
pragma solidity 0.8.6;
コピー
コピー済み
コピー
コピー済み
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "./libs/IMasterchef.sol";
import "./libs/IMasterchef.sol";
import "./BaseStrategyLPSingle.sol";
import "./BaseStrategyLPSingle.sol";
コピー
コピー済み
コピー
コピー済み
contract StrategyMaster
Chef
is BaseStrategyLPSingle
, Initializable
{
contract StrategyMaster
Healer
is BaseStrategyLPSingle
{
using SafeMath for uint256;
using SafeMath for uint256;
using SafeERC20 for IERC20;
using SafeERC20 for IERC20;
address public masterchefAddress;
address public masterchefAddress;
uint256 public pid;
uint256 public pid;
コピー
コピー済み
コピー
コピー済み
/**
constructor(
address[8] _configAddresses,
address[
5
] memory _
configAddress, //vaulthealer, masterchef, unirouter, want, earned
_configAddresses[0] _vaultChefAddress,
_configAddresses[1] _masterchefAddress,
_configAddresses[2] _uniRouterAddress,
_configAddresses[3] _wantAddress,
_configAddress[4] _earnedAddress,
_configAddress[5] _usdAddress,
_configAddress[6] _bananaAddress,
*/
function initialize(
address[
7
] memory _
configAddresses,
uint256 _pid,
uint256 _pid,
コピー
コピー済み
コピー
コピー済み
address[] memory _earnedToW
n
ati
ve
Path,
uint256 _tolerance,
address[] memory _earnedToUsd
Path,
address[] memory _earnedToW
m
ati
c
Path,
address[] memory _earnedTo
Banana
Path,
address[] memory _earnedToUsd
c
Path,
address[] memory _earnedTo
Crystl
Path,
address[] memory _earnedToToken0Path,
address[] memory _earnedToToken0Path,
address[] memory _earnedToToken1Path,
address[] memory _earnedToToken1Path,
address[] memory _token0ToEarnedPath,
address[] memory _token0ToEarnedPath,
address[] memory _token1ToEarnedPath
address[] memory _token1ToEarnedPath
コピー
コピー済み
コピー
コピー済み
)
external initializer
{
)
{
govAddress = msg.sender;
govAddress = msg.sender;
コピー
コピー済み
コピー
コピー済み
vaultChefAddress = _configAddress
es
[0];
vaultChefAddress = _configAddress
[0];
masterchefAddress = _configAddress
es
[1];
masterchefAddress = _configAddress
[1];
uniRouterAddress = _configAddress
es
[2];
uniRouterAddress = _configAddress
[2];
コピー
コピー済み
コピー
コピー済み
wantAddress = _configAddress
es
[3];
wantAddress = _configAddress
[3];
token0Address = IUniPair(wantAddress).token0();
token0Address = IUniPair(wantAddress).token0();
token1Address = IUniPair(wantAddress).token1();
token1Address = IUniPair(wantAddress).token1();
pid = _pid;
pid = _pid;
コピー
コピー済み
コピー
コピー済み
earnedAddress = _configAddress
es
[4];
earnedAddress = _configAddress
[4];
usdAddress = _configAddresses[5];
tolerance
= _
tolerance
;
bananaAddress
= _
configAddresses[6]
;
コピー
コピー済み
コピー
コピー済み
earnedToWnativePath = _earnedToW
n
ati
ve
Path;
earnedToWnativePath = _earnedToW
m
ati
c
Path;
earnedToUsdPath = _earnedToUsd
Path;
earnedToUsdPath = _earnedToUsd
c
Path;
earnedTo
Banana
Path = _earnedTo
Banana
Path;
earnedTo
Crystl
Path = _earnedTo
Crystl
Path;
earnedToToken0Path = _earnedToToken0Path;
earnedToToken0Path = _earnedToToken0Path;
earnedToToken1Path = _earnedToToken1Path;
earnedToToken1Path = _earnedToToken1Path;
token0ToEarnedPath = _token0ToEarnedPath;
token0ToEarnedPath = _token0ToEarnedPath;
token1ToEarnedPath = _token1ToEarnedPath;
token1ToEarnedPath = _token1ToEarnedPath;
transferOwnership(vaultChefAddress);
transferOwnership(vaultChefAddress);
_resetAllowances();
_resetAllowances();
}
}
function _vaultDeposit(uint256 _amount) internal override {
function _vaultDeposit(uint256 _amount) internal override {
IMasterchef(masterchefAddress).deposit(pid, _amount);
IMasterchef(masterchefAddress).deposit(pid, _amount);
}
}
function _vaultWithdraw(uint256 _amount) internal override {
function _vaultWithdraw(uint256 _amount) internal override {
IMasterchef(masterchefAddress).withdraw(pid, _amount);
IMasterchef(masterchefAddress).withdraw(pid, _amount);
}
}
function _vaultHarvest() internal override {
function _vaultHarvest() internal override {
IMasterchef(masterchefAddress).withdraw(pid, 0);
IMasterchef(masterchefAddress).withdraw(pid, 0);
}
}
function vaultSharesTotal() public override view returns (uint256) {
function vaultSharesTotal() public override view returns (uint256) {
(uint256 amount,) = IMasterchef(masterchefAddress).userInfo(pid, address(this));
(uint256 amount,) = IMasterchef(masterchefAddress).userInfo(pid, address(this));
return amount;
return amount;
}
}
function wantLockedTotal() public override view returns (uint256) {
function wantLockedTotal() public override view returns (uint256) {
return IERC20(wantAddress).balanceOf(address(this))
return IERC20(wantAddress).balanceOf(address(this))
.add(vaultSharesTotal());
.add(vaultSharesTotal());
}
}
function _resetAllowances() internal override {
function _resetAllowances() internal override {
IERC20(wantAddress).safeApprove(masterchefAddress, uint256(0));
IERC20(wantAddress).safeApprove(masterchefAddress, uint256(0));
IERC20(wantAddress).safeIncreaseAllowance(
IERC20(wantAddress).safeIncreaseAllowance(
masterchefAddress,
masterchefAddress,
type(uint256).max
type(uint256).max
);
);
IERC20(earnedAddress).safeApprove(uniRouterAddress, uint256(0));
IERC20(earnedAddress).safeApprove(uniRouterAddress, uint256(0));
IERC20(earnedAddress).safeIncreaseAllowance(
IERC20(earnedAddress).safeIncreaseAllowance(
uniRouterAddress,
uniRouterAddress,
type(uint256).max
type(uint256).max
);
);
IERC20(token0Address).safeApprove(uniRouterAddress, uint256(0));
IERC20(token0Address).safeApprove(uniRouterAddress, uint256(0));
IERC20(token0Address).safeIncreaseAllowance(
IERC20(token0Address).safeIncreaseAllowance(
uniRouterAddress,
uniRouterAddress,
type(uint256).max
type(uint256).max
);
);
IERC20(token1Address).safeApprove(uniRouterAddress, uint256(0));
IERC20(token1Address).safeApprove(uniRouterAddress, uint256(0));
IERC20(token1Address).safeIncreaseAllowance(
IERC20(token1Address).safeIncreaseAllowance(
uniRouterAddress,
uniRouterAddress,
type(uint256).max
type(uint256).max
);
);
}
}
function _emergencyVaultWithdraw() internal override {
function _emergencyVaultWithdraw() internal override {
IMasterchef(masterchefAddress).emergencyWithdraw(pid);
IMasterchef(masterchefAddress).emergencyWithdraw(pid);
}
}
function _beforeDeposit(address _to) internal override {
function _beforeDeposit(address _to) internal override {
}
}
function _beforeWithdraw(address _to) internal override {
function _beforeWithdraw(address _to) internal override {
}
}
}
}
コピー
コピー済み
コピー
コピー済み
保存された差分
原文
ファイルを開く
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "./libs/IMasterchef.sol"; import "./BaseStrategyLPSingle.sol"; contract StrategyMasterChef is BaseStrategyLPSingle, Initializable { using SafeMath for uint256; using SafeERC20 for IERC20; address public masterchefAddress; uint256 public pid; /** address[8] _configAddresses, _configAddresses[0] _vaultChefAddress, _configAddresses[1] _masterchefAddress, _configAddresses[2] _uniRouterAddress, _configAddresses[3] _wantAddress, _configAddress[4] _earnedAddress, _configAddress[5] _usdAddress, _configAddress[6] _bananaAddress, */ function initialize( address[7] memory _configAddresses, uint256 _pid, address[] memory _earnedToWnativePath, address[] memory _earnedToUsdPath, address[] memory _earnedToBananaPath, address[] memory _earnedToToken0Path, address[] memory _earnedToToken1Path, address[] memory _token0ToEarnedPath, address[] memory _token1ToEarnedPath ) external initializer { govAddress = msg.sender; vaultChefAddress = _configAddresses[0]; masterchefAddress = _configAddresses[1]; uniRouterAddress = _configAddresses[2]; wantAddress = _configAddresses[3]; token0Address = IUniPair(wantAddress).token0(); token1Address = IUniPair(wantAddress).token1(); pid = _pid; earnedAddress = _configAddresses[4]; usdAddress = _configAddresses[5]; bananaAddress = _configAddresses[6]; earnedToWnativePath = _earnedToWnativePath; earnedToUsdPath = _earnedToUsdPath; earnedToBananaPath = _earnedToBananaPath; earnedToToken0Path = _earnedToToken0Path; earnedToToken1Path = _earnedToToken1Path; token0ToEarnedPath = _token0ToEarnedPath; token1ToEarnedPath = _token1ToEarnedPath; transferOwnership(vaultChefAddress); _resetAllowances(); } function _vaultDeposit(uint256 _amount) internal override { IMasterchef(masterchefAddress).deposit(pid, _amount); } function _vaultWithdraw(uint256 _amount) internal override { IMasterchef(masterchefAddress).withdraw(pid, _amount); } function _vaultHarvest() internal override { IMasterchef(masterchefAddress).withdraw(pid, 0); } function vaultSharesTotal() public override view returns (uint256) { (uint256 amount,) = IMasterchef(masterchefAddress).userInfo(pid, address(this)); return amount; } function wantLockedTotal() public override view returns (uint256) { return IERC20(wantAddress).balanceOf(address(this)) .add(vaultSharesTotal()); } function _resetAllowances() internal override { IERC20(wantAddress).safeApprove(masterchefAddress, uint256(0)); IERC20(wantAddress).safeIncreaseAllowance( masterchefAddress, type(uint256).max ); IERC20(earnedAddress).safeApprove(uniRouterAddress, uint256(0)); IERC20(earnedAddress).safeIncreaseAllowance( uniRouterAddress, type(uint256).max ); IERC20(token0Address).safeApprove(uniRouterAddress, uint256(0)); IERC20(token0Address).safeIncreaseAllowance( uniRouterAddress, type(uint256).max ); IERC20(token1Address).safeApprove(uniRouterAddress, uint256(0)); IERC20(token1Address).safeIncreaseAllowance( uniRouterAddress, type(uint256).max ); } function _emergencyVaultWithdraw() internal override { IMasterchef(masterchefAddress).emergencyWithdraw(pid); } function _beforeDeposit(address _to) internal override { } function _beforeWithdraw(address _to) internal override { } }
変更されたテキスト
ファイルを開く
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./libs/IMasterchef.sol"; import "./BaseStrategyLPSingle.sol"; contract StrategyMasterHealer is BaseStrategyLPSingle { using SafeMath for uint256; using SafeERC20 for IERC20; address public masterchefAddress; uint256 public pid; constructor( address[5] memory _configAddress, //vaulthealer, masterchef, unirouter, want, earned uint256 _pid, uint256 _tolerance, address[] memory _earnedToWmaticPath, address[] memory _earnedToUsdcPath, address[] memory _earnedToCrystlPath, address[] memory _earnedToToken0Path, address[] memory _earnedToToken1Path, address[] memory _token0ToEarnedPath, address[] memory _token1ToEarnedPath ) { govAddress = msg.sender; vaultChefAddress = _configAddress[0]; masterchefAddress = _configAddress[1]; uniRouterAddress = _configAddress[2]; wantAddress = _configAddress[3]; token0Address = IUniPair(wantAddress).token0(); token1Address = IUniPair(wantAddress).token1(); pid = _pid; earnedAddress = _configAddress[4]; tolerance = _tolerance; earnedToWnativePath = _earnedToWmaticPath; earnedToUsdPath = _earnedToUsdcPath; earnedToCrystlPath = _earnedToCrystlPath; earnedToToken0Path = _earnedToToken0Path; earnedToToken1Path = _earnedToToken1Path; token0ToEarnedPath = _token0ToEarnedPath; token1ToEarnedPath = _token1ToEarnedPath; transferOwnership(vaultChefAddress); _resetAllowances(); } function _vaultDeposit(uint256 _amount) internal override { IMasterchef(masterchefAddress).deposit(pid, _amount); } function _vaultWithdraw(uint256 _amount) internal override { IMasterchef(masterchefAddress).withdraw(pid, _amount); } function _vaultHarvest() internal override { IMasterchef(masterchefAddress).withdraw(pid, 0); } function vaultSharesTotal() public override view returns (uint256) { (uint256 amount,) = IMasterchef(masterchefAddress).userInfo(pid, address(this)); return amount; } function wantLockedTotal() public override view returns (uint256) { return IERC20(wantAddress).balanceOf(address(this)) .add(vaultSharesTotal()); } function _resetAllowances() internal override { IERC20(wantAddress).safeApprove(masterchefAddress, uint256(0)); IERC20(wantAddress).safeIncreaseAllowance( masterchefAddress, type(uint256).max ); IERC20(earnedAddress).safeApprove(uniRouterAddress, uint256(0)); IERC20(earnedAddress).safeIncreaseAllowance( uniRouterAddress, type(uint256).max ); IERC20(token0Address).safeApprove(uniRouterAddress, uint256(0)); IERC20(token0Address).safeIncreaseAllowance( uniRouterAddress, type(uint256).max ); IERC20(token1Address).safeApprove(uniRouterAddress, uint256(0)); IERC20(token1Address).safeIncreaseAllowance( uniRouterAddress, type(uint256).max ); } function _emergencyVaultWithdraw() internal override { IMasterchef(masterchefAddress).emergencyWithdraw(pid); } function _beforeDeposit(address _to) internal override { } function _beforeWithdraw(address _to) internal override { } }
違いを見つける