Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity ^0.4.2;
- import "global_functions.sol";
- contract strtest
- {
- bool ib_equal;
- function test(string p1,string p2) returns(bool) {
- ib_equal = strcompare(p1,p2) ;
- return true;
- }
- }
- function strcompare(string p_source,string p_target) external returns(bool) {
- bytes memory lbt_left;
- bytes memory lbt_right;
- lbt_left = bytes(p_source);
- lbt_right = bytes(p_target);
- bool lb_equal = true;
- uint li_length = lbt_right.length;
- for( uint p = 0 ;p < li_length;p++){
- if (lbt_left[p] == lbt_right[p] ) {
- continue;
- } else {
- lb_equal = false;
- break;
- }
- }
- return lb_equal;
- }
- > var test1 = "pragma solidity ^0.4.2;import '/barkely/lend/global_functions.sol';contract strtest { bool ib_equal; function test(string p1,string p2) returns(bool) { return true; }}"
- undefined
- > var test1Compiled = web3.eth.compile.solidity(test1)
- Error: solc: exit status 1
- /tmp/geth-compile-solidity119170518:1:24: Error: Source "/barkely/lend/global_functions.sol" not found: File not found.
- pragma solidity ^0.4.2;import '/barkely/lend/global_functions.sol';contract strtest { bool ib_equal; function test(string p1,string p2) returns(bool) { return true; }}
- ^------------------------------------------^
- at web3.js:3119:20
- at web3.js:6023:15
- at web3.js:4995:36
- at <anonymous>:1:21
- >
- import '/barkely/lend/global_functions.sol' //absoulte path
- import './global_functions.sol' //the same path with strtest.sol
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement