You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
877 B

2 years ago
// import "@stdlib/jetton";
import "./messages";
import "./wallet";
import "./linker";
import "./jetton_trait";
2 years ago
message Mint {
amount: Int;
}
2 years ago
2 years ago
const gas_consumption: Int = ton("0.01");
const withdraw_gas_consumption: Int = ton("0.05");
const deposit_gas_consumption: Int = ton("0.05");
2 years ago
contract TONB with Jetton {
2 years ago
totalSupply: Int as coins;
owner: Address;
content: Cell?;
mintable: Bool;
first_linker: Address?;
last_linker: Address?;
n_linkers: Int = 0;
2 years ago
init(owner: Address, content: Cell?) {
self.totalSupply = 0;
self.owner = owner;
self.mintable = true;
self.content = content;
}
receive(msg: Mint) {
let ctx: Context = context();
2 years ago
require(ctx.value >= deposit_gas_consumption, "not enough money for deposit");
2 years ago
self.mint(ctx.sender, msg.amount, ctx.sender);
}
}