质押和流动性挖矿是比较被人们熟知的,最近这两者有了结合--流动性质押,流动性质押,英文名为Liquid Staking,是指用户通过其质押的资产获得流动性的过程。流动性质押允许投资者质押他们的资产,同时也允许质押资产的持有人以衍生代币的形式获得流动性。
如何获取合约?
pragma solidity ^0.4.24;
contract HelloWorld {
string name;
function HelloWorld() {
name = "Hello, World!";
}
function get()constant returns(string) {
return name;
}
function set(string n) {
name = n;
}
}
函数(Functions)
function get()constant returns(string) {
return name;
}
function set(string n) {
name = n;
}
事件(Events)
//事件的声明
event AddMsg(address indexed sender, bytes32 msg);
//事件的使用
function setData(int256 x) public {
storedData = x;
AddMsg(msg.sender, "in the set() method");
}
结构类型(Structs Types)
contract Contract {
struct Data {
uint deadline;
uint amount;
}
Data data;
function set(uint id, uint deadline, uint amount) {
data.deadline = deadline;
data.amount = amount;
}
}