物联网是Web3应用的另一个热门领域,它通过***技术和去中心化的方式,实现了物联网设备的安全性和数据隐私保护。数字身份是Web3的另一个应用方向,它通过***技术和去中心化的方式,实现了数字身份的可信、去中心化和安全,打破了传统身份验证案例I8I流程**259I開发技术3365过程机构的垄断,为用户提供更加安全和自主的身份验证体验。
//call the receiveApproval function on the contract you want to be notified.This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from,uint256 _value,address _tokenContract,bytes _extraData)
//it is assumed that when does this that the call*should*succeed,otherwise one would use vanilla approve instead.
require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))),msg.sender,_value,this,_extraData));
return true;
}
}
//SPDX-License-Identifier:MIT
pragma solidity^0.8.4;
constructor(address _CryptoDevtoken)ERC20("CryptoDev LP Token","CDLP"){
require(_CryptoDevtoken!=address(0),"Token address passed is a null address");
cryptoDevTokenAddress=_CryptoDevtoken;
}
}function deposit(uint _amount)public{
uint _pool=balance();
uint _before=token.balanceOf(address(this));
token.safeTransferFrom(msg.sender,address(this),_amount);
uint _after=token.balanceOf(address(this));
_amount=_after.sub(_before);
uint shares=0;
if(totalSupply()==0){
shares=_amount;
}else{
//Plouto Vault的pUSDT铸币量是基于YPool上USDT的数量
shares=(_amount.mul(totalSupply())).div(_pool);
}
_mint(msg.sender,shares);
}
import"openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Exchange is ERC20{
address public cryptoDevTokenAddress;
//Exchange is inheriting ERC20,because our exchange would keep track of Crypto Dev LP tokens