Home

BUPT密码工程课后作业5-ASN.1

BUPT密码工程课后作业5-ASN.1 要求1 陈述 要求一: 1、使用ASN.1编写一个数据结构。具体什么数据自己考虑。 2、分别使用asn1c、JavaAsn1Compiler等对这个数据结构进行编译。可以使用c/java/python进行编码,并存储,而后用另外一种编程语言进行解码,比如,用C编码,可以用java或者python解码; 3、对上述的数据结构,使用protobuffer实现一次。这里不强制要求不同的语言实现编码和解码。 要求一中的asn文件,protobuffer,编解码源代码,可执行的程序,代码说明书和要求二中的原始文件和解释文档需要一并提交上来,方便我检查。 相信很多人参考了这篇简书,但是里面有一些坑,为了让本不容易的生活稍微容易点,写了这篇希望能有一点儿帮助...

Read more

Is it possible to test contract with bytecode only?

Is it possible to test contract with bytecode only? ##background I only have the bytecode of the contract, and bytecode-level constuctor for the contract. I want to deploy the contract to my local private chain and invoke some methods to run my test logic on the contract. At first, I was thinking about geth, and have done a lot of preperation. ...

Read more

Truffle Test| a bug?

Description Depositing one token without transferFrom into EtherDelta: The contract of EtherDelta: /** *Submitted for verification at Etherscan.io on 2016-08-30 */ //last compiled with soljson-v0.3.6-2016-08-29-b8060c5.js contract SafeMath { //internals function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; ...

Read more

ganache-cli problem

Truffle|xxx Token has not been deployed to detected network (network/artifact mismatch) Description I’m testing one contract today with truffle console, and at the beginning I was running truffle test to test the contract. However, for some reason, I shifted to truffle console method. And I got the error above. Solutions on line I looked up many...

Read more

Truffle version

Truffle version Background Met with one problem today, when using truffle, there are some conflicts with the solc version. Migration.sol pragma solidity >=0.4.21 <0.6.0; Contract_code.sol pragma solidity 0.4.19; solc version 0.4.24 truffle-config.js module.exports = {networks: {development: {host: "127.0.0.1", port: 8545, network_i...

Read more

Expecting property name enclosed in double quotes

Expecting property name enclosed in double quotes Background In this project, I have to dump json file and open this json file in a loop. At first, I looked up some blogs on the internet, most of them talks about the misuse of quotes and double quotes, I checked my code, I found all of the keys in the dictionary used quotes instead of double q...

Read more