Golang implemented sidechain for Bytom
リビジョン | eb29189ece261e125974247bb42a2b7512307f88 (tree) |
---|---|
日時 | 2019-10-12 17:24:32 |
作者 | oys <oys@oysd...> |
コミッター | oys |
optimise
@@ -165,22 +165,23 @@ func P2WMCProgram(magneticContractArgs MagneticContractArgs) ([]byte, error) { | ||
165 | 165 | // sellerProgram: Program, |
166 | 166 | // standardProgram: Program, |
167 | 167 | // sellerKey: PublicKey) locks valueAmount of valueAsset { |
168 | -// clause partialTrade(exchangeAmount: Amount) { | |
168 | +// clause partialTrade(exchangeAmount: Amount) { | |
169 | 169 | // define actualAmount: Integer = exchangeAmount * ratioDenominator / ratioMolecule |
170 | 170 | // verify actualAmount > 0 && actualAmount < valueAmount |
171 | 171 | // lock exchangeAmount of requestedAsset with sellerProgram |
172 | 172 | // lock valueAmount-actualAmount of valueAsset with standardProgram |
173 | 173 | // unlock actualAmount of valueAsset |
174 | -// } | |
175 | -// clause fullTrade() { | |
174 | +// } | |
175 | +// clause fullTrade() { | |
176 | 176 | // define requestedAmount: Integer = valueAmount * ratioMolecule / ratioDenominator |
177 | 177 | // verify requestedAmount > 0 |
178 | 178 | // lock requestedAmount of requestedAsset with sellerProgram |
179 | 179 | // unlock valueAmount of valueAsset |
180 | -// } | |
181 | -// clause cancel(sellerSig: Signature) { | |
180 | +// } | |
181 | +// clause cancel(sellerSig: Signature) { | |
182 | 182 | // verify checkTxSig(sellerKey, sellerSig) |
183 | 183 | // unlock valueAmount of valueAsset |
184 | +// } | |
184 | 185 | // } |
185 | 186 | // |
186 | 187 | // contract stack flow: |