Skip to content

Commit

Permalink
feat: FactoryDeployable
Browse files Browse the repository at this point in the history
  • Loading branch information
ex3ndr committed Apr 10, 2023
1 parent fb39fc1 commit c5eda8a
Show file tree
Hide file tree
Showing 105 changed files with 689 additions and 110 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## Added
- `FactoryDeployable` trait for deploying from factory contract

## [1.1.0-beta.17] - 2023-04-10

## Added
Expand Down
6 changes: 3 additions & 3 deletions examples/__snapshots__/increment.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`increment should deploy 1`] = `
},
"bounce": true,
"from": "@treasure(treasure)",
"to": "kQBJRbhU2VIEVLWO_H4E0IL1aCu623jQtdqG9jtLjto7X1Yk",
"to": "kQDixDL5zZKoHxcB3HEpItkITz9FXBwy_nhPnDU_Z0E5EnP5",
"type": "internal",
"value": 10000000000n,
},
Expand All @@ -35,7 +35,7 @@ exports[`increment should deploy 1`] = `
"type": "cell",
},
"bounce": true,
"from": "kQBJRbhU2VIEVLWO_H4E0IL1aCu623jQtdqG9jtLjto7X1Yk",
"from": "kQDixDL5zZKoHxcB3HEpItkITz9FXBwy_nhPnDU_Z0E5EnP5",
"to": "@treasure(treasure)",
"type": "internal",
"value": 9990494000n,
Expand All @@ -61,7 +61,7 @@ exports[`increment should deploy 2`] = `
},
"bounce": true,
"from": "@treasure(treasure)",
"to": "kQBJRbhU2VIEVLWO_H4E0IL1aCu623jQtdqG9jtLjto7X1Yk",
"to": "kQDixDL5zZKoHxcB3HEpItkITz9FXBwy_nhPnDU_Z0E5EnP5",
"type": "internal",
"value": 10000000000n,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/output/external_External.abi
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"External","types":[{"name":"StateInit","header":null,"fields":[{"name":"code","type":{"kind":"simple","type":"cell","optional":false}},{"name":"data","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"Context","header":null,"fields":[{"name":"bounced","type":{"kind":"simple","type":"bool","optional":false}},{"name":"sender","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"raw","type":{"kind":"simple","type":"slice","optional":false}}]},{"name":"SendParameters","header":null,"fields":[{"name":"bounce","type":{"kind":"simple","type":"bool","optional":false}},{"name":"to","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mode","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"body","type":{"kind":"simple","type":"cell","optional":true}},{"name":"code","type":{"kind":"simple","type":"cell","optional":true}},{"name":"data","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"Deploy","header":2490013878,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}}]},{"name":"DeployOk","header":2952335191,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}}]},{"name":"ChangeOwner","header":2174598809,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"newOwner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"ChangeOwnerOk","header":846932810,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"newOwner","type":{"kind":"simple","type":"address","optional":false}}]}],"receivers":[{"receiver":"internal","message":{"kind":"text","text":"Topup"}},{"receiver":"internal","message":{"kind":"typed","type":"Deploy"}}],"getters":[{"name":"owner","arguments":[],"returnType":{"kind":"simple","type":"address","optional":false}}],"errors":{"2":{"message":"Stack undeflow"},"3":{"message":"Stack overflow"},"4":{"message":"Integer overflow"},"5":{"message":"Integer out of expected range"},"6":{"message":"Invalid opcode"},"7":{"message":"Type check error"},"8":{"message":"Cell overflow"},"9":{"message":"Cell underflow"},"10":{"message":"Dictionary error"},"13":{"message":"Out of gas error"},"32":{"message":"Method ID not found"},"34":{"message":"Action is invalid or not supported"},"37":{"message":"Not enough TON"},"38":{"message":"Not enough extra-currencies"},"128":{"message":"Null reference exception"},"129":{"message":"Invalid serialization prefix"},"130":{"message":"Invalid incoming message"},"131":{"message":"Constraints error"},"132":{"message":"Access denied"},"133":{"message":"Contract stopped"},"134":{"message":"Invalid argument"},"135":{"message":"Code of a contract was not found"},"136":{"message":"Invalid address"},"137":{"message":"Masterchain support is not enabled for this contract"}},"interfaces":["org.ton.introspection.v0","org.ton.abi.ipfs.v0","org.ton.deploy.lazy.v0","org.ton.chain.workchain.v0","org.ton.ownable"]}
{"name":"External","types":[{"name":"StateInit","header":null,"fields":[{"name":"code","type":{"kind":"simple","type":"cell","optional":false}},{"name":"data","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"Context","header":null,"fields":[{"name":"bounced","type":{"kind":"simple","type":"bool","optional":false}},{"name":"sender","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"raw","type":{"kind":"simple","type":"slice","optional":false}}]},{"name":"SendParameters","header":null,"fields":[{"name":"bounce","type":{"kind":"simple","type":"bool","optional":false}},{"name":"to","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mode","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"body","type":{"kind":"simple","type":"cell","optional":true}},{"name":"code","type":{"kind":"simple","type":"cell","optional":true}},{"name":"data","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"Deploy","header":2490013878,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}}]},{"name":"DeployOk","header":2952335191,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}}]},{"name":"FactoryDeploy","header":1829761339,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"cashback","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"ChangeOwner","header":2174598809,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"newOwner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"ChangeOwnerOk","header":846932810,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"newOwner","type":{"kind":"simple","type":"address","optional":false}}]}],"receivers":[{"receiver":"internal","message":{"kind":"text","text":"Topup"}},{"receiver":"internal","message":{"kind":"typed","type":"Deploy"}}],"getters":[{"name":"owner","arguments":[],"returnType":{"kind":"simple","type":"address","optional":false}}],"errors":{"2":{"message":"Stack undeflow"},"3":{"message":"Stack overflow"},"4":{"message":"Integer overflow"},"5":{"message":"Integer out of expected range"},"6":{"message":"Invalid opcode"},"7":{"message":"Type check error"},"8":{"message":"Cell overflow"},"9":{"message":"Cell underflow"},"10":{"message":"Dictionary error"},"13":{"message":"Out of gas error"},"32":{"message":"Method ID not found"},"34":{"message":"Action is invalid or not supported"},"37":{"message":"Not enough TON"},"38":{"message":"Not enough extra-currencies"},"128":{"message":"Null reference exception"},"129":{"message":"Invalid serialization prefix"},"130":{"message":"Invalid incoming message"},"131":{"message":"Constraints error"},"132":{"message":"Access denied"},"133":{"message":"Contract stopped"},"134":{"message":"Invalid argument"},"135":{"message":"Code of a contract was not found"},"136":{"message":"Invalid address"},"137":{"message":"Masterchain support is not enabled for this contract"}},"interfaces":["org.ton.introspection.v0","org.ton.abi.ipfs.v0","org.ton.deploy.lazy.v0","org.ton.chain.workchain.v0","org.ton.ownable"]}
Binary file modified examples/output/external_External.code.boc
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/output/external_External.code.boc.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h1>Code coverage</h1>
<span class="line-uncovered"><span class="gas"></span><span class="count"></span><span class="padding">....</span><span class="opcode">s0 s1 XCHG</span></span>
<span class="line-uncovered"><span class="gas"></span><span class="count"></span><span class="padding">..</span><span class="opcode">}></span></span>
<span class="line-uncovered"><span class="gas"></span><span class="count"></span><span class="padding">..</span><span class="opcode">get_abi_ipfs PROC:<{</span></span>
<span class="line-uncovered"><span class="gas"></span><span class="count"></span><span class="padding">....</span><span class="opcode">x{697066733A2F2F516D595935744878395A66444C794754666D6969686733734E6337736F795042396474437359505779364339533382_} PUSHSLICE</span></span>
<span class="line-uncovered"><span class="gas"></span><span class="count"></span><span class="padding">....</span><span class="opcode">x{697066733A2F2F516D636D47374C755A4B685676323466586F37447A62335047373364385A4D7559524351714D537558485177395782_} PUSHSLICE</span></span>
<span class="line-uncovered"><span class="gas"></span><span class="count"></span><span class="padding">..</span><span class="opcode">}></span></span>
<span class="line-covered"><span class="gas"></span><span class="count">x5</span><span class="padding">..</span><span class="opcode">?fun_ref_44086a5ce86162fe PROCREF:<{</span></span>
<span class="line-covered"><span class="gas">18</span><span class="count">x5</span><span class="padding">....</span><span class="opcode">s1 PUSH</span></span>
Expand Down
2 changes: 1 addition & 1 deletion examples/output/external_External.code.fc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ _ supported_interfaces() method_id {
}

_ get_abi_ipfs() method_id {
return "ipfs://QmYY5tHx9ZfDLyGTfmiihg3sNc7soyPB9dtCsYPWy6C9S3";
return "ipfs://QmcmG7LuZKhVv24fXo7Dzb3PG73d8ZMuYRCQqMSuXHQw9W";
}

_ lazy_deployment_completed() method_id {
Expand Down
2 changes: 1 addition & 1 deletion examples/output/external_External.code.fif
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ PROGRAM{
86142586315491086060343270784266291122 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d595935744878395a66444c794754666d6969686733734e6337736f7950423964744373595057793643395333} PUSHSLICE
x{697066733a2f2f516d636d47374c755a4b685676323466586f37447a62335047373364385a4d7559524351714d5375584851773957} PUSHSLICE
}>
lazy_deployment_completed PROC:<{
c4 PUSH
Expand Down
2 changes: 1 addition & 1 deletion examples/output/external_External.code.rev.fif
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ PROGRAM{
s0 s1 XCHG
}>
get_abi_ipfs PROC:<{
x{697066733A2F2F516D595935744878395A66444C794754666D6969686733734E6337736F795042396474437359505779364339533382_} PUSHSLICE
x{697066733A2F2F516D636D47374C755A4B685676323466586F37447A62335047373364385A4D7559524351714D537558485177395782_} PUSHSLICE
}>
?fun_ref_44086a5ce86162fe PROCREF:<{
s1 PUSH
Expand Down
6 changes: 5 additions & 1 deletion examples/output/external_External.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contract: External
BOC Size: 912 bytes

# Types
Total Types: 7
Total Types: 8

## StateInit
TLB: `_ code:^cell data:^cell = StateInit`
Expand All @@ -25,6 +25,10 @@ Signature: `Deploy{queryId:uint64}`
TLB: `deploy_ok#aff90f57 queryId:uint64 = DeployOk`
Signature: `DeployOk{queryId:uint64}`

## FactoryDeploy
TLB: `factory_deploy#6d0ff13b queryId:uint64 cashback:address = FactoryDeploy`
Signature: `FactoryDeploy{queryId:uint64,cashback:address}`

## ChangeOwner
TLB: `change_owner#819dbe99 queryId:uint64 newOwner:address = ChangeOwner`
Signature: `ChangeOwner{queryId:uint64,newOwner:address}`
Expand Down
Loading

0 comments on commit c5eda8a

Please sign in to comment.