Skip to content

Commit

Permalink
Refactor contract to include manifestUrl getter and update staticTaxFee
Browse files Browse the repository at this point in the history
  • Loading branch information
Laisky committed Sep 10, 2024
1 parent 62eddf0 commit 2e0d2d7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 1 addition & 4 deletions blockchain/ton/contracts/attest/contracts/attest.tact
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ contract Attest with Common {
contract Bot with Common {
owner: Address;
nonce: Int as uint64 = 0;
staticTaxFee: Int as coins = ton("0");
staticTaxFee: Int as coins = ton("0.01");
master: Address;
manifestUrl: String = "";
// attestTaskIncentives is the balance of the attest task,
Expand All @@ -212,7 +212,6 @@ contract Bot with Common {
// lockedValue is the value that is locked in the contract, cannot be withdrawed.
// To ensure there is enough rent, a deposit of at least 1 TON is necessary.
lockedValue: Int as coins = ton("0");
emitFee: Int as coins = ton("0.01");
attestTaskId: Int as uint64 = 0;

init(master: Address, owner: Address){
Expand All @@ -238,7 +237,6 @@ contract Bot with Common {
receive(msg: SetBotManifest){
let ctx = context();
nativeThrowUnless(codeUnauthorized, sender() == self.master || sender() == self.owner);
nativeThrowUnless(codeNonceInvalid, msg.nonce == self.nonce);
nativeThrowUnless(codeBalanceNotSufficient, myBalance() >= self.lockedValue);

emit(WalletManifestChangedEvent{
Expand Down Expand Up @@ -430,7 +428,6 @@ contract Oracle with Common {
receive(msg: SetOracleManifest) {
let ctx = context();
nativeThrowUnless(codeUnauthorized, sender() == self.master || sender() == self.owner);
nativeThrowUnless(codeNonceInvalid, msg.nonce == self.nonce);
nativeThrowUnless(codeBalanceNotSufficient, myBalance() >= self.lockedValue);

emit(WalletManifestChangedEvent{
Expand Down
9 changes: 9 additions & 0 deletions blockchain/ton/contracts/attest/contracts/messages.tact
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ message(0xd53276db) Excesses {
queryId: Int as uint64;
}


// =====================================
// Events
// =====================================
Expand All @@ -110,3 +111,11 @@ message(0xce1a8739) WalletCreatedEvent {
wallet: Address;
owner: Address;
}

struct Metadata {
// https://github.com/ton-blockchain/TEPs/blob/master/text/0064-token-data-standard.md#content-representation
// 0 for onchain, 1 for offchain
flag: Int as uint8;
// if flag is 1, then the content is a URL to the offchain metadata.
content: String;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export async function run(provider: NetworkProvider) {
await botContract.send(
provider.sender(),
{
value: toNano('0.1'),
value: toNano('1'),
},
{
$$type: 'SubmitAttestTask',
queryId: BigInt("123"),
proofUrl: "https://ario.laisky.com/alias/attest-proof.json",
attestValue: toNano("0.05"),
attestValue: toNano("0.01"),
}
);
}
2 changes: 1 addition & 1 deletion blockchain/ton/contracts/attest/scripts/bot_register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function run(provider: NetworkProvider) {
await masterContract.send(
provider.sender(),
{
value: toNano('0.1'),
value: toNano('1'),
},
{
$$type: 'RegisterBot',
Expand Down

0 comments on commit 2e0d2d7

Please sign in to comment.